Hello,
I know there are dozens of threads on this topic already but they don't seem to quite answer all my questions.
Some background:
SDK: 15.2
SoftDevice: s140_nrf52_6.1.0
Facts about GPIOTE that I am aware of (Please correct me if I am wrong):
- There are 8 GPIOTE pin event channels on the nRF52840 (High-accuracy)
- The HF Clock is running if any pin is configured as a pin event (High-accuracy)
- If multiple pins are configured as low-accuracy (port event), events from other pins are ignored so long as an event is active on a given pin due to all pins having a shared DETECT signal (They are OR'd together in hardware). For example, Signal A is set to interrupt on HITOLO. Signal B is set to interrupt on HITOLO. If signal A is driven low, generates an event, and remains low, an interrupt event will never be received if signal B is then also driven low.
I have seen some other threads mention that if you set all PORT event pins to TOGGLE, that you can then receive interrupts from other pins even if one of them remains in the active state.
I have tested this myself by setting two pins as TOGGLE and I am able to receive interrupts from both regardless of what state the pin is in.
Question 1: Is setting all PORT (low-accuracy) pins to TOGGLE a good solution?
Question 2. If all PORT pins are set to TOGGLE, is it possible to miss an interrupt from one of the pins if both pins are asserted at the same time?
Question 3: I noticed that newer SDK's have additional logic to handle pins configured as PORT interrupts (port_event_handle() in nrfx_gpiote.c, SDK 17.1). Is there any added benefit to upgrading to this SDK that will mitigate or resolve any potential issues with receiving multiple interrupts at the same time on pins configured for low-accuracy (PORT event)?
Thanks,
Derek