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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,261 次查看
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!

标签 (1)
0 项奖励
回复
2 回复数

676 次查看
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 项奖励
回复

676 次查看
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 项奖励
回复