Hi, I have this weird problem where a PIC chip is seeing the input pins fluctuate randomly (between 1 and 10 times per second).
The inputs are as simple as it gets. It's just a switch from the PIC to ground and a 10K pullup resistor to VDD 3.3V (also tried 100K).
The problem only occurs when the switch is on the end of a 4M long wire. This would suggest some kind of EM interference but I can't see how such a minor current could cause a digital pin to change state.
The problem happens regardless of whether the switch is open or closed. It happens more often when it's closed though.
According to the datasheet all digital inputs have a Schmitt trigger that is enabled by default.
I've tried it on multiple pins with no difference.
I have disabled all analog inputs in code.
I was about to connect my Oscope this morning but it seems that after the circuit being left on overnight it's fixed itself. It was also working fine yesterday evening then suddenly went weird. I don't know of anything in the house that could be interfereing.
Can anyone think of anything that might cause this or any tests I can do? It's working now but I'm worried it will fail again when it really needs to be working.
Bookmarks