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

Delay in sense interrupt

Our setup is using a NRF52832 with SDK15.0.0.

While working with a time sensitive external circuit where we both sample the state of the GPIO and enable LDETECT on it, we noticed that the sampling code detects a transition in pin state much faster than the sensing. In this particular case we were setting the sense level to high.

In order verify that the delay we were seeing is real we implemented a fast polling system, 8 samples per millisecond, that would read the pin value from IN register. We also had sense enabled to measure the delay. From our results we are seeing that there is a 24-25ms delay in the sense interrupt compared to the detection by reading the pin value at the aforementioned sampling rate.

The rising edge is quite slow rising with potential jitter. We would expect it to take between 6 and 22 milliseconds for it to reach logic level high.

Is this expected behaviour? And if so is there any way to reduce this delay?

Otherwise do you have any ideas as to what might be introducing this delay?

P.S. The sense interrupt is configured with priority 0

Parents Reply Children
  • Maybe you need to try to modify a simplified example like \examples\peripheral\pin_change_int\ to see if you can observe the same. 

    Do you know if the polling show a consistent logic high signal during the ~24ms period. I am just thinking maybe it is sporadic high during ramp up of pin, while sense may require a few clock cycles consistent high before it trigger the interrupt.

    If you have an RTC running, you could just try to log whenever there is a change in polling, and see if it is intermittently high during the pin ramp-up.

    Is it possible that the gpiote interrupt handler is processing another gpio here at the same time?

  • During the ~24ms it does show a consistent high value, there does not appear to be any jitter in the signal. The sampling period is 125uS so maybe this period is too long to notice any jitter.

    The GPIOTE interrupt handler does process all of our inputs however it is designed to execute as fast as possible and only adds an event into the event queue for each input. In addition to this there should have been no changes in the other inputs as they were not being handled. Furthermore this behaviour is consistent across each cycle (100ms) of the pulse detection in the external circuit.

    I will have a look at the example

  • Alex Crombie said:
    I will have a look at the example

    If you are able to recreate the same by modifying \examples\peripheral\pin_change_int\ , please share the program so I can recreate it here also to look into it further.

    Best regards,
    Kenneth

Related