Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.