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.

How to program a AVR (arduino) with another arduino

Step 4Using with avrdude

Using with avrdude
To use with avrdude (and all GUIs that use it) you have to select the 'avrisp' programmer. the safest bitrate is 19200.

To test your your new atmega168 from commandline try:
$ avrdude -p m168 -P /dev/ttyUSB0 -c avrisp -b 19200

/dev/USB0 is the port that arduino is connected to my linux box (your's may be com5). This can be checked in arduino IDE in Tools -> Serial Port.

You should get:
[kabturek@hal-9000 ~]# avrdude -p m168 -P /dev/ttyUSB0 -c avrisp -b 19200

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x1e9406

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


That means everything is ok.

If you get errors - check the last step.

« Previous StepDownload PDFView All StepsNext Step »
2 comments
Sep 18, 2010. 9:59 PMdustinandrews says:
I wanted to use this to upload to an ATMEGA168p from Windows 7.

Using a Pro Mini as the programmer and the Ardunio menu option to burn the bootloader I got an error.

avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.

I had to drop to a dos prompt and run the command by hand. I copied the hex file and conf file into the dir with avrdude to make things easy.

C:\>avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U flash:w:ATmegaBOOT_168_diecimila.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e940b
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_168_diecimila.hex"
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: writing flash (16294 bytes):

Writing | ################################################## | 100% 2.50s

avrdude: 16294 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_diecimila.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_diecimila.hex:
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_diecimila.hex contains 16294 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 22.43s

avrdude: verifying ...
avrdude: 16294 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

I still need to test if it worked properly since I only have the pro-mini and some loose 168p chips.

By the way, I omited the external oscilator. So it's not mandatory for these chips.
Sep 22, 2010. 6:58 PMdustinandrews says:
P.S. if you need to burn the fuses on an atmega128 and you are using and external resonator:

avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U lfuse:w:0xff:m -U hfuse:w:0xdd:m

If you don't burn any fuses your chip will run at 1mhz. You can tell because 1. The blink program will take 16 seconds to blink the light AND you can't program from the arduino IDE.

If you burn the wrong fuses, you can ruin your chip until you can get it into a high power (12v) programmer, so be sure before you burn fuses.
Sep 23, 2010. 10:51 PMdustinandrews says:
heh, still having problems. You can to burn the lock bits to keep from overwriting the bootload with the sketch. I haven't got that working yet... Moral of the story: atmega169p is $3.30, but problematic with Ardunio, just buy the pre-burned ones for $5.
Jul 9, 2010. 1:26 AMFast Eddy says:
I think I may be just being thick but ... I have two ATMEGA8-16PC chips that I want to put a bootloader on. I successfully execute this step (using "m8" instead of "m168") but how do I upload the bootloader correctly. I am confuse (as they say).

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!
9
Followers
2
Author:kabturek
if you can't open - you don't own it