Using both the Electron and Photon, I’ve got a CR2032 hooked up to the VBAT line to keep the RTC retained through power cycles. However, when I restart the device and call Time.isValid()
it returns false
; the time is also not correctly set (reads Jan 1, 1990 or whatever). What could be the reason for this? Anything I can debug? I’ve checked the connection several times and have verified there is 3V on VBAT when the device is powered off. I have also remove the 0 ohm resistor on the Electron…
It shouldn’t be required but you could try adding
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY))
Also what system version are you running?
Sorry for the stupid question, but you have the negative pole of the cell connected to GND too?
Yup, the negative poll is connected to Ground (and verified). I am running OSv0.7.0 and already have that line in the firmware:
void startup() { System.enableFeature(FEATURE_REATAINED_MEMORY); System.enableFeature(FEATURE_RESET_INFO); } STARTUP(startup);
It should actually be
STARTUP(startup()); // <-- don't forget the parentheses
@LabSpokane, he did!
2 Likes
Sorry. That line didn’t show on my mobile. Apologies.