Introduction

The AVRISP from Atmel Corporation is a professional low cost In-System Programmer covering all AVR 8-bit RISC Micro Controllers. The programmer connects to a PC through a standard RS232 serial interface and draws the necessary power from the target board eliminating the need for an additional power supply.

AVR Studio is used as front-end software, giving you a highly integrated development solution.

Features
  • AVR Studio Interface
  • ISP Programming of all AVR Devices
  • Programs both Flash and EEPROM
  • Supports Fuses and Lock Bit Programming
  • Supports RC Oscillator Calibration
  • Upgradeable to Support Future Devices
  • Operates at Target Voltages from 2.7V to 5.5V
  • Adjustable Speed. Supports all Target Boards Running at Speeds Higher than 8kHz
  • RS-232 Interface to PC for Programming and Control
  • Takes Power from Target. No need for Additional Power Supply

The AVRISP is fully supported by AVR Studio. We recommend to use the latest available version of AVR Studio 4.

  1. AVRISP In-System Programmer
Device Support

AVRISP supports all AVR 8-bit RISC Micro Controllers with ISP programming option. Support for new devices will be added through new versions of AVR Studio. The latest version of AVR Studio is always available from www.atmel.com.

AVR Studio will automatically prompt the user if it is discovered that the firmware in the programmer is outdated.

The following devices are supported:

Classic | Tiny | Mega (1) | Other
AT90S1200 AT90S2313 AT90S/LS2323 AT90S/LS2343 AT90S/LS2333 AT90S4414 AT90S/LS4433 AT90S/LS4434 AT90S8515 AT90S/LS8535 | ATtiny12 ATtiny13 ATtiny15 ATtiny22 ATtiny2313 ATtiny24 ATtiny25 ATtiny26 ATtiny261 ATtiny44 ATtiny45 ATtiny461 ATtiny48 ATtiny84 ATtiny85 ATtiny861 ATtiny88 ATtiny167 | ATmega8 ATmega16 ATmega32 ATmega48 ATmega48P ATmega64 ATmega88 ATmega88P ATmega103 ATmega128 ATmega1280 ATmega1281 ATmega1284P ATmega16HVA ATmega161 ATmega162 ATmega163 ATmega164P ATmega165 ATmega165P ATmega168 ATmega168P ATmega169 ATmega169P ATmega323 ATmega324P ATmega325 ATmega325P ATmega328P ATmega329 ATmega329P ATmega644P ATmega645 ATmega649 ATmega2560 ATmega2561 ATmega3250 ATmega3250P ATmega3290 ATmega3290P ATmega6450 ATmega6490 ATmega8515 ATmega8535 ATmega32C1 ATmega32M1 ATmega32U4 ATmega32HVB ATmega43U | AT86RF401 AT89S51 AT89S52 AT90CAN32 AT90CAN64 AT90CAN128 AT90PWM2 AT90PWM2B AT90PWM3 AT90PWM3B AT90USB82 AT90USB162 AT90USB646 AT90USB647 AT90USB1286 AT90USB1287

(1) All low voltage versions of the devices in this column are also supported.

Information about supported devices in later versions of the firmware can be found in the AVR Studio online help system.

Other topics of interest:

  • Getting Started

  • What's New

  • Known Issues

  • Hardware description

  • AVR Studio Software Front-end

  • Command Line Software

  • Special Considerations

  • Troubleshooting Guide

  • Schematic


What's New

Note: The new communication protocol used with v2 of the firmware is described in application note AVR068. Please visit the Atmel web site for more information.

February 20th, 2008 - FW v02.0A (released with AVR Studio 4.14)

  • Added ISP support for ATtiny88, ATtiny167, ATmega32M1, ATmega32C1 and ATmega32U4

November 21st, 2007 - FW v02.0A (released with AVR Studio 4.13 SP2)

  • Added ISP support for ATtiny43U, ATtiny48, ATmega32HVB and ATmega1284P

August 10th, 2007 - FW v02.0A (released with AVR Studio 4.13 SP1)

  • Added ISP support for AT90USB82, AT90PWM216, AT90PWM316, ATmega328P and ATmega16HVA

February 26th, 2007 - FW v02.0A (released with AVR Studio 4.13)

  • Added ISP support for ATmega88P, ATmega168P and AT90USB162

