I'm working with PIC12F629. It has 8 pins (6 for I/O). I need to use MCLR pin as input pin (for a button), so I have to disable MCLR (I guess).

After first programming I want to be able to program microcontroller again.

Datasheet says, that PIC12F629 supports:

"In-Circuit Serial ProgrammingTM (ICSPTM) via two pins"

I know, that there are LVP and HVP programming modes in PIC microcontrollers, and I probably have to use LVP, however I'm PIC newbie and I don't know if PicKit will just work with MCLR disconnected, or do I have to do something etc.

My question is:

How do I program PIC12F629 with PicKit3 when I need all 6 I/O pins (including MCLR)?


In short, LVP it is a method to put a PIC into programming mode without having to apply more than 5V to the MCRL pin. when the circuit connected to MCLR can tolerate a high voltage (about 12V) then its better to use normal programming mode(high voltage) so that the microcontroller could never get into programming mode by accident.

You should be careful to isolate the programmer circuitry from your circuitry, and that is when:

  1. PGD or PGC is used as an input, hence the circuitry could be supplying those pins with 5V or 0V and a short may happen. you can try adding series resitors in this case as it is the simplest solution.
  2. PGD or PGC are used as outputs. you should make sure that the circuitry connected to PGD and PGC can tolerate switching when programming (as connecting an emergency self destruct circuit). Those pins will toggle continuously when programming and your connected circuit should tolerate that.

you can use jumpers if you want to switch between operation/programming modes (jumpers to unconnect MCLR,PGD,PGC from other circuits when programming) and its probably the easiest solution if your confused in what to look for


To program the chip, all 3 pins need hooked up; MCLR, ICSPDAT and ICSPCLK. The VDD and VSS pins also need hooked up but they don't eat processor pins.

The chip supports high voltage programming. This means that to program the chip the PICKIT3 sends about 12v into the pin to enable programming. Make sure whatever you have hooked up to the pin can tolerate that voltage.

In low voltage programming mode disabling the MCLR pin effectively disables programming if low voltage programming is all the chip has. If the chip has high voltage programming, like yours, the state of the pin is irrelevant because the high voltage can enable programming even if MCLR is disabled.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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