AVR® Programming Interfaces

Last modified by Microchip on 2023/11/09 09:02

High Voltage Parallel Programming (HVPP)

It’s first important to understand that all (see the "Exceptions" section) AVR®-based Tiny and Mega devices include a High Voltage Parallel Programming (HVPP) or a High Voltage Serial Programming (HVSP) programming interface. Both require the application of a “high voltage” (12V) to the Reset pin and both require access to a large number of pins. The HVPP interface requires access to at least 16 pins while the HVSP interface requires access to at least eight pins. For those reasons, these interfaces are primarily used for production programming of the devices. The following schematic depicts the required HVPP connections for the ATmega328PB (see section 33.7 in the datasheet):

HVPP Connections

The good news…

  • The HVPP or HVSP interfaces are always enabled because they cannot be inadvertently disabled by a fuse setting or user action.

The bad news…

  • They are almost never a realistic programming option once a Tiny or Mega is soldered onto a custom board because they simply require too many pins.

ISP/JTAG

In addition to the HVPP or HVSP interfaces, all (see the "Exceptions" section) Tiny and Mega devices also include one or two “standard” programming interfaces, ISP or JTAG.

In-Circuit Serial Programming (ISP) allows the program memory to be reprogrammed In-System through a Serial Peripheral Interface (SPI). The following schematic depicts the required ISP connections for the ATmega328PB (see section 33.9 in the datasheet).

ISP Connections

Depending on CKSEL Fuses, a valid clock must be present for ISP to function.

ISP is covered in detail in app-note AVR910 - In-System Programming.

The good news…

  • These standard interfaces only require three or four pins.

The bad news…

  • They can be easily disabled by the wrong fuse settings.

Combined Interfaces

All (see the "Exceptions" section) Tiny and Mega devices include one of the two following combinations of programming interfaces:

  • HVPP (or HVSP) and ISP
  • HVPP (or HVSP) and ISP and JTAG

The ISP and JTAG interfaces are the standard programming interfaces for the Tiny and Mega devices. It’s recommended to include a programming header for one of the two interfaces on any custom board to allow convenient reprogramming of the device if necessary.
 

If a device only has an ISP interface and it is disabled via a fuse setting the only recovery is through its HVPP or HVSP interface (which is most likely not physically possible).

If a device has both an ISP and JTAG interface and one of those two is disabled by fuse settings, the other interface can be used to access the part if the pins required are accessible. The ISP interface requires three pins and the JTAG interface requires four pins so it’s more likely either of those interfaces would be easier to access than the HVSP or HVPP interfaces.

Exceptions

  • The Tiny4/5/9/10/20/40 devices do not have an HVPP or HVSP interface. They only have a Tiny Programming Interface (TPI). Newer devices like the Tiny417/817/1617 devices only have a Unified Program and Debug Interface (UPDI). As long as you have access to those interfaces there is no worry about “bricking” these devices.
  • The XMEGA® devices include only a Programming and Debug Interface (PDI) or both a PDI and JTAG interface. You can’t disable the PDI interface so as long as you have access to the one PDI pin that can’t be used for any other function and the Reset pin you can’t “brick” these devices.