AnsweredAssumed Answered

External Interrupt not firing on M320

Question asked by Goth.sk on Dec 14, 2016
Latest reply on Dec 19, 2016 by ABuda

Hello, 

 

I am using ADuC M320 in my application. I am seeing an issue with the external interrupts where they do not fire. They  fire 2-3 times and after that the external interrupts stop working. When it goes into this state, I confirmed both EIxCFG and ISER configuration are set correctly. The other interrupts in the system (I2C Slave, I2C Master, SysTick and PendSV, other non-interrupt tasks) do not have any issues. Is there any other register I need to look at to debug this? I would appreciate any help in debugging this. 

 

GPIO interrupt configuration: Edge triggered, Interrupt Priority 3

 

The following code is how the external interrupts are setup. 

 

int main()

{

     __disable_interrupt();

    // Setup GPIO configuration, for example GP2CON = 0, GP2IE = 0xFF, GP2OE = 0x00

     __enable_interrupt();

 

     EiCfg(EXTINT7, INT_EN, INT_EDGES);

     NVIC_EnableIRQ(EINT7_IRQn);

}

 

__ramfunc void Gpio2P4IRQ(void)
{

    // Clear Interrupt Source
    EiClr(EXTINT7);

    if (pADI_GP2->GPIN & 0x40)
    {
        // 
        GP2P4 = TRUE;
    }
    else
    {
        GP2P4 = FALSE;
    }

}

Outcomes