Other Parts Discussed in Thread: EK-TM4C1294XL
Tool/software:
Hello,
We are using TM4C129XNCZADI3R part number . I need RTC parameter. I have tivaware latest package 295 but not able to find out rtc.h file .
Does it have inbuilt RTC?
void Hibernate_RTC_Init(void)
{
// Enable the Hibernation module
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE));
// Enable access to the hibernate module
HibernateEnableExpClk(SysCtlClockGet());
// Enable the RTC and the clocking from external oscillator
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
// Wait for the oscillator to stabilize
SysCtlDelay(SysCtlClockGet() / 3); // ~1 second delay
// Enable RTC mode
HibernateRTCEnable();
// If you want to reset the counter
HibernateRTCSet(0);
}
//*************************************************************************************************
// Set RTC to specific timestamp (e.g., Unix time)
void SetRTCTime(uint32_t timestamp) {
HibernateRTCSet(timestamp);
}
// Read current time
uint32_t GetRTCTime(void) {
return HibernateRTCGet();
}
current_time= GetRTCTime();
It gives always 0 . Is any other thing require to do?
Crystal properly connected and checked on oscilloscope