Hi,
i need to stop one of my Timer at the falling edge of a Pin. So i need a gpiote_interrupt, is this right? Can someone help me how i can do this? if i write something like GPIOTE_IRQHandler ( ) it doesn't work.
best regards Nils
Hi,
i need to stop one of my Timer at the falling edge of a Pin. So i need a gpiote_interrupt, is this right? Can someone help me how i can do this? if i write something like GPIOTE_IRQHandler ( ) it doesn't work.
best regards Nils
Hi Nils
The following steps are required to use interrupts:
NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN0_Msk;
NVIC_EnableIRQ(GPIOTE_IRQn);
void GPIOTE_IRQHandler(void)
{
if(NRF_GPIOTE->EVENTS_IN[0] != 0)
{
NRF_GPIOTE->EVENTS_IN[0] = 0;
// Add your code here
}
}
On a side note, have you considered using the PPI to stop the timer automatically on the GPIOTE event? Then you might not need the interrupt at all.
Hi Nils
The following steps are required to use interrupts:
NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN0_Msk;
NVIC_EnableIRQ(GPIOTE_IRQn);
void GPIOTE_IRQHandler(void)
{
if(NRF_GPIOTE->EVENTS_IN[0] != 0)
{
NRF_GPIOTE->EVENTS_IN[0] = 0;
// Add your code here
}
}
On a side note, have you considered using the PPI to stop the timer automatically on the GPIOTE event? Then you might not need the interrupt at all.
Hi Nils, I used the example code "pin_change_int_example" at SDK v6.1.0(softdevice v7.1.0) for gpio interrupt testing, it didn't work at all. I have tried the example what you mentioned, it didn't work too. Can you have any advices for me? Best regards. Stanley
Hi Nils, I have tried another example to test the gpio interrupt as the following link, it worked as expected on button_1. devzone.nordicsemi.com/.../