Joe, I enabled a WPUA.2 = 1 on RA2. However, with this change the voltage on RA2 when open circuit output is still at 3.2 vdc rather than Vih or close to Vdd. My code now looks like below. Interestingly the WRITE 7, TMR0 in the IF block never shows a value other than zero. However, just a couple of momentary switch activations will enter into the ELSE block where the WRITE 9, TRM0 statement shows a value of greater than K each time. So it looks like a lot of switch bounce going on, but the thing I don't understand is why the WRITE 7, TMR0 statement isn't showing any TMR0 values< K.
I also notice that if I comment out the LED blink statements in the IF block, the WRITE 7 statement doesn't write anything because the memory address shows a continuous FF value. Strange things that I don't understand. But at least it looks like the TMR0 is counting whether the value shows up correctly or not.
Tomorrow I am going to try to generate another method of simulating the external sensor input pulses to eliminate the switch bounce problem. I thought this might be possible by using one of the I/O pin outputs in a similar blink sequence loop as I am using for the LED, and then route that output into RA2. Do you think this would work? I will try to use one of the I/O pins that has a CMOS output.