![]() |
Forum Index : Microcontroller and PC projects : CPUSPEED vs mA - tinkering
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
I know the RP2040 is not best suited for ultra lower power - but looking to extend battery life on a project. I took my 1 from 4 LED flasher and hooked it up to one of those USB power displays. I set CPUSPEED from 48000 to 180000 and let it run. ![]() Was really interested to note how much less current was drawn at the lowest speed. 14mA - which would mean, left on 24/7 that a 10,000mAh batter pack would last about 1 month. Say six hours a day (evening/night) - would equate to 4 months - not too shabby. Not sure I can reduce this further (make the LEDs dimmer) - but as they only draw ~5mA, the biggest overhead is the pico itself. Question: Can any of the internal (and here unused) processes be turned off in any manner? Entropy is not what it used to be |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 530 |
Would be interesting to see if the Pico 2 is better. As far as I know there is a sleep mode built into the processor. Greetings Daniel |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4875 |
Nimue, I have prototyped an external circuit to the pico that - pico can shut itself down. - a push button can wake up de pico That brings the power consumption to near 0. But the pico is OFF while asleep, so you cannot run any tasks. If you are interested, I can dig up the schematics. Volhout PicomiteVGA PETSCII ROBOTS |
||||
Frank N. Furter Guru ![]() Joined: 28/05/2012 Location: GermanyPosts: 940 |
...are you really sure about the unit? Shouldn't that be “MHz” instead of “KHz”? Frank |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7559 |
The Pico 2 has an overall lower power consumption, I think, particularly at the higher power levels. IIRC it can actually be slightly worse than the RP2040 at low CPU speeds though. There are ways to shut down various modules but not from MMBasic. There are several "power states" which MMBasic cannot use because it has to be running and they shut down various areas of RAM! The CPU speed cannot be changed on the fly under MMBasic. There is no usable "sleep" mode with a "wake up" input that I can see on the RPxxxx. There is a system, but the processor is effectively dead so MMBasic couldn't use it. Overall the Pico and Pico 2 under MMBasic are not a great choice for battery operation. There are much better devices. . Edited 2025-05-14 16:55 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
Have a Pico-2, so will try. Entropy is not what it used to be |
||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
That sounds interesting - happy to tinker. For this use case, a manual switch will suffice, but for future projects sounds intriguing. Thanks! Entropy is not what it used to be |
||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
Doh! - yes - thank for the spot. Entropy is not what it used to be |
||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
Yea - initially started with an ATTINY85 as it has a genuine low power / shutdown mode between cycles if needed. BUT I loathe to arduino IDE / infrastructure -- dont know why but it drives me to genuine anger and frustration. It's not the C/C++ like language - the actual offline coding, upload to the device see if it works, fix, reupload process - whereas I keep coming back to MMBasic for the joy of typing "RUN". Its more than familiarity, its the whole concept. I suppose if this was more than a fun hobby tinkering project (either serious use or commercial in some way) I would use the ATTINY for the low power, but for something sitting on my shelf its the "journey" not the destination etc ;-) As a PS - I even considered PIC chips, but as I've never bought into that architecture the startup cost to get the toolset seems somewhat off putting. Entropy is not what it used to be |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2147 |
Are you after your device to power itself off (i.e. needs manual intervention to come back up) or just use minimum juice when idle? does the Pico support the CPU SLEEP command? on my '170s, CPU SLEEP takes current down to sub mA territory and figures heavily in my current, data acquisition, project that wakes up for between 5 and 10 seconds every hour. Runs on a quad of NiMh AAs charged by a 6V nominal solar panel. So power use is foremost in my mind. I have 4 moisture sensors that are 6mA a-piece(!) so there is no way I can leave them running. A high side switch flicks the power on when I need them. Same with the LoRa transmitter, although this is probaly over-kill as the module consumes a tiny amount when inactive - but evry little bit helps right? I use a HTU21D for temperature and humidity measurement but as that is on the same I2C bus as the RTC, I can't switch the power to that tidily without upsetting RTC commands, but as it only uses between 20-140nA when idle, it is less of a problem. With all the above, I have quiescent consumption down to 1 or 2mA and battery voltage floats between 5.0 and 5.3 over current 24 hour periods (we have bright sunny days just now - you might need to do some research on that for full understanding from Wales ![]() Nastiest surprise while developing this was the power regulator... you can read about that here if you are interested. h Edited 2025-05-14 18:21 by CaptainBoing |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7559 |
Regarding your comments on the Arduino system - me too! Except that I don't like C/C++ either. I much prefer Python if I can't have MMBasic. I used to use PIC chips. GCBASIC is excellent! Interesting in that the GCBASIC assembler, linker and compiler are written in BASIC. :) MPLAB is huge. The little PicKit programmers are available as Chinese clones so the cost isn't too bad. For sheer speed of development you can't beat an interpreter with a combined editor though. There is simply nothing else that can match it. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2147 |
![]() GCBasic is excellent for the PIC environment. I would use it a lot more if I wasn't so lazy and comfortable with my standard fit '170 with MMBasic which just seems to do everything I ask. |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2434 |
The MicroMite Mk2 has a true low power mode. It is a PIC32MX170 with MMBasic 5.05.05. Loading the firmware can be done with a blank Arduino Nano and Pic32prog.exe Pic32prog contains both the Nano programmer sketch and the DOS programming tool so no need for the Arduino IDE. Tassy Jim and Robert Rozee on this forum have made Windows front ends for Pic32prog. Once the firmware is loaded tie the reset pin on the Nano to ground and use its USB / TTL serial converter to communicate with the MicroMite. Edit. I think Grogster sells MicroMites on development boards with a PIC16F1455 as a combination firmware programmer and USB serial. Edited 2025-05-14 18:29 by phil99 |
||||
Bleep Guru ![]() Joined: 09/01/2022 Location: United KingdomPosts: 582 |
I built a solar battery charger, monitor, fridge controller thing. The 2040 uses 10mA @ 48Mhz if you use the CPU SLEEP n command it makes almost no difference, so I eventually commented it out. With back lit 2 line 16 character LCD it takes 14mA total. I do know the 2350 has much better low power modes, but I don't know if Peter has tied them into the CPU SLEEP command. Give it a go. Regards Kevin |
||||
Nimue![]() Guru ![]() Joined: 06/08/2020 Location: United KingdomPosts: 390 |
The 2040 uses 10mA @ 48Mhz if you use the CPU SLEEP n command it makes almost no difference, so I eventually commented it out. With back lit 2 line 16 character LCD it takes 14mA total. I do know the 2350 has much better low power modes, but I don't know if Peter has tied them into the CPU SLEEP command. Give it a go. Regards Kevin Job for this evening. Will feedback. Entropy is not what it used to be |
||||
PhenixRising Guru ![]() Joined: 07/11/2023 Location: United KingdomPosts: 1170 |
Despite this abuse the Pico 2 still works just fine! ![]() Overclocking the Pico 2 |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7559 |
Then it got a bit warm in its dry ice (-20C). ![]() These things are pretty rugged. Still not ideal when you only want them to have just a sip of the mA though. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
PhenixRising Guru ![]() Joined: 07/11/2023 Location: United KingdomPosts: 1170 |
![]() These things are pretty rugged. Still not ideal when you only want them to have just a sip of the mA though. Yeah, probably not the right choice for battery power but now I'm feeling pretty comfortable @ 300MHz which fluctuates between 40 and 50 mA. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10080 |
What the extreme overclockers don't do is ever write to flash. This is the limiting factor in my experience. I can easily boot the Picomite firmware much faster than 378Mhz if I disable flash writing but can't find any way to both overclock and write. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10080 |
What the extreme overclockers don't do is ever write to flash. This is the limiting factor in my experience. I can easily boot the Picomite firmware much faster than 378Mhz if I disable flash writing but can't find any way to both overclock and write. This is not an issue of flash clock speed. However low that is set the problem is still there. |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |