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, I have tried another example to test the gpio interrupt as the following link, it worked as expected on button_1. devzone.nordicsemi.com/.../
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/.../