Programming a mega168 using an arduino uno mega328

Hello,

Please, does anybody have an idea of how to use an arduino Uno 328 as an ISP to program a Mega 168 on a breadboard. I have done it with a ATTiny45 using this tutorial;

http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585

I believe it must be similar.

Thanks

The tutorial at http://arduino.cc/en/Tutorial/ArduinoToBreadboard should work equally well for programming your atmega168 on a breadboard, just specify the different processor when you select the target board. You can use the Uno to do the programming if you disable the auto-reset.

I am just trying to work the tutorial out. From the post I made: http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585 the onboard atmega328 is programmed to be an isp, then the avrtiny is connected to the arduino on a breadboard. Under boards I just select attiny45 w/ Arduino as ISP. Choose my program and it burns to the attiny. I cant quite understand how to do this from the tutorial you posted for the mega168. Can I do the same thing: program the atmega328 as an ISP, wire the mega168 up on a breadboard like they have shown, but I need the boards.txt file for a mega168 dont I? Do you have this and could post it for me? Like in the tutorial I posted, the image has a 10uF capacitor between reset and ground, can I just do this to overcome the problem you mentioned in your last reply? If I had the board.txt for a mega168 on a breadboard, I would have thought I could do it the same way?

buycris: I cant quite understand how to do this from the tutorial you posted for the mega168. Can I do the same thing: program the atmega328 as an ISP, wire the mega168 up on a breadboard like they have shown, but I need the boards.txt file for a mega168 dont I? Do you have this and could post it for me? Like in the tutorial I posted, the image has a 10uF capacitor between reset and ground, can I just do this to overcome the problem you mentioned in your last reply? If I had the board.txt for a mega168 on a breadboard, I would have thought I could do it the same way?

Yes, the capacitor disables the auto-reset. You can easily add new processors to the boards.txt file using a text editor. You may find that one of the existing entries (e.g. "Arduino NG or older w/ ATmega168") will suffice.

Thanks I will try that, how do you write the information for a chip to go in the boards.txt file? I tried editing an existing entry for the 168 but wasnt succesful, however I'll try your sugestion first.

So i wired it up (my mega168) to a breadboard, and according to the diagram on the link you posted (using the arduino as an isp), I stuck a led on pin 19 of the mega168 which is arduino digital pin 13. I programmed the arduino to be the isp, then tried to program the mega168 using the board spec NG arduino w/ mega168. the led flashes as it is being programmed, but i get an error: verification error, first mismatch at byte 0x0000 0x0c != 0x00 avrdude: verification error; content mismatch any ideas whats up?