I have seen similar behavior when there was ripple on the DC supply to the board. Check for sufficent capacitance on your 5V supply. It could be pulling down the supply voltage enough to get a reset. Put the scope on the Vdd pin and see what it's doing. I find the best way to trouble shoot is to go from the power supply, to the MCLR line to the oscillator, then to the ouputs then your inputs. Hope this helps, Norm