Arduino as ISP to program naked 328P?

OK I've got a few naked 328P's on the way that I want to use to get some of my UNOs back from other projects.

I want to use an UNO as an ISP to program them. I've read a bunch of webpages and tutorials and threads and I'm still confused. I think I understand how to burn the bootloader, but I'm not sure exactly which file is the right one to load onto the programming arduino if I want to do that from the IDE with arduino as ISP selected as the programmer.

And once I have the bootloader on there, how do I then upload the sketch? If I'm uploading the sketch via an arduino as ISP, do I really need to burn a bootloader on it? How would I go about changing fuse settings if I wanted to let one of these run off the internal 8MHz oscillator? I understand from the data sheet which fuses to set, but how do I actually make that happen?

Thanks in advance!

Delta_G:
...but I'm not sure exactly which file is the right one to load onto the programming arduino if I want to do that from the IDE with arduino as ISP selected as the programmer.

ArduinoISP.ino
...it's an example sketch that comes with the IDE

...includes a clock output so you can program a target configured to use an external clock but do not have an external clock connected

...ArduinoISP with a some nice goodies and two fewer bugs

...Nick Gammon has a ton of stuff for programming naked AVR processors

And once I have the bootloader on there, how do I then upload the sketch?

You can use an Arduino board as a USB-to-serial converter. Or you can buy a converter (I recall retrolefty and CrossRoads each recommending one from EBay for a few dollars).

If I'm uploading the sketch via an arduino as ISP, do I really need to burn a bootloader on it?

No. You can continue using Arduino-as-ISP to reprogram.

How would I go about changing fuse settings if I wanted to let one of these run off the internal 8MHz oscillator?

Somewhere I found a board definition for what you want. I can't find it right now. Basically, you add an entry to boards.txt.

I understand from the data sheet which fuses to set, but how do I actually make that happen?

The easiest way is to use an entry from boards.txt and execute Tools / Burn Bootloader from the IDE.

Hello there Delta_G,

The way I like doing it is burning the normal bootloader of your choice using the IDE, this way all the necessary fuses (default ones), will be set on the new chip so it can work as expected within Arduino. After that I use avrdude in command line to set individual fuses I want to change, like the internal 8MHz clock and so on.

If you are going to use Arduino as programmer too often I recommend getting a real programmer. Maybe it’s something im doing wrong but i find Arduino as programmer not much reliable. A great option is using USBASP, Arduino has support for it now and you can assemble it on a perfboard e.g., using few parts. At least USBASP never failed on me. http://www.fischl.de/usbasp/

Not really something you asked but what’s very useful to me also dealing with spare atmega’s is the TTL<->Serial interface. You plug that into some serial port (or use these USB-Serial adaptor cables), to upload sketches using serial. You can buy these or just have it on perfboard also. One I used without trouble http://www.uchobby.com/index.php/2007/06/11/ttl-to-rs232-adaptor-explained/

With a programmer you dont need the bootloader to upload sketches to the chip, just use the programmer. You will need the bottloader to be able to upload sketches using the serial port though.

Hope it helps