This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DK-TM4C129X: Hibernate module RTC counter

Part Number: DK-TM4C129X

Hi,

I was trying to create an RTC timer using Hibernate module where in i could tap in time information in format HH:MM:SS:ss

I have referred to example code and has written a short program to check the functionality.

I see that the seconds counter always return zero while the sub-seconds counter counts as expected. in "Register View" HIBRTCC is stuck at 0x0. What could be the reason for this??

/****************** Source Code**************************/

//
// Run from the PLL at 120 MHz.
//
luint32_SysClk = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);

// Enable the hibernate module.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE))
{
}

/*
* Check for Hibernate already active
*/

while(HibernateIsActive())
{
luint32_Seconds = HibernateRTCGet();
luint32_SubSeconds = HibernateRTCSSGet();

}
//
// Configure Hibernate module clock.
//
HibernateEnableExpClk(luint32_SysClk);

//
// Configure the clock source
//
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);

//
// Enable RTC mode.
//
HibernateRTCEnable();

//
// Configure the hibernate module counter to 24-hour calendar mode.
//
HibernateCounterMode(HIBERNATE_COUNTER_24HR);//HIBERNATE_COUNTER_24HR);

//HibernateRTCSet(0);

while(1)
{
luint32_Seconds = HibernateRTCGet();
luint32_SubSeconds = HibernateRTCSSGet();
}

 

 

  • Hi,

    i presume i am suppose to make a

    HibernateCalendarGet(&ptime_DateTime);

    rather than 

     HibernateRTCGet();

    IN data sheet ""The standard RTC registers: HIBRTCC, HIBRTCLD, HIBRTCSS, and HIBRTCM0 are disabled when the calendar function is enabled and read back as all 0s in this mode. In addition, writes have no effect on these registers when the calendar function is enabled.""

    I wanted to get the SubSecond resolution too ...

    Though data sheet mentions readback  of HIBRTCSS in calender mode as Zero . i ma observing a counter. Is the value read valid in this case??

    Regards

    Rakesh M.


  • Hello Rakesh,

    The calendar mode won't allow for subsecond resolution.

    See this post for some details and a workaround idea, and the beginning portion of the thread has a lot of good discussion on the topic as well: e2e.ti.com/.../1265185