I am able to get the RTC count in seconds.But the sub second count is not correct.
I attached my program and a snap shot of RTC values
#include <stdint.h> #include <stdio.h> #include <string.h> #include <string.h> #include <stdbool.h> #include "inc/tm4c123gh6pm.h" //change this info to micro what you are going to use. #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/sysctl.h" #include "driverlib/interrupt.h" #include "driverlib/gpio.h" #include "driverlib/hibernate.h" void enableRTC(void) { // Enable the Hibernation module. SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); // Wait for the Hibernate module to be ready. while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE)) { } HibernateEnableExpClk(SysCtlClockGet()); // // Wait an amount of time for the module to power up. // // Configure the clock source for Hibernation module and enable the // RTC feature. HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE); HibernateRTCEnable(); } void setRtcValue(uint32_t time) { // Set the RTC to an initial value. HibernateRTCSet(time); } uint32_t getRtcValueInSec(void) { return HibernateRTCGet(); } uint32_t getRtcValue(void) { return HibernateRTCSSGet(); }