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.

A problem about hibernate of TM4C123GE6PZ/my own board

Hello !

        I have a problem about the hibernate of  Tiva MCU. The code is  put below.

     

SysCtlPeriEnable(SYSCTL_PERIPH_HIBERNATE);

SysCtlDelay(2 *(12000000UL));

HibernateEnableExpClk(SysCtlClockGet()); 

SysCtlDelay(25 *(12000000UL / 1000));
HibRTCSet(35920UL); 
SysCtlDelay(50 *(12000000UL / 1000)); 
HibRTCEnable();

When the  code  gets into  HibernateEnableExpClk(SysCtlClockGet()),it stops. If  I  remove  HibernateEnableExpClk(SysCtlClockGet()) , the program can work continue,but the RTC can't get  initial  value. The crystal of the hibernate  is 32.768KHz. When I use oscilloscope to watch the cystal, the input voltage of the crystal is  -0.1mv -0.1mv ,the frequency  is 32.768KHz, but I  can't get the output of the crystal. The value of HIB_CTL_WRC is always 1.Why the HibernateEnableExpClk(SysCtlClockGet()) can't work , thank you for your reply!

  • Hi Yuanjin,

         Attach your c files here. So, others can see the bigger picture. I notice you use functions that are not mentioned in the Peripherals Library Users Guide. Such as HibRTCEnable(). Also, you can review the hibernate implementation at the qs-logger example program.

    -kel

  •  Hello  ,Markel Robregado

    My  code is put below.

    #include "hw_types.h"
    #include "hw_memmap.h"
    #include "hw_nvic.h"
    #include "hw_ints.h"
    #include "rom.h"
    #include "sysctl.h"
    #include "interrupt.h"
    #include "fpu.h"
    #include "pin_map.h"

    #include "hibernate.h"

    #define  SysCtlPeriEnable       SysCtlPeripheralEnable
    #define  SysCtlPeriDisable      SysCtlPeripheralDisable
    #define  GPIOPinTypeIn          GPIOPinTypeGPIOInput
    #define  GPIOPinTypeOut         GPIOPinTypeGPIOOutput
    #define  HibIsActive            HibernateIsActive
    #define  HibEnable()            HibernateEnableExpClk(SysCtlClockGet())
    #define  HibClockSelect         HibernateClockSelect
    #define  HibWakeSet             HibernateWakeSet
    #define  HibRequest             HibernateRequest
    #define  HibRTCSet              HibernateRTCSet
    #define  HibRTCGet              HibernateRTCGet
    #define  HibRTCMatchSet        HibernateRTCMatchSet
    #define  HibRTCEnable           HibernateRTCEnable
    #define  HibIntClear            HibernateIntClear
     void RTC_Init(void)
    {     

        SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE;

        SysCtlDelay(1 *(SysCtlClockGet()));       

        HibernateEnableExpClk(SysCtlClockGet());   

        SysCtlDelay(25 *(12000000UL / 1000));     

        HibWakeSet(HIBERNATE_WAKE_RTC);
        HibRTCSet(35920UL);
        SysCtlDelay(50 *(12000000UL / 1000)); 
        HibRTCEnable();                      

     }      

    int aa=0;

      void main(void)
    {    FPUEnable();
         FPULazyStackingEnable();
        SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_XTAL_12MHZ| SYSCTL_OSC_MAIN);
        sysclk = SysCtlClockGet();          

     SysCtlDelay(2000000);
        RTC_Init();  
     
                                
      while(1)
       { 

     aa=HibernateRTCGet(); }

    }       The code can't go through  HibernateEnableExpClk(SysCtlClockGet()). When I eliminate HibernateEnableExpClk(SysCtlClockGet()),the code can continue ,but the number of aa is 0.    The  input of 32.768KHz  crystal is -0.1~0.1V ,but  I can't see the other side of the crystal  by oscilloscope.  Thank you!

     

    the problem

  • Hi Yuanjin,

         Maybe this below. You are missing a close parenthesis ")".

         SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE;

    -kel