DDiiggiilleenntt AAVVRR PPrrooggrraammmmeerr™™
RReeffeerreennccee MMaannuuaal
1/31/2006 215 E Main Suite D | Pullman, WA 99163
Introduction
The Digilent AVR Programmer is a Microsoft
Windows
programming of Atmel AVR
It is specifically designed for programming
AVR devices on Digilent products, but is also a
general purpose AVR device programmer for
those AVR devices that support the serial insystem programming protocol.
The AVR Programmer supports the in-system
programming of Atmel AVR devices using a
programming cable connected to a 6-pin
programming connector on the target board.
All Digilent products with a AVR microcontroller
have a suitable connector.
Installation Information
The AVR Programmer is installed by running
the Windows installer application available for
download from the Digilent web site.
The installer will copy the application program
files, required device drivers, AVR Part
Description files, and documentation file to the
user’s computer.
The part description files are copied to the
folder: Program Files\Common
Files\Digilent\AvrParts.
Overview of AVR Microcontrollers
The Atmel AVR devices are 8-bit
microcontrollers with various I/O peripheral
functions and varying amounts of program and
data memory.
There are two different ways that AVR devices
can be programmed. High-voltage parallel
programming involves placing the AVR device
into a special device programmer. This can
only be done before the device is soldered to a
® application used for in-system
® microcontrollers.
l
®
www.digilentinc.com
(509) 334 6306 Voice and Fax
PC board. In-system programming uses a
serial interface and an in-system programming
protocol to program the devices in circuit. Any
AVR device can be programmed using the
parallel programming method. Most, but not all,
AVR devices also support the in-system
programming method. The AVR Programmer
only works with in-system programming.
There are four basic parts of an AVR device
that can be programmed: the program flash,
the data EEPROM, fuses, and lock bits.
The program flash holds program instructions
to be executed. The data EEPROM is nonvolatile memory that can be programmed via
the in-system programming protocol, and can
also be read or written by the program running
on the device. Program flash and data
EEPROM are configured using the Program
tab in the AVR Programmer.
Fuses and lock bits are used to select the
device’s operating modes. They are described
in more detail below.
Before programming the flash or EEPROM
memory, you must first erase the device. When
flash or EEPROM memory are erased, the bits
are set to the 1 state. When programming, 0
bits are programmed to 0 and 1 bits are left
unchanged. It is not possible to program a bit
from 0 to 1. This can only be accomplished by
erasing.
Flash and EEPROM memory can only be
erased and reprogrammed a limited number of
times before they wear out. Atmel rates the
memories in the AVR parts as having an
endurance of 10,000 erase/reprogram cycles.
Programming over already-programmed bits
will wear them out prematurely. The AVR
Programmer allows you to manually erase the
device and has an option to automatically
erase the device while programming.
®
Doc: 506-006 page 1 of 8
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Digilent AVR Programmer Reference Manual Digilent, Inc.
The file format used to hold the data for
programming the flash and EEPROM
memories is the Intel HEX file format. Intel
HEX is an industry standard file format used
for device programming files. Software
development tools designed to work with AVR
parts produce Intel HEX format files. There are
two files produced by the development tools.
One contains the data to be programmed into
the program flash memory, and the other
contains the data to be programmed into the
data EEPROM. When the AVR Programmer is
used to read back the contents of device
memory, an Intel HEX format file is generated.
Fuses are control bits that establish the basic
operating modes of the device. These control
such things as the clock source, enabling the
watchdog timer, setting compatibility modes,
and so on. The number and meaning of the
fuse bits vary between the different AVR
devices. Device fuses are configured using
the Fuses tab in the AVR Programmer.
Warning! Use caution when setting the clock
source in the fuses. The in-system
programming protocol uses the clock source
currently selected by the fuses to clock the
internal programming state machine. If the
fuses are set to select a non-functioning clock
source (such as the external crystal oscillator
when no crystal is provided on the board), the
in-system programming interface will stop
functioning. This will render the board/device
unusable and usually requires unsoldering the
device from the board and replacing it with a
new, un-programmed, device. AVR devices
come from the factory with the fuses set to use
an internal oscillator to guarantee that the insystem programming interface will work in all
circumstances.
The lock bits are used to lock different parts of
the device memory. This is done to prevent
reprogramming and/or reading back the
contents of memory to prevent the altering or
reverse engineering of a design. Once a lock
bit is set, that portion of the memory can’t be
reprogrammed or read back, depending on the
specific lock bit setting, until the entire device
is erased. The number and meaning of the lock
bits vary between different AVR devices. Lock
bits are configured using the Lock Bits tab in
the AVR Programmer.
Overview of the AVR Programmer
Communication
The AVR in-system programming protocol
uses the serial peripheral interface (SPI) for
the communications channel between the PC
and the device being programmed. Digilent
has two different programming cables that can
be used to provide the communications
interface: the Digilent Parallel JTAG cable and
the Digilent JTAG-USB cable.
Digilent programming cables conform to the
JTAG standard and therefore bear the JTAG
signal names instead of the SPI signal names.
Observe the following label conventions when
connecting the cable to a board:
TMS = SS or RST
TDI = MOSI
TDO = MISO
TCK = SCK
The parallel cable connects to the parallel
printer port on a PC and to the Digilent 6-pin
programming connector on the board being
programmed. The AVR Programmer
implements the SPI interface over the parallel
port. The GIVEIO.SYS device driver must be
installed to provide access to the parallel port.
GIVEIO.SYS is automatically installed when
the AVR programmer is installed.
The JTAG-USB cable connects a USB port on
the PC and the 6-pin connector on the board
being programmed. Firmware in the USB cable
provides the SPI implementation. The AVR
Programmer communicates with the USB
cable using the drivers provided for that cable
(specify the cable on the Programmer Settings
tab).
Device Parameters
The AVR Programmer is designed to work with
any AVR device that supports the in-system
programming protocol. In order to work with
www.digilentinc.com page 2 of 8
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Digilent AVR Programmer Reference Manual Digilent, Inc.
different devices, the programmer needs to
know certain properties of the device being
programmed. This information can be provided
in one of three ways: Digilent part description
files, Atmel part description files, or manual
settings.
Digilent part description files contain the
required device programming information, plus
additional information used to describe the
fuses and lock bits available. Digilent makes
available a part description file for the AVR
devices used on Digilent product boards.
These are installed when the AVR
Programmer is installed. Additional or updated
device files can be downloaded from the
Digilent web site. The Digilent AVR Part
Description File Specification document is also
available for download. It describes the syntax
conventions used in a Digilent part description
file so that you can create part description files.
See www.digilentinc.com
for more information.
Atmel part description files are installed when
the Atmel AVR Studio application is installed.
These files contain the required device
information and some of the additional
information that describes the fuses and lock
bits available in the device.
If no part description file is available for a
device, you can enter the required information
using the AVR Device Manual Settings fields
on the Device Settings tab. The information to
be entered in these fields can be found in the
Memory Programming section of the part data
sheet for the specific AVR device. AVR part
data sheets can be downloaded from Atmel at
www.atmel.com. When manual settings are
being used, the list boxes in the Fuses and
Lock Bits tabs will be empty. The fuses and
lock bits values must be entered as
hexadecimal values in the Value field.
Complete descriptions for the fuses and lock
bits for a device are found in the Memory
Programming section of the device data sheet.
The AVR Device drop-down list box on the
Program tab lists the available device files and
the manual settings option. Manual Settings is
listed first, followed by the available Digilent
part description files, and then the Atmel part
description files.
The part description files are listed by file name
in the drop-down list box. If two files having the
same name appear in the list, the first one
found will be used. Since the Digilent files are
looked for before the Atmel files, a Digilent file
will override an Atmel file having the same
name.
Signature Bytes
Each AVR device contains a device signature.
This is a three-byte sequence that identifies
the specific device. Before any programming
operation, the AVR programmer checks the
signature bytes read from the device with the
signature bytes for the selected device. If the
signatures don’t match no action is performed.
This prevents accidentally damaging a device
by programming it with data for a different part.
www.digilentinc.com page 3 of 8
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.