RT1050 keeping RTC across power cycles?

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

RT1050 keeping RTC across power cycles?

跳至解决方案
3,669 次查看
jackking
Senior Contributor I

Hopefully this is just a dumb question, but I don't see any of the SDK samples to demonstrate keeping the RTC running across power cycles.

I am using an imxrt1052 with VBAT_IN (VDD_SNVS_IN) fed by a 3V coin cell.

I tried setting and then commenting out the call to: SNVS_HP_RTC_SetDatetime(SNVS, &rtcDate);

but the clock is still reset after a power cycle.

Is there something I am missing to keep RTC running across cycles?

1 解答
3,503 次查看
jackking
Senior Contributor I

OK, that at least pointed me in the right direction.  The SDK sample "snvs_lp_srtc" demonstrates syncing the hp_rtc and the lp_rtc.  I was able to confirm that this sample does allow using the RTC across power cycles with a coin cell connected.

It does require commenting out the lines that set the lp_rtc after the first execution:

    /* Set SRTC time to default time and date and start the SRTC */
//    SNVS_LP_SRTC_SetDatetime(SNVS, &srtcDate);
//    SNVS_LP_SRTC_StartTimer(SNVS);

在原帖中查看解决方案

3 回复数
3,503 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Jack King

From the Reference manual:

SNVS_HP is in the chip's power supply domain and thus receives power along with the rest of the chip, which is off when the system power is down.

If the SNVS_LP power input is connected to an uninterrupted power supply, the GPR value is maintained when the main SoC is powered off.

pastedImage_1.png

I hope this info helps you.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
-------------------------------------------------------------------------------

3,504 次查看
jackking
Senior Contributor I

OK, that at least pointed me in the right direction.  The SDK sample "snvs_lp_srtc" demonstrates syncing the hp_rtc and the lp_rtc.  I was able to confirm that this sample does allow using the RTC across power cycles with a coin cell connected.

It does require commenting out the lines that set the lp_rtc after the first execution:

    /* Set SRTC time to default time and date and start the SRTC */
//    SNVS_LP_SRTC_SetDatetime(SNVS, &srtcDate);
//    SNVS_LP_SRTC_StartTimer(SNVS);
3,503 次查看
jackking
Senior Contributor I

Bumping this...  nobody has used the RTC with battery backup before?

0 项奖励
回复