# PICKIT 3 resets PIC16 three times upon reprogramming

I am using the PICKIT 3 with MPLAB X with the default setings. When I press F6 to build and run my code, I notice that the PIC16 resets three times:

• twice with the previous code (not expected)
• once with the recently built code (as expected)

How can I avoid having the two spurious resets with the previous code?

-

You can't. The programmer is probably resetting the PIC as part of the programming process. For some PIC 16 MCLR must be held low and then raised to Vpp to enter programming mode. On some newer ones the MCLR voltage can stay within the Vss to Vdd range, but the chip must still be reset by driving MCLR low.

What's the problem anyway? You can't be expecting normal operation during programming, so what does it matter if MCLR is asserted?

-