cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 - power

nick239955
Associate II
Posted on October 07, 2012 at 16:57

So I managed to get my boards programmed and working... except one little detail - power consumption is rather high for my application. With both UARTs on and nothing else, running on HSI at 48Mhz, current consumption is at 10.2mA when starting up and 9.5-9.3 once everything is initialized.

Any suggestions towards lowering that? Ideally under 5mA... if that's even possible?

Would hate having to switch to STM32L* now that all code was done? 

TIA!
10 REPLIES 10
zzdz2
Associate II
Posted on October 08, 2012 at 18:49

Typical datasheet values (all peripherals disabled):

L152@32MHz: 9.6mA

F051@32MHz: 7.6mA

F051@48MHz: 11.8mA

Doesn't look like STM32L* consume less power than F0* and your chip power consumption seems better than average.

To make it even lower you can use something like wfi/wfe instructions, power save modes or lower clock.

Posted on October 08, 2012 at 20:43

It depends a lot about what your pins are driving, and what the processor is doing.

The CPU will consume a lot less in a WFI idle loop than if it just grinds around in a while(1);

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
nick239955
Associate II
Posted on October 08, 2012 at 22:12

Thank you very much for your replies. The micro is supposed to communicate with 2 other ICs using the UARTs at a rather low baud rate. Only USART1 and 2 are active from all the peripherals. From time to time it should also read/write a few bytes from flash using the EEPROM emulation code that came with the examples.

I have done some preliminary measurements and it seems average current consumption is at around 9.5 mA while peak is at around 10.5. 

Also makes me wonder how it actually can average 9.5 while the dev kit is pretty stable at 6.5 but maybe I still have much to learn about board design. Or maybe I'm measuring my board before the regulator, and the dev kit after? Just a thought, didn't check the discovery schematic yet.

I can understand why (thank you Clive) the average consumption would drop if entering sleep mode, it makes perfect sense. However am I safe to assume it won't affect peak consumption much?

Will also play with various HSI frequencies tomorrow morning. Am I wrong thinking that about 12Mhz should have no issue driving 2 UARTs at rates up to 256k bauds?

Also I'm surprised how can an entry-level micro work with less power than a more expensive micro that's advertised as ''ultra low power''... but maybe there's something I'm missing. But then again if I'd advertise a car that does 500mpg I wouldn't change my mind within the manual and say it only does 50 but hey, it also makes coffee and gives you a massage... because obviously people looking at an fuel-economic car don't give a rat's backside about getting their massage while driving...

Nevertheless just spent $50 on 2 of these STM32L dev kits so I can measure then maybe enojoy myself sending them some ''WTF?!?!!!11'' e-mail.. 
nick239955
Associate II
Posted on October 09, 2012 at 03:27

I was able to run the micro at 8Mhz with both UARTs talking at up to 56k with 3.7 to 4.1 mA.

zzdz2
Associate II
Posted on October 09, 2012 at 09:44

''Also I'm surprised how can an entry-level micro work with less power than a more expensive micro that's advertised as ''ultra low power''... but maybe there's something I'm missing.''

I think it's mostly caused by the newer Cortex-M0 core.

''ultra low power'' chips use the older M3, and F0* use M0 which is somewhat simpler than M3 and ST introduced this core just recently so maybe they did some new silicon optimizations, who knows.

frankmeyer9
Associate II
Posted on October 09, 2012 at 15:55

''Also I'm surprised how can an entry-level micro work with less power than a more expensive micro that's advertised as ''ultra low power''... but maybe there's something I'm missing.''

''Advertised as ultra low power'' must be seen in reference to other M3 cores.

More important is the gate count. Without driving significant external loads, the consumption is proportional to the clock frequency and the transistor/gate count.

As a comparative example, a PIC18F, clocked with 32MHz, draws about 3mA, as measured.

Multiply this by 32/8, as it is a 8-Bit controller, and you get about the same consumption range as the F0.

zzdz2
Associate II
Posted on October 09, 2012 at 20:36

''As a comparative example, a PIC18F, clocked with 32MHz, draws about 3mA, as measured.

Multiply this by 32/8, as it is a 8-Bit controller, and you get about the same consumption range as the F0.''

Comparing PIC to ARM is not quite adequate, PIC uses four system clock cycles as instruction cycle so PIC@32MHz means 8-bit CPU@8MHz.

Anyway, your example helped me to discover new feature introduced in STM32F0 -- you can connect USART to high speed system clock while AHB clock is divided.

This way you can save lots of power and retain USART accuracy.

frankmeyer9
Associate II
Posted on October 10, 2012 at 08:35

Comparing PIC to ARM is not quite adequate, PIC uses four system clock cycles as instruction cycle so PIC@32MHz means 8-bit CPU@8MHz.

Why not ?

The PIC18 need 4 clock cycles to get one instruction through ... and so what ?

Most gates are clocked with 32MHz in this case, and this frequency determines the rate at which the (FET) gates and parasitary capacities are charged and discharged.

I was talking of gate count and clock frequency, not of instruction throughput. I am fully aware of the fact that this core is one of the worst at the market in regard of performance.

zzdz2
Associate II
Posted on October 10, 2012 at 10:44

You may be right, the cpu core uses all four cycles to process single instruction, really simple cpu.