3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Getting started with ubuntu and the AVR dragon

Step 6Writing the hex file

Writing the hex file
Remember the hex file made in step 2? now its time to transfer it to the microcontroller.To do this i'll be using avrdude.

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 StepDownload PDFView All StepsNext Step »
1 comment
Sep 24, 2008. 10:51 AMjonathanjo says:
Thanks so much for the -B 10 note: I had exactly this problem, and couldn't work out what was going wrong.

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.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
60
Followers
10
Author:}{itch