# Rising/Falling Edge Detection for interrupt generation circuit issues

I am trying to generate a pulse to trigger an interrupt when the input changes state.
High->Low & Low->High

The input is a reed switch.
I'm using a XOR gate (SN74AHC1G86QDBVRQ1) with an RC delay on one input.
GPIO2 is used for detecting the state of the input after the MCU wakes from the interrupt.
The circuit works correctly when changing from Low->High. When changing from high to low, it will only work when a scope probe or another metal object is touching terminal 2 (GPIO2).

Does anyone have any suggestions on why this is happening?

• A reed switch is just a switch. It doesn't both sink and source on its own. If you've tied one end to $V_\text{CC}$, then it can source when closed but it cannot sink when open.
– jonk
Dec 12, 2018 at 7:34