GPIO Interrupt not working- falling edge

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

GPIO Interrupt not working- falling edge

1,567 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
2 回复数

1,054 次查看
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 项奖励
回复

1,054 次查看
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 项奖励
回复