kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Current consumption on sleep modes

Sun Jul 25, 2021 7:57 pm

If you come from the SBC world, the power consumption of the RP2040 seems great and you feel like it can work on a battery forever (compared to RPI, for example). If, on the other hand, you come from the microcontroller world, the 180uA in dormant mode seems very high - like at least one order of magnitude to high and basically prevents this chip from being used in a whole class of applications where battery life is of a great importance.

I was wondering WHY it is like that. Is there some specific issue that makes it impossible to reduce the power consumption in dormant mode any further? Or it is the case simply because it wasn't seen as particularly important when designing the chip? What exactly is consuming this current? Is it caused by the technology/process used to manufacture the chip (like it's mostly some leakage current) or it's something else? Is it possible that the future chips from this family will have this improved or the current situation is considered good enough and the battery powered, mostly sleeping sensors are simply not the target projects for those chips?

It would be interesting and educational to get better understanding of this, maybe someone from the foundation could comment on that?

cleverca22
Posts: 4336
Joined: Sat Aug 18, 2012 2:33 pm

Re: Current consumption on sleep modes

Sun Jul 25, 2021 8:21 pm

one thing i noticed, is that each of the 6 ram banks has its own power enable flag

at the cost of loosing the contents for a chunk of ram, you can probably get the power usage even lower

User avatar
nick.mccloud
Posts: 1280
Joined: Sat Feb 04, 2012 4:18 pm

Re: Current consumption on sleep modes

Sun Jul 25, 2021 9:59 pm

kadamski wrote:
Sun Jul 25, 2021 7:57 pm
or the current situation is considered good enough and the battery powered, mostly sleeping sensors are simply not the target projects for those chips?
I do a fair amount of IoT at present and for most of the battery powered stuff a single core running at 4 or even just 2MHz is more than sufficient - so for the Pico one of the cores is a bit redundant and the 180uA is as you say, a bit much. So I guess the short answer is it wasn't the target.

However for a signal monitoring project that is on the cards that is likely to have to do FFT (or similar) at the very least and even perhaps then match the spikes against an ML model, this fits beautifully - particularly if we pre-check the Pico's for overclocking stability so we can put them in to turbo mode if required.

So I guess it's just horses for courses.
Pico/RP2040 ≠ Arduino
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute

cleverca22
Posts: 4336
Joined: Sat Aug 18, 2012 2:33 pm

Re: Current consumption on sleep modes

Sun Jul 25, 2021 10:09 pm

nick.mccloud wrote:
Sun Jul 25, 2021 9:59 pm
I do a fair amount of IoT at present and for most of the battery powered stuff a single core running at 4 or even just 2MHz is more than sufficient - so for the Pico one of the cores is a bit redundant and the 180uA is as you say, a bit much. So I guess the short answer is it wasn't the target.
another thing of note, is that turning the crystal clock off may save some power
the cpu can run entirely from an internal RC oscilator, but its freq accuracy is much worse

depends on if you need good timing accuracy or not

you could also switch when going into sleep modes

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 2:03 am

The active clock is switched off in dormant mode and the other clock can be switched off prior so it doesn't really matter which clock you use.

I think you would struggle to find a similar microcontroller (especially speedwise) with a lower current in full-standby mode.

You could store state in flash and switch off externally if you want an ultra deep sleep.

User avatar
Imperf3kt
Posts: 4640
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia
Contact: Twitter

Re: Current consumption on sleep modes

Mon Jul 26, 2021 3:11 am

This video on YouTube explains how to put the pico into deep sleep which will net you just over 6.6mW of current

https://youtu.be/05o5QOZkpwg

Edit: after doing the conversions, this is actually 0.002A, which should be 2000uA, so significantly more than the 180uA you are claiming.
I'd be interested to see how you achieved that figure.
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

trejan
Posts: 3586
Joined: Tue Jul 02, 2019 2:28 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 3:40 am

pidd wrote:
Mon Jul 26, 2021 2:03 am
I think you would struggle to find a similar microcontroller (especially speedwise) with a lower current in full-standby mode.
Single digit µA standby isn't unusual. A dual core STM32 H7 with a Cortex-M7 + Cortex-M4 is < 3µA in standby.

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 3:41 am

Imperf3kt wrote:
Mon Jul 26, 2021 3:11 am
This video on YouTube explains how to put the pico into deep sleep which will net you just over 6.6mW of current

https://youtu.be/05o5QOZkpwg

Edit: after doing the conversions, this is actually 0.002A, which should be 2000uA, so significantly more than the 180uA you are claiming.
I'd be interested to see how you achieved that figure.
180uA is in the RP2040 spec sheet as a typical value.

The guy the video is trying to measure a value much smaller than the capabilities of his meter, the spec for his meter is 1mA (1000uA) resolution then there will at least 1 lsd error as well.

