This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIO/GPIOTE interrupts not triggered at every event

Hi,

My goal is to generate a GPIO or GPIOTE interrupt and inside the ISR sample 8-bits from GPIO.

I tried modifying two sample projects to achieve this, the NRFX and the button projects, but I got similar results from both. I started by toggling a pin inside the ISR to check if the ISR is triggered for every event and I found that it is not happening for higher frequencies.

See some examples below of various input frequencies to the GPIOTE pin and toggling another pin in the GPIOTE_ISR.

2 MHz input signal

500 kHz input signal

100 kHz input signal

50 kHz input signal

10 kHz input signal

Is this an expected result? Can it be improved?

Thank you.

  • Thank you. That solved the pin problem. But if I may, I still have a question that is related to the initial topic of this post.

    Q - If we are doing operations that are unrelated to the peripherals, these operations are controlled by the main clock (128 / 64 MHz in the case of the nRF5340), but what clock controls the process of entering and leaving the GPIOTE interrupt routine? Is it the main clock or the 16 MHz peripheral clock? Also, if we are executing operations (summation, multiplication) inside the GPIOTE interrupt routine, what clock is used to process these operations? 

  • The GPIO peripheral always runs on a 16 MHz clock, and so this clock is what is relevant for detecting changes etc. The CPU (app core) runs at 128 or 64 MHz as you noted, so while the interrupts are generated by a 16 MHz peripheral, all code executed (including in the interrupt routines) run with the normal CPU clock frequency. Then the CPU may be sleeping and waking up takes a bit of time (depending on state), and the ISR is entered and do some processing, as you would expect for any similar device.

Related