Hello,
I have custom board with external battery and RTC. RTC is stored in memory correct by power-on and by user. After power-off and power-on checking RTC time and date, everything is correct. When i come back the next day, RTC time is gone.
I am using 3.3V coin on VDD_SNVS_IN.
I have based my program from the example project "evkbimxrt1050_snvs_hp_rtc".
None of these example projects are using SNVS config pins:
Do i need to use these pins?
What am i doing wrong?
I am using the following API:
SNVS_LP_SRTC_SetDatetime(...);
SNVS_LP_SRTC_GetDatetime(...);
Maybe I need to use ?:
SNVS_HP_RTC_SetDatetime(...);
SNVS_HP_RTC_GetDatetime(...);
Solved! Go to Solution.
Problem is fixed:
Originally i was use both LP and HP RTC, and synchronize between the 2.
HP RTC is not made to use to run from battery, LP RTC is (do not use any of the HP RTC API!).
So i removed HP RTC and now i have almost 2 weeks RTC correct on battery.
Wrong Init:
SNVS_LP_SRTC_GetDefaultConfig(&snvsSrtcConfig);
SNVS_LP_SRTC_Init(SNVS, &snvsSrtcConfig);
SNVS_LP_SRTC_StartTimer(SNVS);
SNVS_HP_RTC_GetDefaultConfig(&snvsRtcConfig);
SNVS_HP_RTC_Init(SNVS, &snvsRtcConfig);
/* Synchronize RTC time and date with SRTC and start RTC */
SNVS_HP_RTC_TimeSynchronize(SNVS);
SNVS_HP_RTC_StartTimer(SNVS);
Correct init for running long time on battery:
SNVS_LP_SRTC_GetDefaultConfig(&snvsSrtcConfig);
SNVS_LP_SRTC_Init(SNVS, &snvsSrtcConfig);
SNVS_LP_SRTC_StartTimer(SNVS);
Problem is fixed:
Originally i was use both LP and HP RTC, and synchronize between the 2.
HP RTC is not made to use to run from battery, LP RTC is (do not use any of the HP RTC API!).
So i removed HP RTC and now i have almost 2 weeks RTC correct on battery.
Wrong Init:
SNVS_LP_SRTC_GetDefaultConfig(&snvsSrtcConfig);
SNVS_LP_SRTC_Init(SNVS, &snvsSrtcConfig);
SNVS_LP_SRTC_StartTimer(SNVS);
SNVS_HP_RTC_GetDefaultConfig(&snvsRtcConfig);
SNVS_HP_RTC_Init(SNVS, &snvsRtcConfig);
/* Synchronize RTC time and date with SRTC and start RTC */
SNVS_HP_RTC_TimeSynchronize(SNVS);
SNVS_HP_RTC_StartTimer(SNVS);
Correct init for running long time on battery:
SNVS_LP_SRTC_GetDefaultConfig(&snvsSrtcConfig);
SNVS_LP_SRTC_Init(SNVS, &snvsSrtcConfig);
SNVS_LP_SRTC_StartTimer(SNVS);
Hi,
SNVS config pins could be left floating.
For you are using HP_RTC demo, it need to use below API functions:
SNVS_HP_RTC_SetDatetime(...);
SNVS_HP_RTC_GetDatetime(...);
And if possible, please to measure the power consumption of VDD_SNVS_IN pin. Please refer below data about SNVS(RTC) related typical current data:
Wish it helps.
Mike