Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How could make only with GPIOTE and PPI reliable correct output levels?

How could make only with GPIOTE and PPI (without interrupt handler or timer/counter) reliable output that always let say on low to high transition of a gpiote input turns On an output, and when input goes high to low – same output turns off.

Based on Nordic infocenter:

There is only one gpiote input channel allowed per pin; the possible IN events are either LowToHigh, or HighToLow or Any.

Also here is mentioned that: “When a SoftDevice is enabled, …This can lead to the situation where some pin level changes are missed. …”

Which if I understand correct – there is a chance if my output is configured in trigger mode and if I miss one (or any odd number) transitions at the input side, my logic of input levels <> outputs levels will be messed. Is there a simple way to fix this?

I read from the same link cited above “… used with a high-accuracy event together with a TIMER in counter mode to count the detected transitions.”, but this looks far more complex then to use an interrupt handler without ppi? 

Is there any other easier/simpler way ?

Thanks

  • Hello,

    Edit: Fixed some errors.

    Also here is mentioned that: “When a SoftDevice is enabled, …This can lead to the situation where some pin level changes are missed. …”

    This is due to the application interrupt may be delayed due to higher level softdevice interrupts, and thereby the delay between interrupt is trigged before the application interrupt handler may execute may take several hundred us in worst case, in which case the application interrupt can miss pin changes.

    However if you plan to connect pin events, using ppi, to for instance execute tasks. Then there is no such possibility to miss events.

    There is only one gpiote input channel allowed per pin; the possible IN events are either LowToHigh, or HighToLow or Any.

    Do you have the possibility to connect the input to two pins? Then you can setup one GPIOTE channel for rising, and the second for falling?

    Kenneth

Related