2.1 SPI

In-system programming (ISP) uses the target Microchip AVR’s internal SPI (Serial Peripheral Interface) to download code into the Flash and EEPROM memories. It is not a debugging interface.

Use the pinout shown in the figure below when designing an application PCB with an AVR with the SPI interface included.
Figure 2-1. SPI Header Pinout
Info: The SPI interface is often referred to as “ISP” since it was the first in-system programming interface on Microchip AVR products. Other interfaces are now available for in-system programming.

Direct Connection to a Standard 6-pin 100-mil SPI Header

Use the included 100-mil 6-pin flat cable to connect directly to a board supporting the SPI header type. Note the pin-1 marking on the cable, and ensure to line it up with the pin-1 marking on the AVR Programming Adapter.

Important: The SPI interface is effectively disabled when the debugWIRE enable fuse (DWEN) is programmed, even if the SPIEN fuse is also programmed. Issue the ‘disable debugWIRE’ command while in a debugWIRE debugging session to re-enable the SPI interface. Disabling debugWIRE in this manner requires that the SPIEN fuse is already programmed. If MPLAB® X IDE or Microchip Studio fails to disable debugWIRE, it is probably because the SPIEN fuse is NOT programmed. If this is the case, it is necessary to use a high-voltage programming interface to program the SPIEN fuse.
Table 2-1. SPI Pin Description
MPLAB® Debugger/Programmer Hardware ToolsSPI Pin Mapping
Pin #Pin NameHeader Pin #NameDescription
1TVPP
2TVDD2VCCTarget voltage reference
3GND6GNDCommon ground
4PGD1PDO/MISOSPI data input pin to the programmer. Connect to the MISO pin on the target device.
5PGC3SCKSPI serial clock output
6TAUX5RESETTarget reset control pin
7TTDI4PDI/MOSISPI data output pin for the programmer. Connect to the MOSI pin on the target device.
8TTMS