GPIO Interrupt not working- falling edge

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPIO Interrupt not working- falling edge

1,577件の閲覧回数
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,064件の閲覧回数
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,064件の閲覧回数
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 件の賞賛
返信