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.

CCS/TM4C1231E6PM: Hibernation RTC match0 ISR missing after setting RTC clock counter equal to HIBRTCM0.

Part Number: TM4C1231H6PM

Tool/software: Code Composer Studio

Hi,


I have created a Hibernation RTC match0 ISR (Not in Hibernation), and set RTC match0 to 10 seconds after each ISR trigger.


It worked all the time until once I update the RTC value equal to exactly the next match0 value. The Interrupt will occur once after the setting but missing on the following interrupts.


In this case, Do I need  to disable the interrupt in ISR and enable the interrupt after setting the next HIBRTCM0 value all the time?

Thanks,

Jacky

  • Part Number: TM4C1231H6PM

    Tool/software: Code Composer Studio

    hi

    I have created a Hibernation RTC match0 ISR (No Hibernation),  and set RTC match0 to 10 seconds after each ISR trigger.

    It worked all the time until once I update the RTC value equal to exactly the next match0 value. The Interrupt will occur once after the setting but missing the following interrupts.

    In this case, Do I need  to disable the interrupt in Interrupt handler and enable interrupt after settting the next  HIBRTCM0 value all the time?

    or any else work around?

  • Hello Jacky & Gordon,

    Your posts were identical so I merged these threads together to answer this in one location.

    Can one of you post the code you are using to:
    1) Configure the RTC
    2) Update the RTC
  • Main()
    {
       SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
       SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_HIBERNATE);
       SysCtlPeripheralDeepSleepEnable(SYSCTL_PERIPH_HIBERNATE);   
    
       xTaskCreate (MonitorTask, (signed portCHAR *)"MonitorTask", 240, NULL, 4 , NULL);
    
       vTaskStartScheduler();
       while(1)  
       {        
       }
    }
    
    void MonitorTask( void *pvParameters )
    {
    	HibernateIntClear(HIBERNATE_INT_RTC_MATCH_0);
    	IntPrioritySet(INT_HIBERNATE, 6<<5);
    	HibernateIntRegister(IntRTCIntHandler);
    
        HibernateRTCMatch0Set(HibernateRTCGet() + 10); 
        HibernateIntEnable(HIBERNATE_INT_RTC_MATCH_0);
    
        g_xMonitorQueue = xQueueCreate( 4 , sizeof(tMonitorTrigSource ) );
        
        for(;;)
        {
            xQueueReceive( g_xMonitorQueue,  &MonitorTrigSource, portMAX_DELAY );
            if(MonitorTrigSource == Monitor_Trig_IntRTC)
            {
    		     // Doing main code.
                 HibernateRTCMatch0Set(HibernateRTCGet() + 10); 
            }
        }
    }
    
    void IntRTCIntHandler(void)
    {
        unsigned long ulHibernateIntValue;
        signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
    
        ulHibernateIntValue = HibernateIntStatus(true);
    
        if (ulHibernateIntValue & HIBERNATE_INT_RTC_MATCH_0)
        {
        tMonitorTrigSource MonitorTrigSource = Monitor_Trig_IntRTC;             
    	HibernateIntClear(HIBERNATE_INT_RTC_MATCH_0);
        xQueueSendFromISR( g_xMonitorQueue, ( void * ) &MonitorTrigSource, &xHigherPriorityTaskWoken );
    
        if (xHigherPriorityTaskWoken != pdFALSE ) 
        {
             taskYIELD();
        }
    }
    
    void UpdateRTC(unsigned long ulRTC)   // Update RTC equal to match0 value occur that problem
    {
    	HibernateRTCSet(ulRTC);	
    }

  • Hello Gordon,

    Sorry for the delay on this.

    Can you try reloading the Hibernate RTC by first disabling the RTC using HibernateRTCDisable, then loading the count using HibernateRTCSet and finally enabling the RTC using HibernateRTCEnable? See if that solves the issue.
  • Hi Ralph :

    It doesn't work.

    Still no interrupt request after one RTC match.