ATAVRISPUserGuide PDF
ATAVRISPUserGuide PDF
.............................................................................
User Guide
Table of Contents
Table of Contents
Section 1
Introduction ........................................................................................... 1-1
1.1 Features ....................................................................................................1-1
1.2 Device Support .........................................................................................1-2
Section 2
Getting Started...................................................................................... 2-1
2.1 Unpacking the System ..............................................................................2-1
2.2 System Requirements...............................................................................2-1
Section 3
Hardware Description ........................................................................... 3-1
3.1 General Board Description........................................................................3-1
3.1.1 RS-232 Serial Interface ......................................................................3-1
3.1.2 Control Section ...................................................................................3-1
3.1.3 ISP Interface Cables...........................................................................3-2
3.2 AVRISP Power Requirements and Considerations ..................................3-2
3.3 Connecting AVRISP to Target Board........................................................3-2
3.4 Handling the ISP Lines .............................................................................3-3
3.4.1 VCC and GND ....................................................................................3-3
3.4.2 SCK ....................................................................................................3-3
3.4.3 MOSI/MISO/SCK................................................................................3-3
3.4.4 RESET................................................................................................3-4
Section 4
Software Front-end ............................................................................... 4-1
4.1 Installing AVR Studio ................................................................................4-1
4.2 Using AVR Studio .....................................................................................4-1
4.2.1 Starting the Windows Software ..........................................................4-1
4.2.2 Starting AVRISP Interface ..................................................................4-1
4.2.3 Using AVRISP and STK500 Simultaneously......................................4-2
4.3 AVRISP User Interface .............................................................................4-2
4.3.1 “Program” Settings .............................................................................4-2
4.3.1.1 Device ..........................................................................................4-3
4.3.1.2 Programming Mode......................................................................4-3
4.3.1.3 Flash ............................................................................................4-3
i
Table of Contents
Section 5
Command Line Software ...................................................................... 5-1
5.1 Parameters: ..............................................................................................5-1
5.1.1 Sample Usage ....................................................................................5-3
Section 6
Special Considerations ......................................................................... 6-1
6.1 Fuse Programming ...................................................................................6-1
6.2 RESET Used as General IO Port..............................................................6-1
6.3 AVR Devices with no ISP Option ..............................................................6-1
6.4 Devices without RC Oscillator Calibration ................................................6-1
Section 7
Troubleshooting Guide ......................................................................... 7-1
Section 8
Technical Specifications ....................................................................... 8-1
Section 9
Technical Support................................................................................. 9-1
ii
Section 1
Introduction
The AVR® In-System Programmer (AVRISP) from Atmel® is a professional low-cost In-
System Programmer covering all AVR 8-bit RISC Microcontrollers. The programmer
connects to a PC through a standard RS-232 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.
The AVRISP is fully supported by AVR Studio version 3.5 or higher. For up to date infor-
mation on this and other AVR tool products please read the document “avrtools.pdf”.
LAtest version of AVR Studio (“avrtools.pdf”) and this user guide can be found in the
AVR section of the Atmel web site.
1.2 Device Support AVRISP supports all AVR 8-bit RISC Microcontrollers with ISP programming option.
Support for new devices will be added through new versions of AVR Studio.
AVR Studio will automatically prompt the user if it is detects that the firmware in the pro-
grammer is outdated.
The following devices are currently supported:
ATtiny12
ATtiny15
ATtiny22
AT90S1200
AT90S2313
AT90S/LS2323
AT90S/LS2343
AT90S/LS2333
AT90S4414
AT90S/LS4433
AT90S/LS4434
AT90S8515
AT90S/LS8535
ATmega161(L)
ATmega16(L)
ATmega163(L)
ATmega32(L)
ATmega323(L)
ATmega103(L)
ATmega128(L)
Information about supported devices in latest versions of the firmware can be found in
the AVR Studio Online Help System.
Note: For special programming considerations please see Section 6.
3.1 General Board A block diagram of the AVRISP is shown in Figure 3-1. The AVRISP can be divided in
Description three sections: The RS-232 interface, the Control section and the ISP cable. In this sec-
tion a brief overview of the different blocks will be given.
RS-232 VTG
Level VTG
MOSI
VTG
MISO
RxD RxD CTRL
TxD MCU SCK
TxD
GND
RESET
GND
3.1.1 RS-232 Serial The AVRISP uses a standard female DSUB, RS-232 port for communication with the
Interface front-end software (AVR Studio). It supports communication of 115200 baud.
3.1.2 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 ISP is needed.
Table 3-1. 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 yel-
low. 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” on page Table 7-1. Dur-
ing start-up the status LED cycles through red, yellow to green to indicate that the
master MCU is ready.
3.1.3 ISP Interface Cables AVRISP supports both the 6-pin header connector pinout, used by the Atmel AT90ISP
cable, and the 10-pin header connector used by the STK200 and STK300 development
boards. Figure 3-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. However, note that only one cable should be con-
nected, and used, at any given time. By default the 10-pin header connector is mounted.
MOSI VTG
GND GND
MISO VTG RST GND
SCK MOSI SCK GND
RST GND MISO GND
ISP6PIN ISP10PIN
3.2 AVRISP Power Since the AVRISP draws power from the target, it is important that the target board is
Requirements able to provide enough power to ensure correct operation. The AVRISP will draw maxi-
and mum 50 mA @ 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 tar-
Considerations
get board itself.
See “Technical Spesification” section on page 8-1 for information on power
consumption.
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.
3.3 Connecting The AVRISP connects to the target board through a 3 x 2 or 5 x 2 male header connec-
AVRISP to Target tor with 2.54 mm (0.1”) spacing (Figure 3-3). If there is a 6-pin or 10-pin ISP connector
Board 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-3 and Figure 3-4. Note that only one cable should be con-
nected at any given time. Make sure that the cable is mounted in the correct orientation.
3.4 Handling the ISP When connecting the AVRISP to an external target some precautions should be taken.
Lines In this section a few hints and tips will be given that should assure problem free commu-
nication between the AVRISP and target device.
The part can be programmed in-system from AVR Studio with In-System Programming
(ISP) in programming mode, running at the parts normal supply voltage.
For instruction on using the AVR studio programming software, see “Using AVR Studio”
on page 4.2
3.4.1 VCC and GND Connect the AVRISP ISP power lines to the appropriate pins on the AVR device (prefer-
ably 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. See Section 8
3.4.2 SCK The target AVR samples the clock signal generated from the AVRISP. To make the
sampling robust, a target main clock, 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 8 kHz.
3.4.3 MOSI/MISO/SCK If the MOSI, MISO or SCK lines are used as general I/Os in the application, it is recom-
mended to use series resistors between the load and the AVR as shown in Figure 3-5.
The AVRISP lines should be connected directly to the AVR pins, without any series
resistors.
Note that the ISP lines are driven directly from an AVR microcontroller inside the
AVRISP. The resistors must be set according to this AVR’s maximum sink and source
currents and the application load. Refer to the AVR’s datasheet for the maximum sink
and source current. Datasheets can be dowloaded form Atmel’s web site,
www.atmel.com.
ISP Header
AVR
VCC
GND
LOAD MOSI
MISO
SCK
R
3.4.4 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 10 kΩ.
4.1 Installing AVR AVR Studio with its Integrated Development Environment (IDE) is the ideal software for
Studio all AVR developments. It has an editor, an assembler, a debugger and is front-end for all
AVR emulators, STK500 and the AVRISP In-System Programmer. AVRISP uses the
same programming interface as the STK500.
To install AVR Studio insert the supplied Atmel CD-ROM Databook in the computer and
navigate to “Products → AVR 8-bit RISC → Software”. Right click with the mouse on the
“avrstudio3.exe” file and select "save link as". Select an empty directory and save the
file.
Execute the “avrstudio3.exe” file, this is a self-extracting file that will extract all required
files to the current directory. Execute the “Setup.exe” file, this will guide you through the
setup process.
Note: AVR Studio version 3.5 or higher is required for AVRISP support.
AVR Studio is continuously updated to support new devices and to add functionality.
The latest version of AVR Studio can be downloaded from www.atmel.com.
4.2 Using AVR It is assumed that the reader has general knowledge of how to use AVR Studio. For
Studio more information on general use of the program, please look in the interactive help sys-
tem supplied with AVR Studio. This user guide covers AVRISP specific topics only.
In this section the supporting software for AVRISP will be presented, and an in-depth
description of the available programming options given.
4.2.1 Starting the The software used for communicating with the AVRISP is included in AVR Studio ver-
Windows Software sion 3.5 or later. Once installed, double clicking on the icon starts AVR Studio. If
default install options are used, the program is located in the Windows Start Menu →
Programs → Atmel AVR Tools folder.
4.2.2 Starting AVRISP Pressing the button on the AVR Studio toolbar will start the AVRISP user interface
Interface as shown in Figure 4-1.
Note that the same interface is used for both STK500 and AVRISP. Since STK500
includes features that are not supported in the AVRISP, some features are not select-
able when using the AVRISP interface. Only supported features are selectable.
4.2.3 Using AVRISP and When AVR Studio is scanning for connected devices, it searches through the COM
STK500 ports in a sequential manner. The first device encountered, will gain control over the
Simultaneously COM port. It is not possible to control both, a STK500 and an AVRISP, from AVR Studio
simultaneously. To do this two instances of AVR Studio must be executed simulta-
neously. The title bar on the Programming interface will indicate whether it controls the
AVRISP or the STK500.
4.3 AVRISP User The AVRISP User Interface includes a lot of powerful features for the AVRISP In-Sys-
Interface tem Programmer. The available settings are divided into six groups, each selectable by
pressing on the appropriate tab. Since different devices have different features, the
available options and selections will depend on which device is selected. Unavailable
features are grayed out.
4.3.1 “Program” Settings The program settings are divided into four different sub groups.
4.3.1.1 Device Device is chosen by selecting the correct device from the Pull-down menu. This group
also includes a button that performs a chip-erase on the selected device, erasing both
the FLASH and EEPROM memories.
4.3.1.2 Programming Mode This group selects programming mode. AVRISP only supports the ISP low-voltage
mode. Checking the “Erase Device Before Programming” will force AVRISP to perform
a chip-erase before programming the device. Checking the “Verify Device After Pro-
gramming” will force AVRISP to perform a verification of the memories after
programming.
4.3.1.3 Flash If the AVRISP User Interface is opened without a project loaded in AVR Studio, the “Use
Current Simulator/Emulator Flash Memory” option will be grayed out. When a project is
open this option allows programming of the Flash memory content currently present in
the Flash Memory view of AVR Studio. For more information about AVR Studio memory
views, please take a look in the AVR Studio help system.
If no project is running, or the source code is stored in a separate HEX file, select the
“Input HEX File” option. Browse to the correct file by pressing the button, or write the
complete path and filename in the text field. The selected file must be in “Intel-hex” for-
mat or “extended Intel-hex” format.
4.3.1.4 EEPROM If the AVRISP User Interface is opened without a project loaded in AVR Studio, the “Use
Current Simulator/Emulator EEPROM Memory” option will be grayed out. When a
project is open this option allows programming of the EEPROM memory content cur-
rently present in the EEPROM Memory view. For more information about AVR Studio
memory views, please take a look in the AVR Studio help system.
If no project is running, or the source code is stored in a separate HEX file, select the
“Input HEX File” option. Browse to the correct file by pressing the button, or write the
complete path and filename in the text field. The selected file must be in “Intel-hex” for-
mat or “extended Intel-hex” format.
4.3.2 "Fuses" Settings On the “Fuses Settings” tab, an overview of accessible fuses are presented. Some
fuses are only available during Parallel /High-voltage programming. These will be dis-
played, but are not accessible when operating in ISP programming mode. Press the
“Read” button to read the current value of the fuses, and the “Write” button to write the
current fuse setting to the device. Checking one of these check-boxes indicates that this
fuse should be enabled/programmed, which means writing a “zero” to the fuse location
in the actual device. Note that the selected fuse setting is not affected by erasing the
device with a chip-erase cycle (i.e., pressing “Chip Erase” button in the “Program”
settings).
Table 4-1. Check Box Description
Icon Description
Readback of current state is impossible, but fuse or lock can be programmed. Set to be
programmed.
Readback of current state is impossible, but fuse or lock can be programmed. Not set to
be programmed.
Readback of current value indicated unprogrammed lock or fuse bit, but no access is
possible. (I.e., can not be changed in serial mode.)
Readback of current value indicated programmed lock or fuse bit, but no access is
possible. (I.e., cannot be changed in serial mode.)
Detailed information on which fuses are available in the different programming modes
and their functions can be found in the appropriate device datasheet. By checking the
“Auto Verify” check box, a verification will be automatically preformed after each
programming.
Please see the “Special Considerations” in Section 6 if you plan to change the RST-
DISBL or SPIEN fuse.
4.3.3 “Lock Bits” Settings Similar to the “Fuses” settings, the “Lock Bits” tab shows which lock modes are applica-
ble to the selected device. All lock bits are accessible in ISP programming mode. A lock
mode may consist of a combination of multiple lock bits. The AVRISP User Interface
handles this, and the correct lock bits are programmed automatically for the selected
Lock mode. Once a Lock mode protection level is enabled, it is not possible to lower the
protection level by selecting a lower degree of protection or by setting a different Lock
mode. The only way of removing a programmed lock bit is to do a complete chip-erase,
erasing both Program and EEPROM memories. One exception exists: If the target
device has a programmed “EESAVE” fuse, the contents of the EEPROM will be kept
even when a complete chip erase on the device is performed. By checking the “Auto
Verify” check box a verification will be automatically preformed after each programming.
4.3.4 “Advanced” The Advanced tab is currently divided into two sub groups.
Settings
Figure 4-5. Advanced Settings
4.3.4.1 Signature Bytes By pressing the “Read Signature” button, the signature bytes are read from the target
device. The signature bytes act like an identifier for the part. Please refer to the AVR
datasheets for more information about signature bytes.
4.3.4.2 Oscillator For devices with calibratable Internal RC Oscillator, the oscillator calibration byte is writ-
Calibration Byte ten to the device during manufacturing, and cannot be erased or altered by the user.
The calibration byte is a tuning value that should be written to the OSCCAL register in
order to tune the internal RC to specified frequency.
4.3.4.3 Reading Oscillator By pressing the “Read Cal. Byte” button, the calibration value is read from the device
Calibration Byte and shown in the “Value” text box. If this option is grayed out, the selected device does
not have a tunable internal RC Oscillator. On selected devices, the RC oscillator is self-
calibrating. On these devices there is no need to handle the Calibration byte manually
(for more information see appropriate device datasheet).
4.3.4.4 Writing Oscillator Since the calibration byte is not directly accessible during program execution on devices
Calibration Byte without automatic RC calibration, the user should write the calibration byte into a known
location in Flash or EEPROM memory. Do this by writing the desired memory address in
the “Write Address” text box and then press the “Write to Memory” button. The calibra-
tion byte is then written to the memory indicated by the “Flash” and “EEPROM” radio
buttons.
4.3.5 “Board” Settings The Board tab allows changing the operating conditions for the AVRISP programmer.
The AVRISP allows modification of the Oscillator frequency.
4.3.5.1 Oscillator The AVRISP programmer uses a programmable oscillator circuit that offers a wide
range of frequencies for the target device.
The frequency given here should be lower or equal to the frequency of the target AVR to
be programmed. Based on this number, the AVRISP User Interface calculates the com-
munication speed between the AVRISP and the target AVR.
Note that the drop-down list only have a few selectable frequencies. For any other fre-
quency, write it in the input field and press “Write Osc”. The frequency will then be set to
the closest attainable and displayed in the field.
4.3.5.2 Revision In the revision box the current revision AVRISP revision number is shown. If AVR Studio
discovers that the AVRISP contains an older version than the one distributed with AVR
Studio, it will automatically ask for permission to upgrade the Programmer.
4.3.6 "Auto" Settings When programming multiple devices with the same code, the Auto tab offers a powerful
method of automatically going through a user-defined sequence of commands. The
commands are listed in the order they are executed (if selected). To enable a command,
the appropriate check box should be checked (e.g., if only “Program FLASH” is
checked, by pressing the “Start” button the FLASH memory will be programmed with the
HEX file specified in the “Program” settings). All commands depend on, and use, the
settings given in the AVRISP User Interface. It is possible to log the command execution
to a text file by checking the “Log to file” check box.
4.3.6.1 Setting up the Click on the check boxes for the commands the AVRISP User Interface should perform.
System for Auto A typical sequence where the device is erased and then programmed is shown in Figure
Programming 4-7. The chip is erased, both memories programmed and verified.
Once configured, the same programming sequence is executed every time the “Start”
button is pressed. This reduces both work and possibilities for errors due to operational
errors.
4.3.6.2 Logging the Auto By clicking on the “Log to File” check box all output from the commands are written to a
Programming to a text file. The file is selected/created by pressing the “Browse” button. Navigate to the
File location where the file is placed, or should be created. The output is directed to this file,
and can be viewed and edited using a standard text editor. An existing file will be
overwritten.
4.3.7 History Window The History window is located at the bottom of the AVRISP view. In this window the dia-
log between AVR Studio and AVRISP is shown. For every new command performed,
the old dialog is replaced with the new one.
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 shows how to make simple batch files for automating the program-
ming steps for a device.
Synopsys: STK500
[-d device name] [-m s|p] [-if infile] [-ie infile] [-of
outfile] [-oe outfile] [-s] [-O] [-Sf addr] [-Seaddr] [-e] [-p
f|e|b] [-r f|e|b] [-v f|e|b] [-l value] [-L value] [-y] [-f
value] [-F value] [-q] [-x value] [-af start,stop] [-ae
start,stop] [-c port] [-ut value] [-ua value] [-wt] [-wa] [-j
value] [-b h|s] [-! freq] [-&] [-t p|t] [-t] [-n] [-g] [-z] [-
U] [-h|?]
g Silent operation.
z No progress indicator (e.g., if piping to a file for
log purposes, use this option to avoid the non-ascii
characters used for the indicator.
h|? Help information (overrides all other settings).
Since the interface is also used for the STK500 Starter Kit, not all listed switches are
applicable to the AVRISP. STK500 software will give an error-message if an unsup-
ported switch is used.
5.1.1 Sample Usage Erase, program and verify the flash of an AT90S8515
STK500 -dAT90S8515 -ms -e -pf -vf -iftest.hex
Erase, program and verify the EEPROM of an AT90S/LS4433
STK500 -dAT90S4433 -ms -e -pe -ve -ietest.hex
There are a few special considerations that should be noted when using this AVRISP
programmer For In-System Programing of AVR Devices.
6.1 Fuse Some devices have fuses not accessible in ISP mode. To program these fuses a paral-
Programming lel programmer is needed. Some of the tinyAVR™ devices allow access to the SPIEN
and RSTDISBL fuses. Unprogramming/programming these fuses will disable further ISP
programming.
6.2 RESET Used as If the RESET pin is used as a general purpose IO, In-System Programming is not possi-
General IO Port ble. The reason is that the RESET pin must pulled to 12V to enter High Voltage Serial
Programming mode (HVSP). HVSP must be used to change the RSTDSBL fuse.
6.3 AVR Devices Some devices do not have an ISP programming option (e.g., ATtiny28). To program
with no ISP these devices, a parallel programmer is required. (e.g STK500 Starter Kit). Only devices
Option with low-voltage ISP programming mode are supported by the AVRISP.
6.4 Devices without Not all devices with internal RC clock option feature Oscillator calibration. For these
RC Oscillator devices the internal RC will run at the default speed as indicated by the appropriate
Calibration datasheet.
e-mail
literature@atmel.com
Web Site
http://www.atmel.com
BBS
1-(408) 436-4309
System Unit
Physical Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 x 75 x 27 mm
Weight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 g.
Operating Conditions
Voltage Range. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.7V - 5.5V
Target Freq Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .higher than 8 kHz
Max I @ 5.5V target voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 mA
Max I @ 3.3V target voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 mA
Connections
Serial Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-pin D-SUB Female
Serial Communications Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115200 bits/second
ISP connector . . . . . . . . . . . . . . . . . . . . 3 x 2 and 5 x Male connector 2.54 mm spacing
For Technical support, please contact avr@atmel.com. When requesting technical sup-
port for AVRISP, please include the following information:
Version number of AVR Studio (this can be found in the AVR Studio help menu).
PC processor type and speed
PC operating system and version
What target AVR device is used (complete part number)
Programming Voltage and speed
A detailed description of the problem
e-mail
literature@atmel.com
Web Site
http://www.atmel.com
BBS
1-(408) 436-4309
Atmel ®, AVR ® and AVR Studio ® are the registered trademarks of Atmel. ICE10 ™ is the trademark of
Atmel.
Windows ® 95/98/2000 and Windows NT ® are registered trademarks of Microsoft Corporation.
Terms and product names may be trademarks of others.
2468A–09/01/2M