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.

TM4C123GH6PM: RTC function Hangs.

Part Number: TM4C123GH6PM

Hi, 

i am trying to store epoch time in RTC, my code flow is.

ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);

while(!ROM_SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE)){
}

ROM_HibernateEnableExpClk((ROM_SysCtlClockGet()));

msleep(100); // sleep 100 ms.
ROM_HibernateClockConfig(HIBERNATE_OSC_DISABLE); // disable to use external clock source of 32K
msleep(100); // sleep 100ms
ROM_HibernateRTCEnable();
if(!ROM_HibernateIsActive()){
ROM_HibernateRTCSet(0);
}

// after getting connected to NTP server i update my RTC time.

ROM_HibernateRTCSet(epochTime);

when i print time after some time my RTC data leeds the epoch time, and it continues..

Problem is if i restart the device  "ROM_HibernateEnableExpClk((ROM_SysCtlClockGet()));"   hangs while waiting for Write control register to set.

Question.

1. what is the reason that is waits for writer control register.

2. ROM_HibernateClockConfig(HIBERNATE_OSC_DISABLE); is it a right way to enable and source RTC through external clock of 32K connected to  xosc pin

3. what is the reason that RTC  counts faster.

  • Hello Chiranth,

    First and foremost since this condition seems to appear on reset, you should investigate any potential impacts Errata Item HIB#01: www.ti.com/.../spmz849f.pdf - this is likely why you are observing the faster RTC counts.

    Regarding question 2, depending on the setup of the 32kHz crystal, you may have to set HIBERNATE_OSC_HIGHDRIVE as well - are you using a LaunchPad or a custom board?
  • Hello Jacobi,

    first of all thank you for your input, i am using a custom board. the second problem i due to HIBERNATE_OSC_DISABLE, if i use HIBERNATE_OSC_HIGHDRIVE/HIBERNATE_OSC_LOWDRIVE it works fine.
    regarding the faster RTC counts. i am not able to solve it.
  • Hello Chiranth,

    Have you investigated if the Errata Item HIB#01 which I mentioned above is a root cause? This is not something I can do for you, you need to compare the errata item to your system configuration and determine if it is relevant. If it is, then the errata outlines steps which can be taken to guard against it.

    You may need the HibernateRTCTrimSet API with the correct value: e2e.ti.com/.../2056688