4 ms·
It's common for the lowest power sleep mode of a chip to not maintain RAM. That means whenever you sleep(1 minute) in the code, the system gets entirely restar
by londons_explore 3y ago
It's common for the lowest power sleep mode of a chip to not maintain RAM.
That means whenever you sleep(1 minute) in the code, the system gets entirely restarted.
Yes, it's inconvenient, but the benefit is you can sleep for years on a tiny battery. As a programmer, all you need to do is save a few flags of state to persistent memory - eg. EEPROM, and then at startup check those flags to return to whatever task you should be doing.
You should check how often you'll be doing this - because EEPROM typically can only be programmed 1000 - 100,000 times in the lifetime of the device. So you might need a cleverer scheme where the first byte of eeprom is a pointer to another place where you store the actual state. Whenever the area of memory where you store the state starts to fail, you change the pointer to a new location.
- mmoskal 3y agoThere are often some RTC registers that get preserved during standby, so you can use that instead of flash or EEPROM.
- systems_glitch 3y agoMain reason for the 56 bytes or whatever above the clock and calendar register :P