7 years, 7 months ago.

LPC824 Changing clock frequency at runtime

Hello

Is it possible to change the clock frequncy, say reduce it 1/5 of its normal operation at runtime?

Also, for 38400 UART communication a clock speed of 5MHz is good enough?

Bets Regards

1 Answer

7 years, 7 months ago.

You can change the clockspeed at runtime, however, that will typically also affect many derived clocks like the us timers, baudrates for the serial ports etc. Most mbed libs will only correct those clockspeeds when you declare the objects after adjusting the main clock. You have to check the datasheet and mbed lib implementation regarding the 38400 baudrate. The hardware has a limited range of possible divider values to derive the baudrate from the main clock. When you are trying to save power it is usually better to run the core at high speed for the actual computations and use sleep modes to deactivate the device the rest of the time. Wake up from sleep through a regular timer interrupt.