Quote Originally Posted by Steve S. View Post
Something strange happens ...
This pin is pulled to Vdd with a 4.7K resistor ...
a signal (Vdd) come to this pin through a n.o. external switch....
Indeed strange – it's not clear to me from what you wrote above .. is your n.o tied to ground? The way you have it written, it looks like it is tied to Vdd because Vdd “come to this pin through” it which makes no sense if your pin is tied weak high.

Something to try ...

If your n.o. is tied to ground, you could

a) increase the pull-up value on the pin in an effort to slow the recharging of the condenser when the switch opens in case your power supply is very very very soft
b) add a decoupler cap of 10uF electrolytic close to your .1uF bypass cap between VDD and VCC
c) add a bypass on MCLR between the pin and the resistor.

Like you said, you fixed it by removing the cap but I am sure you would like to know why - gremlins are scary.

Like Steve said, It would be interesting to see your code as well as what else is going on with your circuit hardware.