I have a PIC18F4520 that I am trying to use as a 2 axis motor controller - it has two limit switches on B5 and B4 that are hooked up like the attached picture.
I'm having a problem where the PIC resets when the switch on B5 is pressed. I've tried adding current limiting resistors and a filter cap, thinking it was a switch bounce issue. I have ensured BOREN and WDT are off, and portB is set as a digital input. VSS has 100nF coupling caps right next to the socket
the really confusing part is that the other three switches do not cause a reset when they are pressed, and I can't find any indication of a short, either visually or by multimeter.
Any ideas?