Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.