February 15th, 2007 - FW v02.0A

  • Added ISP support for AT90PWM2B, AT90PWM3B, AT90CAN64, AT90USB162, AT90USB646, AT90USB647, AT90USB1286, AT90USB1287

September 18th, 2006 - FW v02.0A

  • Added ISP support for ATmega48P, ATmega644P

August 3rd, 2006 - FW v02.07

  • Added ISP support for ATmega325P, ATmega3250P, ATmega329P and ATmega3290P

May 24th, 2006 - FW v02.07

  • Added ISP support for ATtiny84

March 30th, 2006 - FW v02.07

  • Added ISP support for ATtiny461

March 17th, 2006 - FW v02.07

  • Added ISP support for ATmega165P and ATmega169P

February 24th, 2006 - FW v02.07

  • Added ISP support for ATmega164P and ATmega324P

  • Added ISP support for ATtiny85

  • Firmware fix: Made ISP programming more robust to handle skew on ISP lines

December 7th, 2005 - FW v02.04

  • Added ISP support for ATtiny25

November 21th, 2005 - FW v02.04

  • Added ISP support for ATtiny44

October 11th, 2005 - FW v02.04

  • Added ISP support for ATtiny861 and AT90CAN32

  • Firmware fix: After AVRISP has left programming mode it will tri-state the reset line with pull-up. (and not force it high)

August 31th, 2005 - FW v02.01

  • Added ISP support for ATmega1280

August 24th, 2005 - FW v02.01

  • Added ISP support for ATmega1281

April 11th, 2005 - FW v02.01

  • Added ISP support for ATmega644

January 27th, 2004 - v2.01

  • Added ISP support for ATtiny24

  • Added ISP support for ATmega645/6450

  • Added ISP support for ATmega649/6490

December 6th, 2004 - v2.00

  • Added ISP support for ATmega2560

  • Added ISP support for ATmega2561


Known Issues

Known Issues of Latest Release

ATtiny2313 Programming Issues

Please note that the Rev. A of ATtiny2313 has an error in the parallel programming interface thus this is not supported.

CAUTION: Avoid fuse settings disabling the ISP interface. This will cause the device to lock for further programming.

Clock sources and pre-scale options

The ATtiny2313 has numerous settings for clock sources and pre-scaling of these. Keep in mind that the STK500/AVRISP only is able to program the part using the ISP method if:

(1) The pre-scaled clock source used on the ATtiny2313 is higher than 32 kHz.

and

(2) The pre-scaled clock source used on the ATtiny2313 is equal to or less than the selected oscillator settings used by the STK500/AVRISP.

ATmega169 Programming Issues

Please note that ISP programming of the ATmega169 EEPROM with a hex-file containing continuous bytes of 0xFF will fail.

Workaround: Using ISP programming, erase EEPROM before programming, and program only bytes with values different than 0xFF.

ATtiny13 Programming Issues

Please note that the ATtiny13 E.S. (Engineering Sample) has an errata concerning special combinations of fuse bits causing the device to lock for further programming. The following combinations of settings/fuse bits will cause this effect:

Oscillator Setting | Start-up Time Setting | Debugwire and Reset Setting
128KHz internal CKSEL[1..0] = 11 | Shortest SUT[1..0] = 00 | Debugwire = Enabled ( DWEN=0) OR Reset = Disabled (RSTDISBL = 0)
9.6 MHz internal CKSEL[1..0] = 10 | Shortest SUT[1..0] = 00 | Debugwire = Enabled ( DWEN=0) OR Reset = Disabled (RSTDISBL = 0)
4.8 MHz internal CKSEL[1..0] = 01 | Shortest SUT[1..0] = 00 | Debugwire = Enabled ( DWEN=0) OR Reset = Disabled (RSTDISBL = 0)
Problem fix/ Workaround

Avoid the above fuse combinations. Selecting longer start-up time will eliminate the problem.

Clock sources and pre-scale options

The ATtiny13 has numerous settings for clock sources and pre-scaling of these. Keep in mind that the STK500/AVRISP only is able to program the part using the ISP method if:

(1) The pre-scaled clock source used on the ATtiny13 is higher than 32 kHz.

and

