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.

TM4C129ENCPDT: Interrupt call back will stop working

Part Number: TM4C129ENCPDT

Hello Charles,

I hope you doing well.

I am facing another weird issue. I have two interrupts on GPIO_PORTM_BASE one is at GPIO_PIN_3 i.e. PM3 another is GPIO_PIN_6 i.e. PM6. GPIO_PIN_6  interrupt will always get triggered and land the cpu into the interrupt handler routine while GPIO_PIN_3 interrupt triggers the CPU into the interrupt handler routine for first few cycles. However after some time later, the CPU will not get triggered from GPIO_PIN_3 anymore, I scoped the interrupt signal on GPIO_PIN_3 and I can see the interrupt signal is always there as expected.

GPIO_PIN_3 is a periodic interrupt running at 15msec while GPIO_PIN_6 is a push button that you triggers the ISR whenever user push the button. 

GPIO_PIN_6 will always trigger CPU.

Here is my code.

The defines are;

#define PSONOFFRESET_RQST_PORT  GPIO_PORTM_BASE
#define PSONOFFRESET_RQST_PIN   GPIO_PIN_6 //PM6

#define ADC_CTRL_PORT          GPIO_PORTM_BASE
#define ADC_BUSY                GPIO_PIN_3 //PM3

The ISR is here;

//Interrupt Service Routine
void PORTM_Common_IntHandler(void)
{
    // Clear the interrupt
    uint32_t status;
    SysCtlDelay(10);
    status = GPIOIntStatus(ADC_CTRL_PORT, true);
    if(status & ADC_BUSY)
    {
        ExtADC_Collect_Data();
    }
    else if (status & PSONOFFRESET_RQST_PIN)
    {
        Global_Flag = 1;
        }


    }
    GPIOIntClear(ADC_CTRL_PORT, status);

}

//Enable GPIO_PIN_6 interrupt function
void PS_ONOFFRESET_Req_interrupt_enable(void)
{

    IntMasterDisable();
    GPIOPinTypeGPIOInput(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN);
    GPIOPadConfigSet(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);  // Enable weak pullup resistor for ADC_BUSY
    GPIOIntDisable(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN);        
    GPIOIntClear(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN);      

    GPIOIntRegister(PSONOFFRESET_RQST_PORT, PORTM_Common_IntHandler);
    GPIOIntTypeSet(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN, GPIO_LOW_LEVEL);            
    GPIOIntEnable(PSONOFFRESET_RQST_PORT, PSONOFFRESET_RQST_PIN);     
    IntMasterEnable();

}

//Enable GPIO_PIN_3 interrupt function
void ExtADC_Busy_interrupt_enable(void)
{
    //Enable Interrupt on ADC_BUSY Pin
    IntMasterDisable();
    GPIOPinTypeGPIOInput(ADC_CTRL_PORT, ADC_BUSY);
    GPIOPadConfigSet(ADC_CTRL_PORT, ADC_BUSY, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPD);
    GPIOIntDisable(ADC_CTRL_PORT, ADC_BUSY);
    GPIOIntClear(ADC_CTRL_PORT, ADC_BUSY);
    GPIOIntRegister(ADC_CTRL_PORT, PORTM_Common_IntHandler);
    GPIOIntTypeSet(ADC_CTRL_PORT, ADC_BUSY, GPIO_FALLING_EDGE);
    GPIOIntEnable(ADC_CTRL_PORT, ADC_BUSY);
    IntMasterEnable();

}

 

Not sure, what is going wrong. 

Thanks for help.

Regards