Electronic – When would be occasions to use a lower clock given that high speed would always be preferable
clockclock-speedstm32
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?
Best Answer
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.)
The legally correct answer is "anything can happen": you operate a component outside its specs, so you are not allowed to count on any specific behaviour.
My best guess is that the display will flicker, or maybe (if you are unlucky) will not operate at all.
The internal oscillator is much less stable than an external crystal oscillator.
If I'm reading the datasheet correctly, the internal 48 MHz oscillator is only factory calibrated to within 2.9% of the specified frequency - not even good enough for RS-232. There are ways to synchronize it to an external clock, I think it's designed to be used in a USB device situation where you can lock the PLL to the USB bitstream.
An external crystal is typically accurate to around 20 ppm, parts-per-million. That's 0.002% from the specified frequency. If you need even better, there are even temperature compensated, ovenized crystal oscillators.
Additionally, you may want an exact clock speed at a different frequency, typically for communication with a device or master over an asynchronous communications channel. For this you might need an oscillator at for example 29491200 Hz (115200*256).
Best Answer
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.)