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, thank you for your answer, very helpful :).
If i use the Softdevice and doesn't use sd_nvic_EnableIRQ instead of NVIC_EnableIRQ what coudl happen? the sd methods are all in the SOC.h is there a docu of this?
How shoudl i do it with ppi?
best regards Nils :)
So in some parts of my code i use NVIC_EnableIRQ and not the soc methods, could this crash my device? And if i change this what you told me in the existing parts of my code like the PWM_MODUL it doesn't work anymore. No i have to check out how this works, can you give me some more help for this?
best regards Nils
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/.../