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
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!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I am using the LPC1857. I will try out your solution and let you know how it goes.
Thanks
Regards
Vivien