(2) The pre-scaled clock source used on the ATtiny13is equal to or less than the selected oscillator settings used by the STK500/AVRISP.

Firmware Upgrade

In order to achieve a successful firmware upgrade, make sure that the following conditions are met:

  • The target voltage must be stable and at least 2.7V.
  • No target hardware must drive the MISO, MOSI or SCK pins on the ISP connection.

Backward Compatibility

  • Note that by performing a firmware upgrade, the AVRISP will only be compatible with the latest release of AVR Studio 4. It will not be compatible with AVR Studio 3.56.


Getting Started

Unpacking the System

The AVRISP Product contains the following items:

  • AVRISP Programmer
  • AVRISP User Guide
  • 10-pin ISP cable (connected to AVRISP)
  • 6-pin ISP cable (optional)
  • 9-pin RS-232 Cable
System Requirements

The minimum hardware and software requirements are:

  • 486 Processor (Pentium is recommended)
  • 16 MB RAM
  • 15 MB Free Hard Disk Space
  • Windows® 95, Windows® 98, Windows NT® 4.0, or Windows® 2000
  • 115200 baud RS-232 port (COM port).

Other topics of interest:

  • Hardware description

  • AVR Studio Software Front-end

  • Command Line Software

  • Special Considerations

  • Troubleshooting Guide

Return to introduction


Hardware Description

General Board Description

A block diagram of the AVRISP is shown in Figure 1. The AVRISP can be divided in 3 sections: The RS-232 interface, the Control section and the ISP cable. In this section a brief overview of the different blocks will be given.

Figure 1: Simplified AVRISP Block Schematics
RS-232 Serial Interface

The AVRISP uses a standard female DSUB, RS-232 port for communication with the front-end software (AVR Studio). It supports communication of 115200 baud.

Control Section

The control MCU handles all communication between the target AVR and the front-end software. The AVRISP is completely software controlled from AVR Studio. No manual configuration of the AVRISP is needed.

Status Led.
Led Color | Description
Red-Yellow-Green-Off-Green cycle | Power on Sequence
Yellow | Busy - Programming
Red | Programming failed
Green | Ready - OK

A 3-color LED indicates the status of the AVRISP. During programming the LED is yellow. When the target AVR is successfully programmed, the LED will turn green. If programming fails, the LED will turn red to indicate that programming (or verification) failed. If programming fails, check the Troubleshooting Guide. During start-up the status LED cycles through red, yellow to green to indicate that the master MCU is ready.

ISP Interface Cables

AVRISP supports both the normal 6-pin header connector pinout and the 10-pin header connector used by the older STK200 and STK300 development boards. Figure 2 shows the pinouts for the 6-pin and 10-pin ISP connectors.

AVRISP is delivered with one 6-wire and one 10-wire ISP cable. Use the one that match the pinout of the target ISP connector. Note however that only one cable should be connected, and used, at any given time. By default the 10-pin header connector is mounted.

Figure 2: AVRISP Connectors (Top View)

VRISP Connector pinout
Signal | 6-Pin | 10-Pin | I/O | Description
VTG | 2 | 2 | - | Power is delivered from the target board
GND | 6 | 3,4,6, 8,10 | - | Ground
MOSI | 4 | 1 | Output | Commands and data from AVRISP to target AVR
MISO | 1 | 9 | Input | Data from target AVR to AVRISP
SCK | 3 | 7 | Output | Serial Clock, Controlled by AVRISP
RESET | 5 | 5 | Output | Reset. Controlled by AVRISP
AVRISP Power Requirements and Considerations

Since the AVRISP draws power from the target, it is important that the target board is able to provide enough power to ensure correct operation. The AVRISP will draw maximum 50mA @ 5.5V. The current is drawn through the VTG line. The target should thus be able to supply at least this amount of power in addition to the requirements of the target board itself.

The AVRISP is not equipped with a power switch. Power is turned on when AVRISP is connected to the target application and turned off when disconnected.

Connecting AVRISP to Target Board

