52258 Coldfire: How do we detect RTC battery loss / Loss of time?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

52258 Coldfire: How do we detect RTC battery loss / Loss of time?

961 Views
circuitMaker
Contributor I

I see in the MCF52258 / 59 Ref Manual that the real time clock registers only get "reset" once, if the power sourct (backup battery) is disconnected.  The Days, Hours, and Minutes values go to "??".  Is there a bit to test to see if the clock is invalid?

 

Thanks!

Labels (1)
0 Kudos
2 Replies

376 Views
circuitMaker
Contributor I

I may have found something that will work.

 

The alarm hours & minutes register (ALRM_HM) does get cleared on power loss.  Since I am not using the alarm, I load it with a pre-defined value.  On boot, I check to see if that value is still there.  If not, the battery was removed.

If you know of a better method, please chime in!

Thanks!

0 Kudos

376 Views
ipa
Contributor III

Hi,

I used this chip - and I wasn't able to clean this alarm register - after startup it has something on it.

Ipa 

0 Kudos