AVR® Programming Interfaces
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):
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).
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.
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.