Using Arduino Uno to install bootloader on an Atmega168

Hi I have read this thread and it works perfectly for the atmega328.

now i wanted to try the same with an atmega168, but it is not working.
what is the problem?

(deleted)

OK,
I attached a pic of how i connected everything.
I can upload the programmer, but when I open the serial monitor it stops as you can see in this picture.

(deleted)

I missed the power supply of 5V and GND :roll_eyes: :roll_eyes:

shame on me.

Now it is uploading the optiboot_atmega168.hex

Now when I put in the Atmega168 on my Uno Board instead of the 328 and I want to upload a sketch I get this error

sorry sorry sorry.

I just realized, that it didnt upload the bootloader onto the atmega168.
I just tried to run the "Board detector" and it doesnt show the Device :frowning:

Ok i just want to let you know what i want to do.

I want to use the atmega168 with an external 16mhz oscillator and then run the adafruit test file

Well, signature for Atmega168 is allright.

avrdude: Expected signature for ATMEGA168 is 1E 94 06

And Atmega168 default fuses are lfuse:0x 62, hfuse 0xdf, efuse: 0xf9. (default is running 1MhZ internal).
Your chip is allright.

Seems like your uploader code doesn't have support for Atmega168. If I were you, I would just upload as the classic Arduino way, select board "Diecimilla with Atmega168 or 328", select "Arduino as ISP" as progammer, and "burn bootloader", it will set your Atmega to 16Mhz with cristal.

OK,
I uploaded the Arduino ISP from the examples to my atmega328 on my Arduino Uno board.
then I wired everything like this.

I selected Arduino as ISP. But when I am trying to install the bootloader I get this error.
avrdude: stk500_getsync(): not in sync: resp=0x00

There must be a capacitor on your Arduino UNO when using as ISP. Add 10uF cap between reset and gnd.

mart256:
There must be a capacitor on your Arduino UNO when using as ISP. Add 10uF cap between reset and gnd.

ok I added the 10uF cap to my UNO board.

and now when I use Tools-> Board -> "Arduino UNO" and Burn the Bootloader I get this error

avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.

If I choose: Tools -> Board -> "arduino Diecimila Duemilanove w/ Atmega168"
It uploads the Bootloader.

But if I now remove the Atmega168 from the breadboard and put it in my Arduino UNO board and select AVRISP mkII and Board Arduino UNO and I try to upload a sketch i get this error:

avrdude: stk500_getsync(): not in sync: resp=0x00

EDIT:

OK I got it working.

  • Upload the "Arduino ISP" sketch (Folder: Expamples) to your UNO Board
  • Connect everything like this and add an 10uF capacitor between GND and RESET on you UNO Board
    http://arduino.cc/en/uploads/Tutorial/BreadboardAVR.png
  • Set Tools -> Board -> "arduino Diecimila Duemilanove w/ Atmega168"
  • Set Tools -> Programmer -> "Arduino as ISP"
  • Burn the Bootloader: Tools -> "Burn Bootloader"
  • Upload your sketch by CTRL + SHIFT + U

(deleted)

The board you choose depends on the bootloader you have on the microcontroller. If you have Arduino UNO board with Atmega168, select "arduino diecimilla with 168" and not Uno, because the last is for Atmega328.