Hi,
I am using this TM4C123 controller where i need to keep running Hibernation RTC Module on Vbat, for RTC Time.
I have no idea how i will get time value when i power on controller after power reset,
I have connection for 3.3V cell on board.
Please help to provide answer for below questions:-
1.Code example for Hibernate RTC Clock where time register keep updating only on Vbat supply.
2.Right now when i power off the controller my RTC Count stops,how can i be able to keep them running on Battery cell.
void HibernateISRHandler(void)
{
uint32_t ui32Status;
// Get the interrupt status and clear any pending interrupts.
ui32Status = HibernateIntStatus(true);
HibernateIntClear(ui32Status);
// Process the RTC match 0 interrupt.
if(ui32Status & HIBERNATE_INT_RTC_MATCH_0)
{
// update match value
uint32_t ui32RTCMatch;
ui32RTCMatch = HibernateRTCGet();
// calendar_read = HibernateRTCGet();
ulocaltime(ui32RTCMatch, &tm2);
HibernateDataGet(&ui32HibernateCount, 1);
ui32HibernateCount++;
if(ui32HibernateCount>=50000)
{
ui32HibernateCount=0;
}
HibernateDataSet(&ui32HibernateCount, 1);
HibernateRTCMatchSet(0,ui32RTCMatch + 1); // a second in the future
timer_tt++; // ### to disable
RTC_TIME_DETAILS.BIT_FIELD.SECOND = tm2.tm_sec;
RTC_TIME_DETAILS.BIT_FIELD.MINUTE = tm2.tm_min;
RTC_TIME_DETAILS.BIT_FIELD.HOUR = tm2.tm_hour;
RTC_TIME_DETAILS.BIT_FIELD.DAY = tm2.tm_mday;
RTC_TIME_DETAILS.BIT_FIELD.MONTH = tm2.tm_mon;
RTC_TIME_DETAILS.BIT_FIELD.YEAR = tm2.tm_year;
}
}
using Above code i am not able to recover value of rtc clock,
I am new to rtc clock of this controller so some working example of RTC Clock count during main power of controller is off and only VBAT is connected.
Thanks,