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)

  • Thanks for your answer. I figured it out myself as I was reading through the examples. Its works now, although I'm a bit disappointed that it uses so much current as the interrupt will occur quite often and we're in a low power environment. Also I noticed that other things can trigger the interrupt as well. For example, I have a SD110 and I use BLE. While advertising, the indicator LED toggles and this triggers the event interrupt. I'm quite sure that I only listen to the pin I want to. Any suggestions there? I will post the code later, I'm not at my office right now. Thanks again

Reply
  • Thanks for your answer. I figured it out myself as I was reading through the examples. Its works now, although I'm a bit disappointed that it uses so much current as the interrupt will occur quite often and we're in a low power environment. Also I noticed that other things can trigger the interrupt as well. For example, I have a SD110 and I use BLE. While advertising, the indicator LED toggles and this triggers the event interrupt. I'm quite sure that I only listen to the pin I want to. Any suggestions there? I will post the code later, I'm not at my office right now. Thanks again

Children
No Data
Related