In System Programming is well suited for programming devices soldered onto external target boards. This section explains how to connect the AVR Dragon to ISP program an external target. The ISP lines are equipped with level converters that automatically will level shift the AVR Dragon to the target board voltage.
It is recommended that a 6-pin header connector with 2.54mm (100 MIL) spacing is placed on the target board to allow easy access to the ISP programming interface. The following pinout should be used.
Note: When connecting the AVR Dragon to the target, connect MISO to MISO pin on the target device, MOSI to MOSI and so on.
Note: AVR Dragon must sense the target voltage at pin 2 on the ISP header in order to set up the level-converter. For on-board targets, the voltage must be supplied from pin 2,4,6 on the VCC header (5V) into pin 2 (VTG) on the ISP header. When using off-board targets there should be no connection between VCC header and pin 2 of the ISP header.
Connect the 6pin cable from the AVR Dragon to the external target as shown in these pictures:
debugWIRE OCD interface is also accessed through this ISP header.
See the AVR Studio user guide for information about using the "Programming Dialog" to program the target device.
AVR devices with JTAG interface also support programming through this interface. The connection for JTAG programming is the same as the JTAG debug interface. Please see section "Connecting to target through the JTAG Interface" for information how to connect the AVR Dragon to your external target board.
It is also possible to do JTAG Programming on a device placed on the Prototype Area of the AVR Dragon. Please see the "Device Connection Sheets" for information on how to connect the different AVR devices.
See the AVR Studio user guide for information about using the "Programming Dialog" to program the target device.
AVR devices with aWIRE interface also support programming through this interface. Please see section "Physical aWIRE Interface" for information how to connect the AVR Dragon to your external target board.
High pin count AVR devices support the full Parallel Programming (PP) interface. This interface offer high speed programming, and also support programming all fuse and lock bits in the AVR Device.
Important!
Extreme care should be taken if using PP mode to program a AVR device on an external target. The PP lines do not have level converters, so it is important that the target board then is powered by the AVR Dragon VCC header, and not using its own power supply. In addition the AVR Dragon will apply 12V to the reset pin, so it is important that the target board is designed to handle 12V on this line.
Note that the target voltage, i.e. the 5V from the VCC header must be applied to either pin 2 on the ISP header or pin 4 on the JTAG header. This because the AVR Dragon must read the target voltage.
To avoid damaging the Target Board, the AVR Dragon or both, it is recommended to only use PP mode on devices placed in the 28/40 pin DIP socket on the AVR Prototyp area on the AVR Dragon.
The HV_PROG header pinout is listed below. This is the standard pinout for about all AVR parts. However the pinout on the HV_PROG header are slightly different for some parts, these exceptions are listed further down in this page.
For ATtiny26/261/461/861 the HV_PROG header will have this pinout:
For ATtiny2313 the HV_PROG header will have this pinout:
Please see the "Device Connection Sheet" section for information on how to connect AVR Dragon for PP programming.
See the AVR Studio user guide for information about using the "Programming Dialog" to program the target device.
Low pin count AVR devices do not have enough IO pins to support the full Parallel Programming interface. These devices instead use HVSP programming, which is a serial version of the Parallel Programming interface.
Important!
Extreme care should be taken if using HVSP mode to program a AVR device on an external target. The HVSP lines do not have level converters, so it is important that the target board is powered by the AVR Dragon VCC header, and not using another power supply. In addition the AVR Dragon will apply 12V to the reset pin, so it is important that the target board is designed to handle 12V on this line.
Note that the target voltage, i.e. the 5V from the VCC header must be applied to either pin 2 on the ISP header or pin 4 on the JTAG header. This because the AVR Dragon must read the target voltage.
To avoid damaging the Target Board, the AVR Dragon or both, it is recommended to only use HVSP mode on devices placed in the 28/40 pin DIP socket on the AVR Prototyp area on the AVR Dragon.
The High Voltage Serial Programming (HVSP) interface is found on the HV_PROG header. Figure below shows the pinout of the HV_PROG header when used for HVSP for all parts except ATtiny24/44/84 :
The ATtiny24/44/84 uses separate pins for entering programming mode. See the pinout of the HV_PROG header when used for these parts below:
Please see the "Device Connection Sheet" section for information on how to connect AVR Dragon for HVSP programming for the different supported devices.
See the AVR Studio user guide for information about using the "Programming Dialog" to program the target device.
The DOS command line tool is the same as for the STK500 starter kit.
It is named "AVRDragon.exe" and allows simple batch files for automatic
programming. The program is located on the disk at:
[INSTALL PATH]\Atmel\AVR Tools\AVRDragon\
Typing "avrdragon -h" will display all the commands, options and the parts currently supported by the AVR Dragon.
Commands: -h, -? Print this help. -he Print exit codes. -e Erase device. -f <fusebytes> Write high/low fuse bytes. The LSB of fusebytes will be written to the low fuse byte, and the MSB will be written to the high fuse byte. -j <ID> Read JTAG ID string. If an optional ID is specified, the program will terminate if the read ID differs. -l <lockbyte> Set the lock byte to the specified value. -p[f|e|b] Program FLASH (-pf), EEPROM (-pe) or both (-pb) memories. Requires input files specified with the -if (FLASH) and/or -ie (EEPROM) options. -q Read fuse bytes. If the selected device has extended fuse, it will be also be read. -r[f|e|b] Read FLASH (-rf), EEPROM (-re) or both (-rb) memories. Requires output files specified with the -of (FLASH) and/or -oe (EEPROM) options. -s Read signature bytes. -v[f|e|b] Verify FLASH (-vf), EEPROM (-ve) or both (vb) memories. Requires input files specified with the -if (FLASH) and/or -ie (EEPROM) options. -y Read lock byte. -E <ext.fuse> Write extended fuse byte. -F <fusebytes> Verify high/low fuse bytes. The LSB of fusebytes will be compared to the low fuse byte, and the MSB will be compared to the high fuse byte. -L <lockbyte> Verify the lock byte. -G <ext.fuse> Verify the extended fuse byte against the given value. -O <address> Read oscillator calibration byte. Address is location of byte as specified in the device's data sheet. -S[f|e] <address> Write oscillator calibration byte read with -O or -Z to given location in FLASH (-Sf) or EEPROM (-Se). -W Disable debugWIRE interface, enabling ISP mode. Only available for debugWIRE devices. -Y Perform the oscillator calibration sequence. See appnote AVR053 for more information. -Z <address> Load value from address in EEPROM prior to erasing the device. This value can be written to FLASH or EEPROM again with the -S[f|e] command. Options: -ae <start>,<end> Specify address range for reading EEPROM memory. Default is entire memory. -af <start>,<end> Specify address range for reading FLASH memory. Default is entire memory. -d <device> [required] Specify the type of device. -ie <file> Specify input file for programming EEPROM memory. -if <file> Specify input file for programming FLASH memory. -m[i|j|p] Choose programming mode: ISP (-mi), parallel/high-voltage (-mp) or JTAG (-mj) (default). -oe <file> Specify output file for reading EEPROM memory. -of <file> Specify output file for reading FLASH memory. -z No progress indicator. Useful when redirecting output to file. -D <devsbefore,devsafter,bitsbefore,bitsafter> Set daisy chain settings. Only available in JTAG mode. -I <speed> Specify ISP frequency (Hz). Only available for ISP mode. -J <speed> Specify device speed (Hz). Only available for JTAG mode. -R Apply external reset while programming. Only available in JTAG mode. Example usage: avrdragon.exe -dATmega128 -e -pf -if -mj c:\tmp\test.hex