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,267件の閲覧回数
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 返答(返信)

682件の閲覧回数
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 件の賞賛
返信

682件の閲覧回数
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 件の賞賛
返信