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.

TM4C1294KCPDT: Hibernate using RTC

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL, TM4C1237H6PZ

Hello,

I am using a custom board. I want to hibernate my device periodically after every 15 seconds using RTC. Please go through the code below. Is this the correct way to meet my requirement?

Program flow doesn't reach the point where I am switching off the led.

Here's my code->

ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);

GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE, GPIO_PIN_4);  //led pin

GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_4, GPIO_PIN_4);   //led on

SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);

HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);

SysCtlDelay(64000000);

HibernateRTCSet(0);

HibernateRTCEnable();

HibernateRTCMatchSet(0,15);

HibernateWakeSet( HIBERNATE_WAKE_RTC);

GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_4, 0x00);   //led off

HibernateRequest();

while(1) { }

  • Hello Chirag,

    I think you are missing quite a few steps. You should review our hibernate example at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\hibernate

    A couple key API's I think you are missing include:

        //
        // Configure Hibernate module clock.
        //
        HibernateEnableExpClk(ui32SysClock);
    

    and

        //
        // Configure the hibernate module counter to RTC mode.
        //
        HibernateCounterMode(HIBERNATE_COUNTER_RTC);

    You may also need to do the following:

        //
        // Read and clear any status bits that might have been set since
        // last clearing them.
        //
        ui32Status = HibernateIntStatus(0);
        HibernateIntClear(ui32Status);

    Please review our 24-hour Calendar example for all API's involved in hibernation mode setup and update your code accordingly.

  • Hello,
    I tried the "hibernate" example you mentioned.However the code gets stuck at "HibernateEnableExpClk()" function.
  • There is a 25Mhz oscillator connected to OSC0 & OSC1 pins to my custom board.
    I also want use hibernation mode into Tm4c1237h6pz controller. I wont be able to use the calendar function for this device. Right?
  • I do not have the 32.768khz crystal connected to my board
  • Hello Chirag,

    Chirag Kolhe said:
    I do not have the 32.768khz crystal connected to my board

    Well, there's the problem unfortunately. For the RTC, you need a 32.768kHz clock source. The internal low freq oscillator can't be used due to it's frequency range. You will need to use an external 32.768kHz clock source (oscillator or crystal) in order to use RTC functions. Sections 7.3.2 and 7.3.5 of the datasheet cover this in more detail.

    Chirag Kolhe said:

    I also want use hibernation mode into Tm4c1237h6pzcontroller. I wont be able to use the calendar function for this device. Right?

    Correct, Calendar mode is not available for that device.
  • Hello,
    I have connected the 32.768 kHz crystal with two 22pF capacitors as shown in figure 7-2 in the data sheet. I am referring the code given in the peripheral driver library user's guide- page 312. I am using Tm4c1237h6pz controller. However, still the code gets stuck in "HibernateEnableExpClk" api.
  • Hello Chirag,

    Did you have pads for the 32.768kHz crystal already on your custom board which you could use to connect it? Is the layout of that section following the guidelines from Section 3.7.1.2 and 3.7.2 of the System Design Guidelines: www.ti.com/.../spma059.pdf ?
  • Hello,
    The trace length was exceeding 18mm. Reducing its length to the value as specified in the document solved the issue I was facing.
    Thanks a lot for the support