Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using STM32F0 MCU and STM32 CubeMX configurator. I encountered the clock configuration below

enter image description here

When would be occasions to use a lower clock speed? Wouldn't faster always be preferable?

share|improve this question
up vote 3 down vote accepted

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.)

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.