you cannot clear the gpio change flag until you read the gpio port



Capture: ' Enter here with Pulse (IOC)
PulseFlag = 1 ' Caught a pulse
Cnt.highbyte = TMR1H ' grab TMR1...