I am looking for a example code for RTC in the M4 but is hard to find.
I found some codes line and I was testing the code below:
ROM_FPULazyStackingEnable();
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2); //enable the timer clock
TimerLoadSet(TIMER2_BASE,TIMER_A,ROM_SysCtlClockGet());
TimerConfigure(TIMER2_BASE, /*TIMER_CFG_RTC*/TIMER_CFG_32_RTC);
TimerRTCEnable(TIMER2_BASE);
TimerEnable(TIMER2_BASE, TIMER_A);
while(1)
{
TIMER_RTC_VALUE = TimerValueGet(TIMER2_BASE,TIMER_A);
}
The value in the TIMER_RTC_VALUE is always the same.
Anybody has any some sugestion to help me?
Thanks,
Alessandro