I used the external crystal oscillator (32768HZ) for the real-time clock experiment, but I found that my read time is always 0:0:0 on January 1, 2016. I feel that the real-time clock is not counting.
The following is my configuration, can you help check if there is a problem?
The following is my program configuration and initialization
RTC_DRV_Init(RTCTIMER1, &rtcTimer1_Config0);
RTC_DRV_ConfigureSecondsInt(RTCTIMER1, &rtcTimer1_SecIntConfig0);
RTC_DRV_SetTimeDate(RTCTIMER1, &rtcTimer1_StartTime0);
RTC_DRV_StartCounter(RTCTIMER1);
if(Key_Test==1)
{
Key_Test = 0;
RTC_DRV_GetCurrentTimeDate(RTCTIMER1, ¤tTime);
}
Finally, I found out that it was read on January 1, 2016, 0:00, 0:00.
Hi yang wei
Have you tried the Demo code that is included in the SDK? I saw that you have the same configuration that the example code, does this example work for you?
/* Initialize RTC instance * - See RTC configuration component for options */ RTC_DRV_Init(RTCTIMER1, &rtcTimer1_Config0); /* Configure RTC Time Seconds Interrupt */ RTC_DRV_ConfigureSecondsInt(RTCTIMER1, &rtcTimer1_SecIntConfig0); /* Set APIS to allow usermode access to RTC Memory Space */ /* Clear bit position to grant usermode access level */ AIPS->OPACR[regIdx] &= ~AIPS_OPACR_SP5_MASK; /* Switch to user mode */ swUserMode(); /* Set the time and date */ RTC_DRV_SetTimeDate(RTCTIMER1, &rtcTimer1_StartTime0); /* Start the RTC counter */ RTC_DRV_StartCounter(RTCTIMER1);
Best regards
Jorge Alcala