AVR910: In-System Programming
Features
•
Complete In-System Programming
Solution for AVR Microcontrollers
•
Covers All AVR Microcontrollers with
In-System Programming Support
•
Reprogram Both Data Flash and
Parameter EEPROM Memories
•
Complete Schematics for Low-cost
In-System Programmer
•
Simple 3-wire SPI Programming
Interface
Introduction
In-System programming allows program-
ming and reprogramming of any AVR
microcontroller positioned inside the end
system. Using a simple 3-wire SPI inter-
f a c e , t h e I n - S y s t e m p r o g r a m m e r
communicates serially with the AVR
microcontroller, reprogramming all non-
volatile memories on the chip.
In-System programming eliminates the
physical removal of chips from the sys-
tem. This will save time, and money,
both during development in the lab, and
when updating the software or parame-
ters in the field.
This application note shows how to
design the system to support In-System
programming. It also shows how a low-
cost In-System programmer can be
made, that will allow the target AVR
microcontroller to be programmed from
any PC equipped with a regular 9-pin
Figure 1. 6-wire Connection between Programmer and Target System
PC 9-PIN
SERIAL PORT
TXD
RXD
GND
serial port. Alternatively, the entire In-
System programmer can be built into the
system allowing it to reprogram itself.
The Programming
Interface
For In-System programming, the pro-
grammer is connected to the target using
as few wires as possible. To program
any AVR microcontroller in any target
system, a simple 6-wire interface is used
to connect the programmer to the target
PCB. Figure 1 below shows the connec-
tions 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 mas ter, and the target s ys te m
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 program-
mer (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.
IN-SYSTEM
PROGRAMMER
VCC
RES
TXD
MISO
RXD
MOSI
GND
SCK
TARGET AVR MCU
AT90S
XXXX
VCC
RESET
MISO
MOSI
SCK
GND
8-bit
RISC
Microcontroller
Application
Note
Rev. 0943C–11/00
1
Need help?
Do you have a question about the AVR910 and is the answer not in the manual?
Questions and answers