how to set the system clock speed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to set the system clock speed

1,469 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sbishop77 on Thu Jan 28 16:32:24 MST 2016
I'm using the OM13078 54102 evaluation board, and trying to set the system clock to 12 Mhz.  To do that I have modified the BOARD_MAINCLOCKRATE macros in both board.h files, changing their values to be 12000000.

Unfortunately, I don't have a scope or anything to measure the clock speed, but I do see a drastic drop in power usage via the "Power Measurement Tool" of the LPCXpresso IDE.  (From about 6.5 mA to 2.2 mA, if I remember right.)

However, to double-check the clock speed I checked the value of the SystemCoreClock global variable (on the M4) and it still reports 100000000, which would be the board's default of 100 Mhz.  Is that an indication that I've done something wrong?  If so, how am I supposed to do this?

By the way, I am aware that there are many possible clock sources and configurations.  At this point I am just looking for the easiest way to 12 Mhz.
Labels (1)
0 Kudos
1 Reply

744 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Wed Feb 24 09:35:18 MST 2016
Hi sbishop77,

Changing the BOARD_MAINCLOCKRATE in board.h is the correct way to set the core clock frequency when using the default LPCOpen startup functions. Did you recompile all relevant projects after making this change? (i.e. chip library, board library, and whatever application project you're using).
0 Kudos