Burn a bootloader to a blank atmega328/atmega328p with an Arduino UNO

Build your own optiLoader shield!
You cant use your Arduino UNO as programmer unless you modify it, but i didnt want to do that!
Some people had luck using a Resistor and Capacitor to disable the auto reset feature but it did not work for me (Using an Arduino UNO R2)
So i tried using a parallel port programmer but never got it to work. It seems easy, so if your interested go ahead and try it yourself, but be warned, could lead to frustration :)
Fortunately Bill Westfield wrote optiLoader!
The readme file doesent tell you how to connect the blank chip so i asumed that you need an oscillator and a pull up resistor and... well... it worked! (for me)
A nice thing about optiLoader is that is supports multiple chips, even atmega328 (non p) - the cheaper version whithout "pico power" features.
That way you dont have to edit your avrdude's config file, after bootloading a atmega328 the bootloader lies to avrdude telling that he is a atmega328p, keeping em quiet :)
You need:
- Working Arduino (with µC and Bootloader) - optiLoader will run on that one
- 16MHz oscillator
- 2 x 22pF ceramic capacitor
- 10KΩ resistor
Update:
If your chip comes straight out of the factory it 'should' be fused to work without an external clock - meaning that you don't need the clock and the two capacitors.
But if you allready burnt a bootloader (even if it was aborted) or your supplier modifed the fuses for some reason - you need them.
Breadboard setup looks like this:

Powering the circuit over pin 9 is questionable, but seems to work well with this setup (look at optiLoader source files for more info on this).
After downloading optiLoader go to the directory where your sketches reside and create a new directory named 'optiLoader' and put the files inside it.
Structure should look like this:
optiLoader/optiLoader.pde
optiLoader/optiLoader.h
If you use Arduino SDK 1.0 it will ask you if it should rename it to .ino -> Allow that.
Now upload optiLoader to your arduino and connect the serial monitor (with 19200 Baud) to see what is going on.
You dont even need the serial monitor, but thats the only way to get feedback on the process.
If you plan to make a shield out of this circuit you could learn from my mistakes:
Look at the main image on top of this page, i forgot to leave room to get to the reset button :)



Comments
Hi Flo,
This worked like a charm -
You have to get the folder
Hi! Excelent blog!
Great tutorial, thanks a lot!
Great post. Helped me get to
Hm, looks like I'm not so
Hi Flo,
Hi Flo,
Hi Flo, thanks for sharing
I am getting the following
Beware that not all suppliers
Sorry for the long delay,
Thanks a lot...it works in
Upadate went ok completed,
I've got a Uno R2 and I've
Check your wire going from
thank you. it's work 100% :)
For anyone else who has this
For those programming
Many thanks worked perfectly
Thanks for this, it worked
while burning the bootloader
HI,
I get this error:
Awesome site:)) I was
If this works i will be glad
Hi! just wanted to ask if i
Thx,
I would like to follow your
Wow, great guide, I all
Hi man,
Hi,
HI, Thanks for this tutorial!
Keep going
Hey Flo, thanks for sharing
Did you manage to solve this
Assume that you simply are
Hi there, congratulations!
Thank you! I bought a
Thank you thank you thank you
hi everyone, i have the
thanks a lot, it worked
Worked for me - I found I
I tried this without the
Hey I'm getting following