5
\$\begingroup\$

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)
\$\endgroup\$
  • 3
    \$\begingroup\$ After you've destroyed a few devices with a wrongly connected high voltage line you start to see the advantage. \$\endgroup\$ – JIm Dearden Feb 4 '15 at 15:10
  • \$\begingroup\$ Your question is phrased in a way that you seem to think there are advantages of hv over lv. \$\endgroup\$ – PlasmaHH Feb 4 '15 at 15:16
  • 2
    \$\begingroup\$ @PlasmaHH I haven't found any advantages of lv over hv, but one advantage of hv over lv is that the PGM pin is available for I/O. \$\endgroup\$ – Nate Feb 4 '15 at 15:17
  • 1
    \$\begingroup\$ Which PIC? There are at least two very different types of "low voltage" programming methods for PIC 18. \$\endgroup\$ – Olin Lathrop Feb 4 '15 at 15:33
  • \$\begingroup\$ @OlinLathrop I am planning on using the PIC18F26K22. The datasheet and application notes I've been reading through haven't mentioned two different types of low voltage programming? \$\endgroup\$ – Nate Feb 4 '15 at 15:37
8
\$\begingroup\$

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.

\$\endgroup\$

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.