RTC time being reset to 0 after wake from Sleep


#1

To manage down the power used by a photon (0.6.2) that is powered off a VRLA battery stack I am implementing a System.Sleep() with wake/continue on user button press creating a rising signal on an interrupt pin or after a defined period of time to reconnect and listen for any commands. All this is working well and has enabled much improved time between battery recharge. Ever so occasionally I have noticed that the RTC will be reset to 0 coming out of Sleep. I know this because I log events into a SD card memory buffer with a created date/time. These events then get sent when the photon is cloud connected.

I understand from the documentation that RTC can be considered to behave the same as backup RAM. I am not removing the power from VIN. VBat is not connected. I was expecting RTC to be retained so that after waking the photon would have the correct local time before it had connected and sync’d. Is it possible the floating VBat is occasionally causing a reset?

I also use System.sleep(SLEEP_MODE_DEEP) - in the case of LVD condition with the VRLA battery stack - and perform a restart after exiting from deep sleep.


#2

@armor, a floating VBAT may be the issue. STMicro recommends tying VBAT to Vcc (aka 3V3) if it is not used.


#3

Thanks - will try that. Hardware Change :frowning: 200 devices in the field!