How does puck js keep timer going in sleep mode? #4249
Replies: 1 comment
-
Posted at 2023-10-27 by @fanoush
Not really, where did you find such information? There is no such mode that could cause issues with 'keeping an internal counter going' except removing battery. Also you may check this for power consumption in various scenarios https://www.espruino.com/Puck.js#power-consumption Posted at 2023-10-30 by @gfwilliams The actual processor can be put into a mode that shuts everything down and wakes on external inputs, but that's not something Puck.js does, since the normal sleep functionality (that keeps the internal RTC running as well as all contents of RAM) gets power consumption down to 3uA (6+ years on a CR2032) which seemed more than enough. So yes, effectively Puck.js does sleep while keeping any counters and the RTC in memory, but that's because the processor is efficient enough at sleeping that it doesn't have to shut everything off. It's worth noting that Puck.js and other Bluetooth Espruino devices put themselves to sleep automatically, for example:
Will end up with the processor asleep 99% of the time. All Posted at 2023-11-02 by user156858 I see I was under the impression that NRF_sleep() was the equivalent of system off sleep mode and not system on sleep mode. In that case I understand the deal, although that means I have bigger consumption problems in my application than I thought I did, I'm already using system off and I get way too much consumption . Posted at 2023-11-02 by user156858 thanks for the clarification, as I said to fanoush I had the wrong idea about what type of sleep mode NRF_sleep() was, I'm only familiar with NRF SDK development in C so I was trying to understand what the puck was doing to apply it to my application. Posted at 2023-11-02 by @fanoush
for sleeping it calls sd_app_evt_wait If you have high power draw like 0.5mA or 1mA it may be that you left something powered on like I2C,SPI,UART Posted at 2023-11-03 by @gfwilliams Do you have anything else connected to the Puck? If not, if you could send your code I can take a look and try and see what's causing the power draw.
UART is a big power draw, but you may also find that having a pin in 'pullup' state, or that's driving an output against a pullup (or an external sensor that is unpowered) can easily increase current draw. Posted at 2023-11-03 by user156858 Perhaps I didn't make myself clear but I'm not actually using the Puck, I'm using the nRF52840 in a completely different setting, I just wanted to understand how the Puck was making use of its nRF chip to see if I could lower my high consumption values. But yeah I'm getting about 8mA current consumption while in operation and about 0.7 mA in sleep mode, I'm already using the deepest sleep mode (system off) so I'm not sure what can I be leaving on, I should be getting less than 100uA for sure. Anyway I think it's clear for me regarding the puck on what is being done, thank you both for your support @fanoush and @gfwilliams Posted at 2023-11-06 by @gfwilliams Ok, yes, I don't think you mentioned that at all. If you want to ask questions about non-official Espruino devices in the future please can you ask in https://forum.espruino.com/microcosms/1085/ ? We have different forums because I'm trying to run a business, and while I give all the software I make away for free, I can't afford to support people in companies using that software for free in their products Posted at 2023-11-07 by @fanoush
You may check values here |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-27 by user156858
Hi there, I'm quite new to the puck js. I'm wondering about one of its features as claimed by a colleague of mine. Apparently it can keep an internal counter going even after waking up from sleep mode (correct me if I'm wrong).
How does this work exactly?
As far as I know it doesn't have an external RTC and supposedly the NRF sleep function shuts everything off including the real time counter module, so unless I'm wrong about something, what am I missing? Can someone help?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions