GPIO Interrupt not working- falling edge

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO Interrupt not working- falling edge

986 Views
vivienwong
Contributor I

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

Labels (1)
Tags (2)
0 Kudos
2 Replies

473 Views
soledad
NXP Employee
NXP Employee

Hi

 

Could you let us know which LPC product you are using?

If you are using LPCOpen, can you try using the periph_pinint example?  

In addition please check the attached example.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

473 Views
vivienwong
Contributor I

Hi,

  I am using the LPC1857. I will try out your solution and let you know how it goes.

Thanks

Regards

Vivien

0 Kudos