Go Down

Topic: Using blank ATMega 8 with UNO (Read 1 time) previous topic - next topic

stushev

Mar 15, 2011, 06:14 pm Last Edit: Mar 16, 2011, 04:09 pm by stushev Reason: 1
Hello,

I have an empty 168, without any bootloaders. I want to use it with Arduino UNO (in fact, I am going to put that 168 later to standalone circuit, but first I need to use it with uno - to program it).

I want to burn a bootloader into it. What do I have to do?
My friend has a uC programmer. I assume I should give him hex file (which one exactly), and fuses? (I'll be using ext.16MHz crystal)
Which one bootloader (optiboot-diecimilia or old one) would you recommend?

Thanks in advance

alparent

#1
Mar 15, 2011, 06:17 pm Last Edit: Mar 15, 2011, 06:23 pm by alparent Reason: 1

Ok let's just start over.

First you need a board with a working atmega.
Then there are 2 steps. 1- Put the boot loader on the chip (this might be done already) 2. Put the sketch on the chip.

To do the first part, load the Use Arduino as ISP sketch to the chip on the board.
Make sure you ave selected the right board and the right port.
Then connect you breadboard like this (bottom secion of this page) Circuit (targeting an AVR on a breadboard) http://arduino.cc/en/Tutorial/ArduinoISP
Like I said it only worked if I used an external clock. (I have the Uno board, with optiboot)

Then use the burn bootloader with arduino as ISP.

Now your new chip as a bootloader!

Then remove the chip from your board.

You could just pop the new chip on the board and program any sketch you would like on it.

But is you want leave the chip on the breadboard and load  a sketch on in.........do this.....

Disconnect wires to header pin 10,11,12,13 and connect pins rx and tx the the rx and tx pins on the atmega on the breadboard. Like this
http://arduino.cc/en/Tutorial/ArduinoToBreadboard  Uploading Using an Arduino Board

Then add a wire from the board socket pin 1 (reset) to the breadboard chip pin 1 (reset)

Then load the sketch you want to the chip on the breadboard.


Remember never to change the board selection............but like I said it only worked with an external clock.


Since your using a 168. After the arduino as ISP sketch is on your 328. Switch the board selection to somthing with a 168.

Better yet go to the optiboot page and dowload the optiboot for 168. Much faster the the old bootloader. (The 328 on the Uno uses a optiboot.

(The search tool is your friend, all these questions have been asked and answered before.)

If you need more help..........let us know!

stushev

As that page says,

Quote
NOTE: Currently, you cannot use an Arduino Uno as an ISP programmer because the optiboot bootloader does not support this sketch. A revision for this is in progress.


Do I understand correctly, that, from your experience, it is possible to use UNO as ISP?

alparent

That is my experience.

I've uploaded bootloaders and sketches on both blank atmega328 and atmega8.


stushev

Updated: I did not found atmega168 in my local store, so I purchased atmega 8.

I have done everything as it is told, tried both old and optiboot_atmega8 (http://arduino.cc/forum/index.php?topic=52873.0) bootloaders.

However, I get this:
Code: [Select]
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


(I did not forget to select Arduino optiboot8 in IDE.)

Please help me

alparent

I got that when I had bad connections to my breadboard.

stushev

#7
Mar 16, 2011, 04:26 pm Last Edit: Mar 16, 2011, 04:29 pm by stushev Reason: 1
I've checked it three times, and it is correct.

Did you add 10uF capacitor between RESET and GND to the main board? And what sketch did you use for Arduino ISP? Could you please share it?

alparent

No caps between RESET and GND.

And I used the Arduino as ISP sketch example included with the Arduino IDE 0022.

Can you take pictures of your setup?

njs552

Hi,
If you still have not figured this out, check this out: http://arduino.cc/en/Tutorial/ArduinoISP . I was able to program a ATMega8-16AU with a Uno Revision2 with the layout specified above.
njs552

Go Up