RT1050 keeping RTC across power cycles?

cancel
Showing results for 
Search instead for 
Did you mean: 

RT1050 keeping RTC across power cycles?

Jump to solution
543 Views
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 Solution
377 Views
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);

View solution in original post

3 Replies
377 Views
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!
-------------------------------------------------------------------------------

378 Views
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);
377 Views
jackking
Senior Contributor I

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

0 Kudos