Electronic – What are the advantages of single-supply (low voltage) programming over high voltage programming

microchippic

I'm a student designing a simple board for a PIC18 microcontroller and am trying to determine how the ICSP circuit should be designed. The datasheet explains how there are two different programming modes: single-supply (low voltage) programming and high voltage programming.

I've been reading through the datasheet and searching online, but I haven't been able to find any advantages of using single-supply (low voltage) programming over high voltage programming.

What are the advantages of using single-supply (low voltage) programming over high voltage programming?

Additional info about my application:

  • The board needs to work with the PICKIT 3 and ICD 3 programmers
  • The board should preferably be able to remain self-powered while being programmed (to allow the programmer to remain plugged in during normal operation and used at any time without having to unplug the board's power supply)

Best Answer

It should be obvious that the main advantage to low-voltage programming is that it can be done with ordinary logic levels, perhaps through gates already connected to the appropriate PIC pins.

The disadvantage should also be obvious. If some sequence of ordinary logic levels on a few of the pins can put the device into programming mode, then it is more difficult to ensure this won't happen during normal operation.

High-voltage programming is the one mode (when it is supported by a particular PIC) that always works. This requires raising MCLR above the normal Vdd level. This can be as high as 13 V for older PICs, often just 8-9 V for newer ones.

Older PICs used a poorly-thought-out method of low-voltage program entry which only required putting a positive logic level on the PGM pin (usually RB5) if low-voltage programming was enabled in the configuration bits. You basically lost a pin if you intended to use low-voltage programming. Worse, it wasn't as easy as just disabling it in the configuration. A bulk erase of the chip always enabled LVP, which can cause some trouble with programming in-circuit, even if the HV method is used. In practice, you often ended up just tying PGM to ground when you didn't want to use LVP, so you lost the pin either way.

Newer PICs that include LVP have a much better scheme. These require a special 32-bit pattern to be clocked in using the regular PGC/PGD lines after a rising edge on MCLR. There is no PGM pin (clouds part, angels rejoice, etc.). Some PICs have this as the only method to enter programming mode.

See my In-Circuit Serial Programming document for circuit design considerations for ICSP.