# Current consumption in MCU

I am using STM32F051 MCU in my project. System requirement is minimal current consumption. The signals that I am processing are very low frequency (almost DC) I decrease the system frequency from 48 MHz to 8 MHz (turn off PLL)and barely see any decrese in the current of my board. Approximately 5 mA decrease. In the datasheet they talking about ~25 mA of decrease comparing 48 MHz to 8 MHz. Do you know why?

I am using GPIO, 3 timers, UART and ADC (3 channels)

• Does the application use a sleep mode when idle? That could explain it. Some embedded OSes do that. – fgrieu May 29 '18 at 12:07
• no, only run mode – Daniel_ee571 May 29 '18 at 12:33
• Not an answer, but something to think about: I did a substantial project based on a STM32F1 which included a lot of power-saving techniques. Later, I explored the STM32L1 series, which was much, much better regarding low power consumption. If you're not locked into your uC, you may want to look into a STM32L0 or STM32L1... – bitsmack May 29 '18 at 17:56

I'm using the F051 in two projects and found the datasheet values to be fairly accurate, though I haven't done a full inspection like I did with other micros.

My sample points are very limited but were taken with just a minimal set of peripherals active (sum of Ivdd and Ivdda):

• Using the internal oscillator:
• 1 MHz: 0.96 mA
• 0.5 MHz: 0.75 mA
• HSE in bypass:
• 1 MHz: 0.79 mA
• 0.5 MHz: 0.54 mA

And the values in the datasheet are pretty close to that. It is a bit of a mess to find the values which are realistic but the table of typical values in run mode with data processing running from flash is quite usable:

So this one tells you that with peripherals disabled (that is close to your use-case) you'd get around 8 mA out from reducing the frequency from 48 MHz to 8 MHz.

The ADC is a bit of a wasteful component which I'm not sure how it scales with frequency, but I suspect it doesn't scale very good.

You should be seeing a 17 mA drop when switching to 8 Mhz.

Datasheet specifies 22 mA @ 48MHz with PLL and all peripherals enabled (but not in use). And 4.4 mA @ 8Mhz with PLL disabled and all peripherals enabled.
This is also not taking into account any current used by the ADC/DAC or GPIO.

Any pull-up/down or driven GPIO must be added to this. Samples of the ADC and load on the DAC must also be added to this.

• Any Pins I don't use, should I configure them as default (GPIO IN) or configure them as Analog_in or else? – Daniel_ee571 May 29 '18 at 12:42
• @Daniel_ee571 for other members of the STM32 family putting them into analog in resulted in least current taken (might cause EMI problems if left unconnected, keep that in mind). – Arsenal May 29 '18 at 12:53
• @Daniel_ee571 See AN4538. Although not for F051, it will be in the right direction. – Jeroen3 May 29 '18 at 13:09

Even if I use my MCU at a 1 Hz clock frequency (that's very slow!) but connect a resistor + LED to GND to one of the outputs and make the LED light up, I can make the setup use say 10 mA. Switch the LED off and it consumes 1 uA.

My point being: the current consumption of any MCU does not only depend on what clock frequency it is using but also what is connected to the outputs. If an output has to deliver current (as in my LED example above) then you will see that current back in the supply current.

Also an MCU in standby will consume a lot less current than the same MCU running some heavy calculations.

You should determine where the current is consumed. Switch off as many blocks as possible and switch them back on one by one to determine which block consumes how much.

Also note that current consumption can vary a lot, most low power products rely on a low duty cycle. Say an MCU consumes 10 mA when active but it is only active for 1 second every 5 minutes. Then the average current is:

1 sec / (5 x 60 sec) * 10 mA = 1/300 * 10 mA = 33 uA

That is the average current so when running on a battery that could result in a battery life of many months (depending on the battery of course).

• The current consumption of the core will depend on the clock. But of course, that current is a drop in the ocean compared to things like GPIO and LEDs. – Lundin May 29 '18 at 13:02