Step 6Writing the hex file
Avrdude is a fantastic bit of open source software that supports loads and loads of different AVR programmers.
Firstly connect your avr dragon to your computer via usb, then check one more time that all the isp connections are correct then plug your isp cable into the avr dragon board (checking lots and lots that its the right way around, labelling it in some way would probably be a good idea).
Now that everything is hooked up open up a terminal and type the following command:
sudo avrdude -p m8 -c dragon_isp -P usb -e -U flash:w:flash.hex
(n.b the sudo is required because you need root privileges to access the usb port)
Here's the breakdown of the options:
-p m8
tells avr dude it an atmega8 we are trying to program.
-c dragon_isp
tells it we are using the avr dragon and its isp programming mode
-P usb
tells it that the dragon is connected to usb (defaults to parallel port usually??)
-e
erases the microcontroller prior to putting the hex file on it.
-U flash:w:flash.hex
this is the meat and two veg (or qourn if your veggie) of the operation, it tells ' avrdude to write the hex file to the AVR's memory
note: if this fails and returns "invalid device signature" or something similar try the following:
sudo avrdude -p m8 -c dragon_isp -B 10 -P usb -e -U flash:w:flash.hex
the -B 10 tells the dragon to program it a bit slower, i had some issues with this.
| « Previous Step | Download PDFView All Steps | Next Step » |











































This was the error message -- though the device signature would come back differently each time:
avrdude: Device signature = 0x3f00ff
avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.
NB: the wrong signature would always be runs of 1s and 0s, never completely random.
-B 10 fixed it straightaway.
Thanks again.