AnsweredAssumed Answered

Can you trust Real-time clock powered by Supercapacitor

Question asked by Danish Ali on Mar 26, 2015
Latest reply on Mar 27, 2015 by Danish Ali
Is there a way to tell if the reading in the real-time-clock is valid - i.e. that the clock has kept ticking since the last time it was set?
My board has a STM32f405, and its backup domain is powered by a Supercapacitor that is charged from the Vdd line.

The supercapacitor is sufficient to keep the real-time-clock running over short power-outages (design time 20 minutes, to allow the main battery in my system to be changed). But if the loss of power is longer than this (say overnight), I find that the RTC module stops counting and instead holds a time about 4 hours since power was last applied.
I guess the voltage dropped sufficiently that the 32kHz oscillator stopped oscillating but RTC->DR and RTC->TR still kept their values and there was no backup-domain reset.

Is there a way to tell if this has happened?
RTC->ISR.INITS reads as 1 i.e. "Calendar has been initialised" since RTC->DR.YT and RTC->DR.YU are still non-zero. (Incidentally there might be a Year-2100 bug associated with relying on RTC->ISR.INITS if that is how it works. But then as RTC does not have a Century register, how is it to know if year 00 is a leap-year or not, so there might be other year-2100 bugs).

The only way I could imagine fixing this is to use external hardware to crowbar the supercapacitor once it drops below a certain voltage - but that hardware isn't on my current board. (And I haven't yet thought how I might do it).

Does anyone have suggestions as to how to tell if the RTC time and date are still valid after loss of main power?