Electronic – Programming PIC with PICkit3 – do I need enabled MCLR

picpickitprogramming

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)?

Best Answer

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