The AVRISP connects to the target board through a 3x2 or 5x2 male header connector with 2,54mm (0.1") spacing. Depending on if there is a 6-pin or 10-pin ISP connector on the target board, the cable on the AVRISP has to be changed accordingly.

The power of the target board should be turned off when connecting or disconnecting the header connector. Hot-swapping is not supported, and might damage the programmer.

To change the cable the AVRISP box must be opened and the correct cable must be connected. See Figure 3 and 4. Note that only one cable should be connected at any given time. Make sure that the cable is mounted in the correct orientation.

Figure 3: AVRISP with 10-pin ISP Connector
Figure 4: AVRISP with 6-pin ISP Connector
Handling the ISP Lines

When connecting the AVRISP to an external target some precautions should be taken. In this section a few hints and tips will be given that should assure problem free communication between the AVRISP and target device.

The part can be programmed in system from AVR Studio with In-System Programming (ISP) programming mode, running at the parts normal supply voltage.

For instruction on using the AVR studio programming software, please refer to the AVR Studio Section.

VCC and GND

Connect the AVRISP ISP power lines to the appropriate pins on the AVR device (preferably through a 6 or 10-pin connector on the target board). Make sure the target Voltage is within specified range of the programmer (2.7V - 5.5V). Make sure that the target power supply can deliver the additional power required to power the AVRISP at the given voltage.

SCK

The target AVR samples the clock signal generated from the AVRISP. To make the sampling robust, a target XTAL1-frequency four times higher than the programming clock (SCK) is required. By selecting the correct target speed in AVR Studio, the correct SCK is automatically generated. The lowest supported target frequency is 8kHz.

MOSI/MISO/SCK

If the MOSI, MISO or SCK line are used as general I/Os in the application, it is recommended to use series resistors between the load and the AVR as shown in Figure 5. The AVRISP lines should be connected directly to the AVR pins, without any series resistors.

Figure 5: Loading on the MISO/MOSI/SCK lines
RESET

To enter programming mode AVRISP needs to pull RESET low. It is important that the external pull-up resistor on RESET pin is not so strong that it forces (holds) the pin high. To avoid this problem it is recommended that the RESET pull-up resistor should be no less than 4.7 kOhm.

Other topics of interest:

  • Getting Started

  • AVR Studio Software Front-end

  • Command Line Software

  • Special Considerations

  • Troubleshooting Guide

Return to introduction


AVR Studio Software Front-end

The Front-End software for programming with the AVRISP is described in the AVRStudio help section. See AVRStudio: Programming Dialog.


Command Line Software

The DOS command line of the programming interface is the same as for the STK500 starter kit. It is named "stk500.exe" and allows simple batch files for automatic programming.

In the following text it will be shown how to make simple batch files for automating the programming steps for a device.

Command Line Switches:

[-d device name] [-m s|p] [-if infile] [-ie infile] [-of outfile]

[-oe outfile] [-s] [-O address] [-Sf addr] [-Seaddr] [-e] [-p f|e|b]

[-r f|e|b] [-v f|e|b] [-l value] [-L value] [-y] [-f value] [-E value]

[-F value] [-G value] [-q] [-Y] [-Z address] [-c port] [-ut value]

[-ua value] [-wt] [-wa] [-b h|s] [-! freq] [-t] [-I freq] [-J]

[-h] [-?]

Parameters:

d Device name. For a list of supported devices use STK500.EXE -?

m Select programming mode; serial (s) or parallel/high-voltage (p).

Serial mode is the default mode if this parameter is ommitted.

if Name of FLASH input file. Required for programming or verification

of the FLASH memory. The file format is Intel Extended HEX.

ie Name of EEPROM input file. Required for programming or verification

of the EEPROM memory. The file format is Intel Extended HEX.

of Name of flash output file. Required for readout of the FLASH memory.

The file format is Intel Extended HEX.

oe Name of EEPROM output file. Required for readout of the EEPROM

memory. The file format is Intel Extended HEX.

s Read signature bytes.

O Read oscillator callibration byte. 'address' is the address of the

calibration byte as decribed in the data sheet of the device.

Sf Write oscillator call. byte to FLASH memory. 'addr' is byte address

Se Write oscillator call. byte to EEPROM memory. 'addr' is byte address

e Erase device. If applied with another programming parameter, the

device will be erased before any other programming takes place.

p Program device; FLASH (f), EEPROM (e) or both (b). Corresponding

input files are required.

r Read out device; FLASH (f), EEPROM (e) or both (b). Corresponding

output files are required

v Verify device; FLASH (f), EEPROM (e) or both (b). Can be used with

-p or stand alone. Corresponding input files are required.

l Set lock byte. 'value' is an 8-bit hex. value.

L Verify lock byte. 'value' is an 8-bit hex. value to verify against.

y Read back lock byte.

f Set fuse bytes. 'value' is a 16-bit hex. value describing the

settings for the upper and lower fuse.

E Set extended fuse byte. 'value' is an 8-bit hex. value describing the

extend fuse settings.

F Verify fuse bytes. 'value' is a 16-bit hex. value to verify against.

G Verify extended fuse byte. 'value' is an 8-bit hex. value describing

the extend fuse settings.

q Read back fuse bytes.

Y Perform the oscillator calibration sequence. See appnote AVR053 for more

information.

Z Loads a value from an EEPROM location prior to chip erase which then

can be programmed into FLASH or EEPROM using the S option. Address is

a hex value. See appnote AVR053 for more information.

c Select communication port; 'com1' to 'com8'. If this parameter is

ommitted the program will scan the comm. ports for the STK500

ut Set target voltage VTARGET in Volts. 'value' is a floating point

value between 0.0 and 6.0, describing the new voltage.

ua Set adjustable voltage AREF in Volts. 'value' is a floating point

value between 0.0 and 6.0, describing the new voltage.

wt Get current target voltage VTARGET.

wa Get current adjustable voltage AREF.

b Get revisions; hardware revision (h) and software revision (s).

! Set oscillator frequency; 'freq' can be whole Hz, or kHz or MHz

t Get oscillator frequency.

I Set ISP frequency; 'freq' can be whole Hz, or kHz or MHz

J Get ISP frequency.

h Help information (overrides all other settings)

h|? Help information (overrides all other settings)

Example 1:

stk500 -dAT90S8515 -e -pf -if8515test.hex

Description:

stk500 Runs the file stk500.exe

-dAT90S8515 Set device to AT90S8515

-e Erase flash

-if8515test.hex Selects file "8515test.hex" to be programmed into flash

-pf Program flash (with the selected file above)

Example 2:

stk500 -ccom1 -ut4.5 -ua4.5 -!3686000 -I460800 -dATMEGA8515 -lFF -fD9E4 -ms -ifC:\input.hex -pf -vf -e

Description:

stk500            Runs the file stk500.exe

-ccom1 Select comport #1

-ut4.5 Set the target voltage (4.5V)

-ua4.5 Set the Analog reference voltage (4.5V)

-!3686000 Set STK500 clock frequency to 3.68MHz

-I460800 Set ISP frequency to 460.8kHz

-dATMEGA8515 Set device to ATmega8515. Type "stk500.exe -h" to see all supported devices

-e Erase flash

-lFF Set lockbits to 0xFF

-fD9E4 Set fuses to 0xD9E4, High byte 0xD9, Low Byte 0xE4

-ms Select serial programming mode

-ifC:\input.hex Selects file "input.hex" to be programmed into flash

-pf Program flash (with the selected file above)

-vf Verify flash (with the selected file above)

Other topics of interest:

  • Getting Started

  • Hardware description

  • AVR Studio Software Front-end

  • Special Considerations

  • Troubleshooting Guide

Return to introduction


Special Considerations

There are a few special considerations that should be noted when using this AVRISP programmer to In-System program AVR Devices.

Fuse Programming

Some devices have fuses not accessible in ISP mode. To program these fuses a parallel programmer is needed. Some of the AVR devices allow access to the SPIEN and RSTDISBL fuses. Un-programming / programming these fuses will disable further ISP programming.

RESET Used as General IO port.

If the RESET pin is used as a general purpose IO, In-System Programming is not possible. The reason is that the RESET pin must pulled to 12V to enter High Voltage Serial or Parallel Programming mode (HVSP or HVP). HVSP or HVP must be used to change the RSTDSBL fuse.

AVR Devices with no ISP Option

Some devices do not have an ISP programming option. (e.g. ATtiny28) To program these devices, a parallel programmer is required. (e.g STK500 Starter Kit). Only devices with low voltage ISP programming mode are supported by the AVRISP.

Devices without RC Oscillator Calibration

Not all devices with internal RC clock option feature Oscillator calibration. For these devices the internal RC will run at the default speed as indicated by the appropriate datasheet.

Other topics of interest:

  • Getting Started

  • Hardware description

  • AVR Studio Software Front-end

  • Command Line Software

  • Troubleshooting Guide

Return to introduction


Troubleshooting Guide

Problem | Reason | Solution
The LED is not lit | AVRISP is not connected to target | Connect ISP cable to target board
 | ISP pinout is not correct | Verify pinout on target ISP header connector
 | Target does not provide enough power | Verify that the target power supply can deliver enough power
Can't get any communication with target device | ISP pinout is not correct | Verify pinout on target ISP header connector
 | Device does not support ISP programming mode | Verify that device supports ISP mode, and that correct IO pins are connected.
 | Heavy loading on ISP pins | Connect series resistors between load and IO pins as shown here.
 | Too strong pullup on RESET pin | Reset pullup resistor should be more than 4.7kOhm.
 | Target frequency set wrong in AVR Studio | Reduce the frequency in AVR Studio to match the target board frequency
 | Target does not provide enough power | Verify that the target power supply can deliver enough power to source both application and AVRISP
 | SPIEN fuse disabled | Enable SPIEN fuse with a Parallel /High Voltage Serial programmer
 | Reset used as general IO | Use a High Voltage Serial Programmer /Parallel programmer to Change the RSTDISBL fuse.
AVR Studio does not find AVRISP | Old version of AVR Studio | Download AVR Studio 4 from www.atmel.com
 | Other Device or service controls the COM port | Disable Mouse Drivers IRDA drivers or other devices that takes control of the COM port.

Other topics of interest:

  • Getting Started

  • Hardware description

  • AVR Studio Software Front-end

  • Command Line Software

  • Special Considerations

Return to introduction


AVRISP User's Guide: Manual Firmware Upgrade

AVRISP Manual Firmware Upgrade

Firmware Upgrading is usually done either automatically by AVR Studio, if AVR Studio detects that the Firmware distributed with AVR Studio is newer that the Firmware present in the AVRISP, or by selecting "upgrade" in the STK500/AVRISP dialog window opened from the Tools Menu in AVR Studio. However, if the communication between the AVRISP and the PC is broken during Firmware Upgrading the AVRISP stops responding, both Firmware Upgrading and Programming will not work. The AVR ISP is NOT broken, but it is no longer able to automatically enter Programming mode – Programming mode have to be forced to do a firmware upgrade. Once this is done the AVRISP is up and running again.

The problem can occur if removing the power from the target application (which provide the target voltage for the AVR ISP) or if the serial cable is removed during the Programming.

Figure 1: AVR ISP PCB Layout – Pin Holes Marked with Green Circle

Fugure 2: AVR ISP without Housing – Pin Holes Marked with White Circle

Procedure for manually upgrading the AVR ISP Firmware:

  • Power off the AVRISP by powering off the target board that supplies the power to the AVRISP.

  • Short the pin holes marked on Figure 1 (PCB layout) and Figure 2 (photo).

  • Power on the AVRISP by powering the target board that supplies the power to the AVRISP(1).

  • Wait for 5 seconds.

  • Remove the short.

  • Start AVR Studio.

  • Start the application “AVR Prog” located in the Tools menu.

  • Click “Browse” button in Hex file window. Locate the firmware upgrade hex-file 'stk500.ebn' by pushing the 'Browse'-button in the 'Avr Prog Hex File'-window. The path for the 'stk500.ebn' for a normal AVR Studio installation is "C:\Program Files\Atmel\AVR Tools\STK500".

  • Click “Program” button in Flash window.

  • Close “AVR Prog” after Programming and verification is completed.

  • Power off the AVRISP.

The Firmware of the AVRISP is now upgraded and the programmer is ready for usage.

Note: 1. If the STK500 is used to provide power to the AVRISP, make sure to use the headers SPROG1/2/3 and remove any devices present in the STK500. If a custom target board is used to supply power to the AVRISP, make sure to erase the device prior to the AVRISP upgrade to ensure that the device is not driving the ISP Lines.


Schematic

Schematic and layout

AVRISP schematic: AVRISP.pdf

AVRISP component placement: AVRISP_asm.pdf