Hi, I am using s32k146 microcontroller. I was working with an application using the RTC module, but I'm getting troubles with it.
I based my code on the RTC example, but RTC is not working.
The RTC Time Seconds Register (TSR) value increases rapidly.
And the TPR (RTC Time Prescaler Register) value increases irregularly.
rtc_timedate_t timeConfig = {
.year = 2016U,
.month = 1U,
.day = 1U,
.hour = 0U, /*!< Hour */
.minutes = 0U, /*!< Minutes */
.seconds = 0U /*!< Seconds */
};
void RtcInit(void)
{
const rtc_init_config_t rtcUserCfg0 = {
.compensationInterval = 0U,
.compensation = 0,
.clockSelect = RTC_CLK_SRC_OSC_32KHZ,
.clockOutConfig = RTC_CLKOUT_DISABLED,
.updateEnable = true,
.nonSupervisorAccessEnable = true
};
RTC_DRV_Init(RTCTIMER1,&rtcUserCfg0);
RTC_DRV_SetTimeDate(RTCTIMER1,&timeConfig);
RTC_DRV_StartCounter(RTCTIMER1);
}
I would like to know why the TSR value increases rapidly.
Please let me know the setting values for CLKIN port, RTC Initialization, rtcclk, etc.
It would be helpful if I receive a help in this regard.
Thanks in advance.