I am using STM32F0 MCU and STM32 CubeMX configurator. I encountered the clock configuration below
When would be occasions to use a lower clock speed? Wouldn't faster always be preferable?
|
I am using STM32F0 MCU and STM32 CubeMX configurator. I encountered the clock configuration below When would be occasions to use a lower clock speed? Wouldn't faster always be preferable? |
|||
|
|
|
The microcontroller draws more power when running at higher clock speeds. In battery-powered devices, running at a lower speed may improve battery life. Additionally, many peripherals derive their clocks from core clocks; the requirements of those peripherals and the devices they're connected to may place requirements on core clock speeds. (To give a specific example: The USB peripherals on certain STM32 microcontrollers require that a 48 MHz clock be available. If the core clock is not a multiple of 48 MHz, this isn't possible.) |
|||
|
|
|
Lower clock frequency means lower consumption. As soon as you don't have infinite power, i.e. a wall outlet, every mA will count toward your battery life, and of course all this power will be turned into waste heat that you might have to deal with. Processing events as fast as possible, then putting the controller to sleep/standby would be another possibility to achieve lower average consumption, but it could also introduce some unpleasant spikes and emissions that are simply not there when running at a slower speed. Waking up from sleep, and waiting for the clocks to stabilize takes some time too. Some peripherals might perform better at lower speeds, e.g. if your flash needs wait states above 32 MHz, then running code at 48 MHz might actually be slower than at 32 MHz. |
|||
|
|