AnsweredAssumed Answered

GPIO Interrupt not working- falling edge

Question asked by Vivien Wong on Dec 19, 2016
Latest reply on Dec 27, 2016 by Vivien Wong

Hi,

 

   I am trying to use GPIO interrupt to detect a falling edge. I have GPIO6[13] set up for interrupt. However, whenever GPIO6[3] goes from high to low, no interrupt occurs. My code:

   Code never gets to the GPIO6_IRQHandler().

 

void GPIOInt_Setup()
{
    Chip_GPIO_IntClear(LPC_GPIO_PIN_INT, 6, 13);
    Chip_SCU_GPIOIntPinSel(LPC_GPIO_PIN_INT, 6, 13);
    Chip_GPIO_IntCmd(LPC_GPIO_PIN_INT, 6, 0, GPIOPININT_FALLING_EDGE);

 

 

 

    NVIC_DisableIRQ(PIN_INT6_IRQn);
    NVIC_SetPriority(PIN_INT6_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
    NVIC_EnableIRQ(PIN_INT6_IRQn);
}

 

void GPIO6_IRQHandler (void)
{
    NVIC_DisableIRQ(PIN_INT6_IRQn);

 

    if (Chip_GPIO_IntGetStatus(LPC_GPIO_PIN_INT, 6, 0, 0))
    {
        Chip_GPIO_IntClear(LPC_GPIO_PIN_INT, 6, 0);
    }
}

 

Any ideas or replies would be very much appreciated.

 

Thank you

Vivien

Outcomes