Arduino Bootloader: The Hardware
Arduino Bootloader: The Hardware
The story difference between an ATmega328 complete with the bootloader and one without is
about 1.50 UKP which, although not that great, it soon adds up once the Arduino bug bytes and
you start making your own Arduino clones.
The idea of burning the bootloader oneself using an Arduino as the programmer is a bit
dowting for fear of ending up with two non-working ATmega328s boot, thanks to the work of
others, it turns out to be relatively easy.
The Hardware
I recommend building a "bare-bones" Arduino on a breadboard on which to mount the "target"
ATmega328 (ie, the one about to have the bootloader burnt in). This makes it much easier to
deal with any issues about the auto-reset if an Arduino board is used to.
Besides an Arduino we're doing it to use the programmer and the ATmega328 that we're about
to do the program with the bootloader, we also need a handful of support components:
Amis-Ahoar
Luckily for me, someone and lot cleverer than I am is done with the work here. Bill Westfield
("WESTFW") has written an Arduino sketch which not only has all the code required to do the
burning, it contains text "Images" of a bootloader version he calls "Optiloader"-actually several
images for the various flavours of Atmel chips (328, 328-P, 168 and 8).
That make sure you get the latest versions, I'll simply post a link here: Bill Westfield's
Optiloader. Simply download optiloader. h andOptiloader. Ino as the ZIP file (or copy/paste
them from the listings into Notepad) and save them together in a folder (called Optiloader)
inside your Arduino Sketches folder.
Now, simply load the optiloader. Ino Sketch into your arduino go, upload it to your arduino
and then unplug the USB to power it down while you connect the Breadboard ATmega328 as
shown here:
Once Puść is connected up, re-insert the USB cable. This will reset the Arduino and the burning
process will must begin automatically. Wait until the TX/RX LEDs on the Arduino stop
flashing before doing any further.
And like that see confirmation that all is well so open the Arduino IDE Serial Monitor (at
19.200 baud). This will auto-reset the Arduino and burn the "target" ATmega328 again. You
groove see something like shown ok. You know what? Disconnect the USB cable to power
down the breadboard. Job done!
ATmega168/328p-arduino Pin Mapping
Note that this chart is for the DIP-package chip. The Arduino Mini is based upon a smaller
physical IC package that includes two extra ADC pins, which are not available in the DIP-
package Arduino implementation.