LPC4370 RTC / About Register's default value after VDD(REG) and VBAT power-on

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

LPC4370 RTC / About Register's default value after VDD(REG) and VBAT power-on

跳至解决方案
1,927 次查看
yasushihasegawa
Contributor III

Dear All,

I am using LPC 4370.
I would like to detect that the RTC battery has been replaced, please answer the following questions.

[Verification procedure]
   Turn OFF the power supply of VDD(REG) and VBAT.
(ii) Supply power to them again.
(iii) RESET processing to RTC is not performed.
    In other words, reset processing to "CTCRST" and "CCALEN bit" of "Clock Control Register (CCR - address 0x4004 6008)" is not performed.
(iv) Access to "Time Counter Group" and "Alarm register group".

[Results]
- Time Counter Group
Seconds register (SEC - address 0x4004 6020) ==> value: 0
Minutes register (MIN - address 0x4004 6024) ==> value: 0
Hours register (HRS - address 0x4004 6028) ==> value: 0
Day of month register (DOM - address 0x4004 602C) ==> value: 1
Day of week register (DOW - address 0x4004 6030) ==> value: 0
Day of year register (DOY - address 0x4004 6034) ==> value: 1
Month register (MONTH - address 0x4004 6038) ==> value: 1
Year register (YEAR - address 0x4004 603C) ==> value: 0

- Alarm register group
Alarm Seconds register (ASEC - address 0x4004 6060) ==> value: 0
Alarm Minutes register (AMIN - address 0x4004 6064) ==> value: 0
Alarm Hours register (AHRS - address 0x4004 6068) ==> value: 0
Alarm Day of month register (ADOM - address 0x4004 606C) ==> value: 0
Alarm Day of week register (ADOW - address 0x4004 6070) ==> value: 0
Alarm Day of year register (ADOY - address 0x4004 6074) ==> value: 0
Alarm Month register (AMON - address 0x4004 6078) ==> value: 0
Alarm Year register (AYRS - address 0x4004 607C) ==> value: 0


[Question]

(Q1)
When executing the above [Verification procedure] procedure, that is, not resetting to RTC, will the default values of A and B always become the value of [Result] above?

(Q2)
Would it be recommended to check the above [Verification procedure] and [Results] for the purpose of detection of power shutdown to RTC?


Best Regards,
Yasushi

标签 (1)
0 项奖励
回复
1 解答
1,218 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Yasushi,

The Time Counter Group and Alarm register group values are not changed by reset, so I would not recommend to use the contents of these registers to determine if the RTC battery has been replaced.

To detect that the RTC has been already initialized and that the battery power has not been lost I would better recommend you to write a flag value as marker to one of the 64 general purpose registers are available to store data when the main power supply is switched off. The general purpose registers reside in the RTC power domain and can be battery powered (REGFILEx). If this flag value is still there after a reset, the RTC is still initialized and the battery has not been replaced so it doesn't need to be set up again. If the word is not there, you need to initialize the RTC and then write the flag value to REGFILEx.

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,219 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Yasushi,

The Time Counter Group and Alarm register group values are not changed by reset, so I would not recommend to use the contents of these registers to determine if the RTC battery has been replaced.

To detect that the RTC has been already initialized and that the battery power has not been lost I would better recommend you to write a flag value as marker to one of the 64 general purpose registers are available to store data when the main power supply is switched off. The general purpose registers reside in the RTC power domain and can be battery powered (REGFILEx). If this flag value is still there after a reset, the RTC is still initialized and the battery has not been replaced so it doesn't need to be set up again. If the word is not there, you need to initialize the RTC and then write the flag value to REGFILEx.

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 项奖励
回复