He calculated 6.6mW from his dubious 2000uA reading.

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 3:47 am

trejan wrote:
Mon Jul 26, 2021 3:40 am
pidd wrote:
Mon Jul 26, 2021 2:03 am
I think you would struggle to find a similar microcontroller (especially speedwise) with a lower current in full-standby mode.
Single digit µA standby isn't unusual. A dual core STM32 H7 with a Cortex-M7 + Cortex-M4 is < 3µA in standby.

Not according to the first spec I looked at ....https://www.st.com/en/microcontrollers- ... eries.html

Only some of the single core micro-controllers have less current than the RP2040

trejan
Posts: 3586
Joined: Tue Jul 02, 2019 2:28 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 4:43 am

pidd wrote:
Mon Jul 26, 2021 3:47 am
Not according to the first spec I looked at ....https://www.st.com/en/microcontrollers- ... eries.html
The table is listing stop mode with all RAM enabled. It greatly drops if you use D3 stop which will power off some blocks of RAM then it will still be less than the RP2040. The single digit standby current spec isn't fair to compare as that is standby mode which turns off all RAM except for a tiny 4K backup RAM. RP2040 dormant mode has all the RAM still powered.

Are there any measurements for a RP2040 in dormant with most of the RAM turned off? It should be much less than the typical 180uA listed in the datasheet.

Trying to force a microcontroller that wasn't explicitly designed to be low power into an ultra low power application isn't going to turn out well whether it is a Raspberry Pi designed chip or one from somebody else. The STM H7 when running at full tilt uses a lot of power.

dshadoff
Posts: 88
Joined: Wed Apr 28, 2021 3:12 am

Re: Current consumption on sleep modes

Mon Jul 26, 2021 6:02 am

This comparison is nonsensical even if all the values are accurate.
Perhaps a comparison against other $1 chips would be more appropriate.

It seems to me that 80% of working with electronics is actually "shopping", since there are so many different measures (cost, performance, consumption, features). No chip will be the best at everything or ideal for all applications. You need to determine your priorities and select parts accordingly. Pico's strengths are very high-performance/flexible I/O, low cost, large program size, and low current consumption at full speed (among other things).

But in any case, if Pico doesn't meet your requirements then you may need to choose another microcontroller.

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 9:06 am

So, to be clear, I'm not doing any direct comparisons, I am interested in understand what makes some micro controllers able to go into 1-digit uA current sleep and not others.
cleverca22 wrote:
Sun Jul 25, 2021 8:21 pm
at the cost of loosing the contents for a chunk of ram, you can probably get the power usage even lower
The idea of RAM consuming the energy seems possible and I did think about it previously. I don't have proper equipment currently to experiment with that so I asked others. If disabling 5 out of 6 RAM blocks would safe noticeable amount of power, it might be beneficial to use it in some applications. I would see some projects where limiting to just single 64kB block of RAM (for the whole runtime) wouldn't be an issue and some more advanced use cases with disabling the RAM dynamically before going to sleep and recovering afterwards could also be practical.

Note, however, that it is SRAM, so we are not loosing its content when we disable the power. The datasheet says we just have to make sure they are not accessed, which is even better. The question is - how much we can gain by doing that..
pidd wrote:
Mon Jul 26, 2021 3:41 am
The guy the video is trying to measure a value much smaller than the capabilities of his meter, the spec for his meter is 1mA (1000uA) resolution then there will at least 1 lsd error as well.
Also, that is the consumption of the whole board (including the voltage regulator, flash chip, etc). While I'm only talking about the RP2040 power consumption.
dshadoff wrote:
Mon Jul 26, 2021 6:02 am
Perhaps a comparison against other $1 chips would be more appropriate.
Well, this is not what I'm looking after - I'm not really interested in doing comparisons, I just want to understand. And the "cost factor" is not satisfy my curiosity as I would like to know what exactly increases the cost if we want to go into lower deep sleep power consumption. The cost of RP2040 is great and it is hard to find comparable microcontrollers, especially since each of them has their own unique characteristics so you can always say it is apple-to-oranges comparison. I don't know, for example, any other Cortex-M0+ based micro with so much RAM. Also, I don't know what precisely makes the microcontrollers cost more or less than others.

And maybe, indeed, huge amount of RAM is the reason for that large sleep current? The ESP32, for example, can go down to 10uA even though it has comparable amount of RAM (and price) but it disables all the RAM and looses its content when it does that so that's something completely different. But if we look at, for example, ATSAMD51, it can go down to two-digit uA power consumption in hibernation mode with full system RAM retained (and it has comparable amount of RAM).
dshadoff wrote:
Mon Jul 26, 2021 6:02 am
But in any case, if Pico doesn't meet your requirements then you may need to choose another microcontroller.
Obviously.. but that wouldn't teach me anything. I'm not expecting anything from their micro, I just want to learn and the Foundation is heavily focused on education and learning and this is why I'm asking this question as I know somebody may give me an answer. They also have all the means to, for example, verify and document how disabling some memory banks (as suggested above) could influence the power consumption and they are the only ones who could comment on the future of this line of products (which I really like)

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 10:57 am

