Power-up timeline
VDD
MCLR pin
OSC1
VDD below 4.0 V
clock not stable
Set up the board
changes re-run the power-up
Reset circuit on MCLR (pin 4)
What happens after switch-on
Short interruptions may not let VDD fall low enough to re-arm the internal POR.
Try these
Reset circuit
OFF
Power is off.
Did the PIC start safely?
Why keep the PIC in reset?
- VDD is still climbing. Below about 4 V a 4 MHz PIC16F84A is outside its operating range: instructions can execute wrongly and RAM and register contents are not reliable.
- The crystal is still starting. Its oscillation grows from noise over several milliseconds; early cycles are small, irregular and can glitch the CPU.
- The answer is a delay. The internal POR, the 72 ms power-up timer (PWRTE) and the 1024-cycle oscillator start-up timer (XT/LP/HS only), or an external RC on MCLR, hold the chip in reset until both are healthy.
The datasheet's external circuit (b): R < 40 kΩ so MCLR leakage does not pull the pin below its input threshold; Rs = 100 Ω–1 kΩ limits current into MCLR if C discharges into it (ESD or overstress); the diode empties C quickly when the power goes off. The 16F84A has no brown-out reset, so short supply dips are its weak spot.