Download Print this page
Atmel AVR910 Application Note
Atmel AVR910 Application Note

Atmel AVR910 Application Note

8-bit risc microcontroller
Hide thumbs Also See for AVR910:

Advertisement

Quick Links

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 Three-wire SPI Programming Interface
Introduction
In-System Programming allows programming and reprogramming of any AVR micro-
controller positioned inside the end system. Using a simple Three-wire SPI interface,
the In-System Programmer 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 system.
This will save time, and money, both during development in the lab, and when updat-
ing the software or parameters in the field.
This application note shows how to design the system to support In-System Program-
ming. 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 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 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), Mas-
ter 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 (Mas-
ter) 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 Program-
mer (Master) on the Master In – Slave Out (MISO) line.
8-bit
RISC
Microcontroller
Application
Note
Rev. 0943E–AVR–08/08

Advertisement

loading
Need help?

Need help?

Do you have a question about the AVR910 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Atmel AVR910

  • Page 1 AVR910: In-System Programming 8-bit Features • Complete In-System Programming Solution for AVR Microcontrollers RISC • Covers All AVR Microcontrollers with In-System Programming Support • Reprogram Both Data Flash and Parameter EEPROM Memories Microcontroller • Complete Schematics for Low-cost In-System Programmer •...
  • Page 2: Hardware Design Considerations

    The connection is shown in Figure 3. The value of the resistors should be chosen depending on the circuitry connected to the SPI bus. Note that the AVR910 0943E–AVR–08/08...
  • Page 3 AVR910 AVR microcontroller will automatically set all its I/O pins to inputs, with pull ups disabled, when Reset is active. Table 1. Connections Required for In-System Programming Name Comment Serial Clock Programming clock, generated by the In-System Programmer (Master) MOSI Master Out –...
  • Page 4 Immediately after Reset goes active on the target AVR microcontroller, the chip is ready to enter Programming mode. The internal Serial Peripheral Interface (SPI) is activated, and is ready to Protocol accept instructions from the programmer. On the AT90S1200, it is very important to keep the AVR910 0943E–AVR–08/08...
  • Page 5 After the “Programming Enable” command has been successfully read by the SPI interface, the programmer can read the device code. The device code will identify the chip vendor (Atmel), the part family (AVR), Flash size in kilobytes, and family member (i.e., AT90S1200). The “Read Device Code”...
  • Page 6: Memory Access

    Part Family and Flash Size $9n indicates AVR with 2 kB Flash memory Part Number Identifies the part, see the file avr910.asm for a complete listing of supported devices Table 5. Part Number Identification Examples Part Family and Flash Size...
  • Page 7 AVR910 byte, and $01 from the low byte. The data on the MISO and MOSI lines will look like shown in Table 7. Writing to the Flash memory will, however, differ depending on the available programming mode. For devices using Byte Programming mode bytes are written with the “Write Program Flash Memory”...
  • Page 8 When both Lock bits 1 and 2 are set, no location can be read, and the result returned will be the Low byte of the address passed in the command. Setting only Lock bit 2 will have no protective effect. Before the chip is protected from reading, it has to be successfully protected from writing. AVR910 0943E–AVR–08/08...
  • Page 9 AVR910 The Lock bits will only prevent the programming interface from altering memory contents. The core can read the Flash program memory and access the EEPROM as usual, independent of the Lock bit setting. Table 11. Lock Bits Protection Modes...
  • Page 10 Some older PC systems might have serial port not accepting voltages below +10 volts as logical zero. This, however, is not a problem with the majority of existing PCs. The file avr910.asm contains the firmware for the AT90S1200. Figure 4. A Low-cost In-System Programmer...
  • Page 11: Part List

    AVR910 Part List Table 14. Part List Position Value Device Tolerance Vendor Comment C100 1U0/20V CE1U020V PHILIPS +++ TANTAL CAPACITOR, SMD, (EIA3216) C101 100N/50V C08B100N 10%_X7R MURATA +++ CERAMIC CAPACITOR, 0805, X7R D100,D101 75V/100MA BAS16 PHILIPS +++ SWITCH DIODE, SO-23 PACKAGE...
  • Page 12 Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY...