1 The Programming Interface

For In-System Programming, the programmer is connected to the target using as few wires as possible. To program any AVR microcontroller in any target system, a simple Six-wire interface is used to connect the programmer to the target PCB. The figure below shows the connections needed.

The Serial Peripheral Interface (SPI) consists of three wires: Serial ClocK (SCK), Master In – Slave Out (MISO), and Master Out – Slave In (MOSI). When programming the AVR, the In-System Programmer always operate as the Master, and the target system always operate as the Slave.

The In-System Programmer (Master) provides the clock for the communication on the SCK Line. Each pulse on the SCK Line transfers one bit from the Programmer (Master) to the Target (Slave) on the Master Out – Slave In (MOSI) line. Simultaneously, each pulse on the SCK Line transfers one bit from the target (Slave) to the Programmer (Master) on the Master In – Slave Out (MISO) line.

Figure 1-1. Six-wire Connection Between the Programmer and Target System

To assure proper communication on the three SPI lines, it is necessary to connect ground on the programmer to ground on the target (GND).

To enter and stay in Serial Programming mode, the AVR microcontroller reset line has to be kept active (low). Also, to perform a Chip Erase, the Reset has to be pulsed to end the Chip Erase cycle. To ease the programming task, it is preferred to let the programmer take control of the target microcontroller reset line to automate this process using a fourth control line (Reset).

To allow programming of targets running at any allowed voltage (2.7 - 6.0V), the programmer can draw power from the target system (VCC). This eliminate the need for a separate power supply for the programmer. Alternatively, the target system can be supplied from the programmer at programming time, eliminating the need to power the target system through its regular power connector for the duration of the programming cycle.

The figure below shows the connector used by this In-System Programmer to connect to the target system. The standard connector supplied is a 2 x 3 pin header contact, with pin spacing of 100 mils.

Figure 1-2. Recommended In-System Programming Interface Connector Layout (Top View)