Reply
Posts: 19
Registered: ‎01-10-2016

CPU Frequency choice for lowest power

When you are designing for lowest power, do you choose a high freq CPU clock or a low freq CPU clock? Assuming that all other peripherals that you use can function regardless, and that you can live with the latency implied by a lower freq CPU.

 

I see for a lower freq CPU, you get a lower uA/MHz spec,

 

but for a fast freq CPU, wouldn't you complete your goal faster such that you could go back into a low power mode sooner?

 

Which is better, or it is a wash? Is there a nifty deciding-algorithm you can use when you know roughly how many clock cycles you need to perform while awake?

Posts: 307
Registered: ‎03-03-2015

Re: CPU Frequency choice for lowest power

Hi Ross,

 

Your observations are correct that lower frequencies draw less dynamic power, but higher frequencies let the processor get to a lower power mode sooner.  In addition to the dynamic power (which varies based on clock speed), static power is constant over clock speeds.  Because of this it is usually faster to use a faster clock speed.  However, it will depend a bit on you application, so I'd suggest varying the clock speed a bit and measuring the results.

 

Application note AN0027 has more information on what variables affect energy consumption, and offers ideas on how to reduce it.

 

Regards,

Joe

Posts: 435
Registered: ‎07-13-2015

Re: CPU Frequency choice for lowest power

@rossboss The datasheet of the chip tells you how much uA/MHz it consumes. For instance, the EFM32WG940 consumes less uA/MHz on higher clock speeds, making it a little more efficient.

 

However, the thing about energy management is that it is very much a software question. If you can write your code in such a way that your CPU core can spend as much time as possible in sleep mode, then it can be better to run the chip at a high frequency because then it spends less time in run mode and more time in sleep mode. Take a look at AN0007.

 

If you use EFM32, you can use most of its peripherials in such a way that they require very little attention from the CPU, which means that for example while it's waiting for I/O it can perform other tasks or wait in EM1 or EM2. There is more information in AN0027.

 

For example, if you communicate through low-speed UART, then you can use the LEUART and the DMA of the EFM32 together so that the CPU only needs to wake up when you received all the data. (See AN0017 for more details.)

Posts: 8,109
Registered: ‎08-13-2003

Re: CPU Frequency choice for lowest power

However, the thing about energy management is that it is very much a software question

the main thing here is "when energy conscious, you are not coding a PC"

I once were tasked with making a totally working unit use less power (the requirement was 24 hours between recharge, it only did 21). I found lots of code where no concern to code efficiency had been applied, There even was a linked list (UGH). replacing some lookups with indexed access, getting rid of the linked list and some other things made the unit run for 33 hours.

 

so, yes there may be a small difference between a fast clock and a slow clock, but if you want to use less power, look at your code.

erik
Posts: 435
Registered: ‎07-13-2015

Re: CPU Frequency choice for lowest power

so, yes there may be a small difference between a fast clock and a slow clock, but if you want to use less power, look at your code.

 

Yeah, I totally agree with that!

Posts: 19
Registered: ‎01-10-2016

Re: CPU Frequency choice for lowest power

Great! Thanks for the responses guys. I'm totally on board with what you're saying: do things as efficiently as possible and utilize the available low power hardware to offload CPU chores. I guess my query was more theoretical: assuming you are a coding savant and found the absolute minimum number of op codes to complete your task, you have used the available hardware resources as effectively as you could, and there is not a way to offload your task into low energy hardware . In that scenario, fast or slow cpu freq?

 

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> Alf
Posts: 280
Registered: ‎09-06-2012

Re: CPU Frequency choice for lowest power

I'm voting fast* as it allows you to execute what you do with minimum energy (E = P x t).

 

I'm sorry, really OT, but my academic side just kicked in: The answer to your topic question would actually be: slow, as that would have the lowest power, but I think you really want to ask "Frequency choice for minimum energy consumption", and the answer to that is: fast.

 

I made this awesome drawing in paint illustrating the difference (this is probably why you asked the question in the first place). Yellow is the baseline current for EM0/EM1, and green is the energy consumed for executing the code.

 

power_vs_energy.png

 

* This assumes you're executing a quite small piece of code, where most of the code is storable in cache. If all code has to be executed from flash, you will get a two cycle penalty for each instruction fetch when running above 32 MHz, one cycle penalty above 16 MHz.

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 66
Registered: ‎09-17-2012

Re: CPU Frequency choice for lowest power

The correct answer is AS SLOW AS POSSIBLE, don't listen to these other guys.

Since the power consumption is proportional to the clock frequency, this means the ENERGY used for processing (time * power) is THE SAME no matter which clock frequency you select (consider this - twice the clock frequency means half the time but twice the power - the outcome is the same). Thus, the total energy spent depends on the sleep time - paradoxically, since all your extra power is spent during sleep, the more you sleep the more power you waste. Optimally, you should choose the clock frequency so low that your processor is constantly working.

 

This is not entirely true, given that power consumption is not exactly proportional to clock frequency, but I think it is close enough.

Posts: 435
Registered: ‎07-13-2015

Re: CPU Frequency choice for lowest power

@Godskalk The static power that the MCU consumes is constant accross clock speeds. If you run on a lower clock speed, your code runs for more time and you have to spend more on static power. Also (according to the device datasheet) the MCUs consume more uA/MHz on lower speeds, so overall you end up spending more energy if you run it slowly.

Posts: 8,109
Registered: ‎08-13-2003

Re: CPU Frequency choice for lowest power

[ Edited ]

Since the power consumption is proportional to the clock frequency, plus the static power.

 

since all your extra power is spent during sleep, the more you sleep the more power you waste.

see below

 

This is not entirely true.

correct

 

whether sleep or not, you spend the static power. thus, since time*dynamic_power is a constant, and it is irrelevant whether you spend the static power in sleep or not you will spend (very close to) the same energy whether fast or slow

erik
Posts: 66
Registered: ‎09-17-2012

Re: CPU Frequency choice for lowest power

Well, now you're assuming that, during sleep, you use only static power. That is nearly true for EM2 and below, but not at all for EM1. So if any of your sleeping time is in EM1, you are better of with a lower clock speed.

Posts: 435
Registered: ‎07-13-2015

Re: CPU Frequency choice for lowest power

I'm talking about the static power in EM0 that is constant regardless of the frequency you run at. See Figure 1.1 in AN0027.

Posts: 66
Registered: ‎09-17-2012

Re: CPU Frequency choice for lowest power

@Timur, but erikm was talking about static power consumption in lower energy modes.

I see from AN0027 that the static power consumption is lower in lower energy modes, so that makes you correct; if you always use EM2 or lower for sleep, then running as high clock frequency as possible will be beneficial.

However, if you use EM1 at all, then you are probably better off going for a low clock speed, and the benefit can be quite big.

Posts: 435
Registered: ‎07-13-2015

Re: CPU Frequency choice for lowest power

@Godskalk I wouldn't say if you use EM1 at all but I agree that it needs to be taken into consideration. EM1 only comes into the picture if you are doing tasks when the CPU is sleeping but some of the peripherials are still running, otherwise there is no point of using EM1, you can go to EM2 or EM3 without a second thought.

 

If you do need to use EM1 (because you are using a peripherial that needs it), I suggest to disable all other peripherials that you don't need and then minimize the time spent in EM1 exactly as I suggested to minimize time spent in EM0. In this case, the sooner you can get to a lower energy mode, the better. Robot Happy

Highlighted
Posts: 40
Registered: ‎06-15-2015

Re: CPU Frequency choice for lowest power

Hi

 

I would run at a speed so low that you avoid wait-states Robot wink

 

Regards