Part Number:TM4C129ENCPDT
Thanks for your technical support for some of the issues in our product with the MCU TM4C129ENCPDTI3 and CC3100 module.
In our product, we are using the in-built RTC (Real Time Clock) feature of the microcontroller. We found that the RTC value is corrupt in the Field (where our system is installed in textile Machineries) once in a while.
Please find the Circuit and Software details below.
We have used TI library in our implementation.
Kindly review and support us to solve the issue at the earliest as we have started our production and this issue would stop our production and reputation with our customer.
Circuit details :
Software :
During Init() function
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(g_SysClock);
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
HibernateRTCEnable();
HibernateCounterMode(HIBERNATE_COUNTER_24HR); // Configure the hibernate module counter to 24-hour calendar mode.
In the main program in infinite loop, we have called the below code
struct tm temp_time;
DateTimeGet(&temp_time);
real_time.tm_mday = temp_time.tm_mday;
real_time.tm_mon = temp_time.tm_mon+1;
real_time.tm_year = temp_time.tm_year;
real_time.tm_hour = temp_time.tm_hour;
real_time.tm_min = temp_time.tm_min;
real_time.tm_sec = temp_time.tm_sec;
where the coding for DateTimeGet() is as below
//*****************************************************************************
//
// This function reads the current date and time from the calendar logic of the
// hibernate module. Return status indicates the validity of the data read.
// If the received data is valid, the 24-hour time format is converted to
// 12-hour format.
//
//*****************************************************************************
bool
DateTimeGet(struct tm *sTime)
{
HibernateCalendarGet(sTime); // Get the latest time.
sTime->tm_year += 1900;
if(((sTime->tm_sec < 0) || (sTime->tm_sec > 59)) ||
((sTime->tm_min < 0) || (sTime->tm_min > 59)) ||
((sTime->tm_hour < 0) || (sTime->tm_hour > 23)) ||
((sTime->tm_mday < 1) || (sTime->tm_mday > 31)) ||
((sTime->tm_mon < 0) || (sTime->tm_mon > 11)) ||
((sTime->tm_year < 1900) || (sTime->tm_year > 2099)))
{
return false;
}
return true;
}
Please let us know if you would like to know more details from us. If you are not the right person for contact please guide us by forwarding this request.
Thanks for your support