kadamski wrote:
Mon Jul 26, 2021 9:06 am
Note, however, that it is SRAM, so we are not loosing its content when we disable the power. The datasheet says we just have to make sure they are not accessed, which is even better. The question is - how much we can gain by doing that..
If you power SRAM off it does lose its contents, its not flash.

User avatar
nick.mccloud
Posts: 1280
Joined: Sat Feb 04, 2012 4:18 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 11:07 am

pidd wrote:
Mon Jul 26, 2021 10:57 am
If you power SRAM off it does lose its contents, its not flash.
From the RP2040 data sheet:
2.11.4. Memory Power Down
The main system memories (SRAM0...5, mapped to bus addresses 0x20000000 to 0x20041fff), as well as the USB DPRAM, can be powered down via the MEMPOWERDOWN register in the Syscfg registers (see Section 2.21). When powered down, memories retain their current contents, but cannot be accessed. Static power is reduced.
 CAUTION Memories must not be accessed when powered down. Doing so can corrupt memory contents.
When powering a memory back up, a 20 ns delay is required before accessing the memory again.
Maybe one of the designers could clarify - does this mean we can take power off the whole MCU chip in this state - seems doubtful but interesting.

As mentioned by the OP, it would be interesting to know what differences there are that make for a single digit uA sleep mode.

And as getting close to chip designers is hard unless you corner one at a conference, I for one would be happy to pay good money for a weekend un-conference where we can suck their brains dry (not literally) and learn more - I'm sure James would give them time off in lieu as I guess it would involve him too and I'm also sure they'd be fed & beer would flow from as a thank you.
Pico/RP2040 ≠ Arduino
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 11:08 am

pidd wrote:
Mon Jul 26, 2021 10:57 am
If you power SRAM off it does lose its contents, its not flash.
You are right - it makes sense that if you power the memory down completely, it looses its content. The fact that it is SRAM only means that we don't have to refresh the memory. But the datasheet is stating the content is retained.

So what do they mean by powering the SRAM down if the content is retained? Or maybe this is false information? But it's not just one sentence that states that. Apparently SRAM has something called DRV (Data Retention Voltage) - a reduced voltage under which the content of SRAM is preserved but it cannot be changed. It can be significantly lower than the normal voltage and by using it, the leakage current is apparently heavily reduced. But even if this is what the datasheet had on mind, we don't know how much this voltage is lower from the normal voltage and, thus, how much current we can cut.

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 11:45 am

Does going into dormant mode preclude running code in RAM rather than flash because of the 20nS recovery requirement of the RAM (=two clock cycles at 100MHz)? I'd presume the first thing it does is to read an instruction when triggered out of dormant mode?

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 12:48 pm

pidd wrote:
Mon Jul 26, 2021 11:45 am
Does going into dormant mode preclude running code in RAM rather than flash because of the 20nS recovery requirement of the RAM (=two clock cycles at 100MHz)? I'd presume the first thing it does is to read an instruction when triggered out of dormant mode?
I would expect so. But you don't have to power down all the SRAM banks so you could keep just one 4kb one enabled while keeping 5 other in "powered down". The interrupt vectors could be kept in the single enabled bank. And if you run code from flash, like in most usecases, this shouldn't be a problem, especially if XIP is also disabled before going dormant, as before the code from flash is fetched on wakeup, 20nS surely will long be passed.

One interesting thing is that the MEMPOWERDOWN register also allows powering down ROM. If we don't use the math routines in the ROM, we could probably safely keep it powered down for the whole time after the boot.

hippy
Posts: 10523
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Current consumption on sleep modes

Mon Jul 26, 2021 1:12 pm

dshadoff wrote:
Mon Jul 26, 2021 6:02 am
if Pico doesn't meet your requirements then you may need to choose another microcontroller.
Indeed but how does one know if they need to or don't if they don't know how much power it uses or by how much power can be reduced.

It would be a shame if someone did discount using an RP2040 because of the headline "180uA" figure if it can indeed go lower.

It would be nice to know just how low it can go without using external hardware to disconnect its supply, what needs to be done and the price to pay to achieve that.

Ideally a list of "if you do this you will save this much, will get you down to this, but it also means this" would help people get a feel for what they can achieve set against what would be acceptable to them. With that they can set about comparing to other offerings.

asu
Posts: 58
Joined: Sun Jul 18, 2021 8:19 am

Re: Current consumption on sleep modes

Mon Jul 26, 2021 1:19 pm

