This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Interrupt from external Pin doesn't trigger with short pulse?

Hi,
I need to implement a simple external interrupt triggered by another IC on a nrf51822. After searching the devzone I found the example in the GIT repo (github.com/.../nrf51_app_gpiote_example) which I used.

Everything works fine when I use a button, but when I change the pin to the one I actually want, it doesn't work. The signal is a 500ns long pulse (high) with 250Hz. I don't get the interrupt (neither rising nor falling edge). Is the pulse too short to detect? Shouldn't it be the edge that is detected?

Thanks in advance.

Noé

Parents
  • Hi

    The app_gpiote needs to have a pulse of approximately 10us in order to detect the pulse. What app_gpiote library uses internally is the GPIOTE->PORT event. The GPIOTE PORT event handler inside the app_gpiote library needs to read what pin the PORT event was received on, since the port event does not report what pin was asserted. By the time the execution of the GPIOTE interrupt handler starts executing, your signal has gone low again, so the app_gpiote library will detect no assert on a pin and will not notify your application of any pin event.

    To detect a very short pulse, you would need to use the GPIOTE->IN events instead which is tied directly to a specific pin. See the \nRF51_SDK_8.0.0_5fc2c3a\examples\peripheral\pin_change_int example in the nRF51 SDK for code reference. The disadvantage is that using the GPIOTE->IN is a high power operation (~1mA)

  • I had some time to analyze it a bit more and it seems that there are not more interrupts triggered but less are being handled. The core is just busier with BLE running and hence has not time in the main() loop to finish everything he has to do (which is triggered from the interrupt). Once the advertising() turns off, there are no more interrupt misses and the core has enough time to finish all it has to do.

Reply Children
No Data
Related