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. Figure 1
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.