If the sleep mode power consumption is indeed actually high - could it be due to things like the buck converter on the Pico as opposed to being the actual idle RP2040 power draw?
I can't find the 180µA figure on the RP2040 datasheet so I'm assuming this was measured or comes from another document.

pidd
Posts: 2499
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Current consumption on sleep modes

Mon Jul 26, 2021 1:34 pm

asu wrote:
Mon Jul 26, 2021 1:19 pm
If the sleep mode power consumption is indeed actually high - could it be due to things like the buck converter on the Pico as opposed to being the actual idle RP2040 power draw?
I can't find the 180µA figure on the RP2040 datasheet so I'm assuming this was measured or comes from another document.
RP2040 data sheet Section 5.4 (page 636), it is stated at 0.18mA typical

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 2:03 pm

pidd wrote:
Mon Jul 26, 2021 1:34 pm
RP2040 data sheet Section 5.4 (page 636), it is stated at 0.18mA typical
Also is is worth noting that the datasheet says:
For power consumption of the Raspberry Pi Pico, please see the Raspberry Pi Pico Datasheet.
So I assume this is the consumption of only RP2040, not the Pico board.

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 2:11 pm

hippy wrote:
Mon Jul 26, 2021 1:12 pm
It would be a shame if someone did discount using an RP2040 because of the headline "180uA" figure if it can indeed go lower.
Exactly. It seems like it should be possible to go lower than that, we just don't know how much lower. With current situation of chip shortage it is hard to measure this as a custom board would be useful for that (to make sure we measure only the RP2040 consumption).

In any case, it seems like RPF did not have enough resources to properly analyse and document this, yet - even the whole sleep library (and dormant example) is not yet part of SDK as its not polished enough, yet (like - there is no code that would reinitialize everything properly after waking up, for example). So the question if its on the radar still remains.

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Mon Jul 26, 2021 3:45 pm

Just for the records, I managed to make a testing setup.

~380uA was the best I could get with rp2040 on a minimal board, without flash, no pull resistors on the board - just the chip, some required capacitors and a crystal. I am measuring the current on the output of the linear regulator and I'm running the hello_dormant application from RAM. There shouldn't be more than a few uA of leakage on the capacitors, I don't expect the crystal to take any current since it's not running. The ambient temperature is around 23°C. I have no better multimeter at hand.

Image

kadamski
Posts: 201
Joined: Fri Jun 08, 2012 10:56 pm

Re: Current consumption on sleep modes

Tue Jul 27, 2021 3:08 pm

I soldered the flash back to be able to easily disable all the memories. The power consumption I got on dormant mode was ~390uA. After disabling all the memory banks via syscfg_hw->mempowerdown, it was reduced to 280uA. So all the memory banks seems to consume ~110uA of current. The flash itself (which is in line with datasheet) seems to consume around 10uA when idle.

Now, if only I could get to this 180uA base consumption that the datasheet claims and then reduce that by 110uA by disabling the memory banks, that would be much better power consumption figure!

Unfortunately I have no idea how to reproduce the values from the datasheet. Anyone knows what I may be doing wrong in my setup?

User avatar
LukeW
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 53
Joined: Tue Jul 07, 2015 2:19 pm

Re: Current consumption on sleep modes

Tue Jul 27, 2021 7:30 pm

kadamski wrote:
Mon Jul 26, 2021 11:08 am
pidd wrote:
Mon Jul 26, 2021 10:57 am
If you power SRAM off it does lose its contents, its not flash.
You are right - it makes sense that if you power the memory down completely, it looses its content. The fact that it is SRAM only means that we don't have to refresh the memory. But the datasheet is stating the content is retained.

So what do they mean by powering the SRAM down if the content is retained? Or maybe this is false information? But it's not just one sentence that states that. Apparently SRAM has something called DRV (Data Retention Voltage) - a reduced voltage under which the content of SRAM is preserved but it cannot be changed. It can be significantly lower than the normal voltage and by using it, the leakage current is apparently heavily reduced. But even if this is what the datasheet had on mind, we don't know how much this voltage is lower from the normal voltage and, thus, how much current we can cut.
Yes this is a "state retaining power down" which is a bit of a misnomer, as far as I understand it means that the SRAM storage array remains fully powered but some SRAM read/write circuitry (sense amps etc) is powered down. The SRAM arrays are responsible for a good chunk of the total static power dissipation, but they're nice SRAMs in other respects e.g. density, access time.

We're interested in characterising the silicon at a retention voltage for lower sleep current, but there is a lot of outstanding work here. Since RP2040 has a single core voltage domain this would involve bringing the entire core supply down to the retention voltage before entering the dormant state. Right now we only guarantee operation at 1.1V -10%.

I've pinged someone within the company who can hopefully provide details on the 180 uA dormant figure.

Return to “General”