4
\$\begingroup\$

I'm starting with Cortex M processors, but I have lots of experience with 8bit MCUs.

Say I have a buffer that needs to be updated every 5ms. There is an interrupt that goes every 5ms and the buffer is updated and the required calculations execute. The MCU goes back to sleep, until the next interrupt occurs.

At 500KHz on my 8051 MCU, this task takes 3ms. At 32MHz on my 8051 MCU, this task takes (made up number) 0.2ms.

On the 8051, I found that it required less current to actually run the MCU at 500KHz and sleep for less time between the 5ms interrupt, versus running it at the fastest speed (32MHz) and sleeping longer.

On a PIC, it was the reverse results. It was better to run the MCU fast, and sleep it quickly. (PIC has some great AppNote on power saving, and they call out both approaches.)

For the Cortex M processors, is it more energy efficient to run the system quickly and sleep it quickly? Or should you aim for the slowest clock speed?

I understand this calculation is kind of task dependent, obviously if you need a 48MHz interrupt (or whatever the MCU max clock speed is), this is a moot point.

But in general, what have you guys seen when power profiling your systems?

I'm sure the Cortex M uses less energy per MHz increases per the datasheet, but I'll be darned if my 8051 says the same thing but in reality doesn't work like that at all when I started mixing in the power saving modes.

\$\endgroup\$
  • 3
    \$\begingroup\$ Seeing that the Cortex M4F used in the Nordic BLE chips run with 64 MHz and use very little power on average makes me think that quick bursts and sleep long is more efficient. In my projects the controller is active all the time, so I haven't got measurements on this. A colleague said that the clock wakeup time was the crucial difference between two controllers (both Cortex M0) so I'm not sure if there is a general answer for this. \$\endgroup\$ – Arsenal Jan 17 '18 at 21:08
3
\$\begingroup\$

This is very dependent on your exact application, exact MCU and exact circuit. There is no definitive choice between "sleep a lot, run fast" or "run slow all the time" as there are many ways to "sleep" and "run".

Most MCUs have different "depth" of sleep modes. You can sleep with internal 32kHz oscillator, wake up then run from a faster internal oscillator, or start an internal PLL and multiply the oscillator to get higher speed (but the PLL takes time = power to start), you can wake up and start an external crystal (it also takes time and power to stabilize).

Some MCUs have peripherals that can do a lot without using the MCU at all (eg. the PRS in EFM32). If you say that you need a periodic interrupt to calculate something, then you also probably need to get the data in (unless only the internal state matters). Some MCUs can use timers and DMA to trigger the ADC, transfer data and only wake up the CPU when eg. 1000 samples are ready, so you can sleep much more if you just change your application's requirements.

On one project I have worked on, an STM32L011 had best power efficiency when sleeping with a 32kHz internal oscillator and running from internal 2.1MHz oscillator. Don't generalize. If my calculations were more demanding, then perhaps bumping the clock speed to reduce processing time could give better power efficiency (even at the expense of having to wait for the clock system to reconfigure and stabilize).

\$\endgroup\$
  • \$\begingroup\$ Is 2.1MHz the max speed that oscillator can run at on L series? (I'm primarily 8bit guy, I don't know the realm of ARM Cortex M -- I am guessing not). Did you try increasing the clock to speed up the internal oscillator and measure vs. your current speed? The question isn't really about sleeping modes, just hold whatever sleeping mode you want constant, did you see a benefit to burst processing when you made your measurement? \$\endgroup\$ – Leroy105 Jan 17 '18 at 21:26
  • 1
    \$\begingroup\$ I think it is the standard HSI (high-speed internal) oscillator on STM32s, but I've only used the STM32L011. Don't treat Cortex-M as something uniform - an STM32L011 is very different from a MKE06Z128 (both M0+) and even more different from an NXP K64. Clock system is totally different between manufacturers (and families). The "only" thing in common is the instruction set, systick and debug registers. \$\endgroup\$ – filo Jan 17 '18 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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