I read on this forum a few confused posts about using AVR Dragon as an external programmer with Arduino IDE and thought my experience may be useful to someone.
AVR Dragon can be used as an external programmer with Arduino IDE, e.g. to burn sketches to Arduino-compatible hardware without the bootloader. For example, I use it to upload my sketch to an ATMega8L controlling an audio amplifier based on TI's TAS5086 PWM processor. I use it under Mac OS X; I have heard, but not tested, that the same thing under Windows may be tricky because of USB driver incompatibility.
As expained in http://www.arduino.cc/en/Hacking/Programmer (http://www.arduino.cc/en/Hacking/Programmer), I add the following three lines to the programmers.txt:
[font=Courier]dragon.name=Atmel AVR Dragon in ISP mode
(after that, AVR Dragon appears in the list of programmers in the "Tools -> Burn Bootloader" menu), and either change the line
in the [font=Courier]preferences.txt[/font] (which must be edited when the IDE is not running, or it will be overwritten) to
to have Arduino IDE use AVR Dragon for all uploads, or add the line
to the appropriate section of [font=Courier]boards.txt[/font] to use AVR Dragon only if "Arduino Duemilanove or Nano w/ ATmega32" is selected.
Either way, when I connect my Arduino Duemilanove to the AVR Dragon with an ISP cable, Arduino IDE uploads sketches flawlessly.
For some reason, I cannot burn the bootloader in the same way. [font=Courier]avrdude[/font] sucessfully writes unlock bits with the following command:
[font=Courier]/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cdragon_isp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m[/font]
but the attempt to actually burn the bootloader fails:
[font=Courier]/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cdragon_isp -Pusb -Uflash:w:/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m
avrdude: Version 5.4-arduino, compiled on Oct 9 2007 at 11:20:31
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/*******/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : dragon_isp
avrdude: usbdev_open(): did not find any USB device "usb"[/font]
If I copy-paste that last command into the terminal, it works just fine. I'd be grateful is someone let me know how to make it work from within the IDE.
did you found the solution ?
I have the same problem directly programming with avrdude -p m328p -c dragon_isp -Pcom14
This sounds similar to the problem that occurs with the AVRISP mkII on Windows:
AVRDUDE resets the mkII between the fuse setting and burning the bootloader operations and doesn't delay long enough for the programmer to reinitialize after the reset.
Which version of AVRDUDE are you using? The version is shown in the console if you do an upload with File > Preferences > Show verbose output during > upload
(check). The mkII problem was solved for me by using AVRDUDE 6.0.1 included with Arduino AVR Boards 1.6.12 and newer.
Here's a relevant comment from @hansibull/MCUdude (https://github.com/MCUdude/MightyCore/pull/14#issuecomment-191285915):
I've been thinking about adding the AVR dragon as a programmer, but there's a bug in AVRdude thats resetting the Dragon right after the correct fuses have been burnt.