ArduinoISP

Introduction

A lot of people start learning about microcontrollers with an Arduino but then want to build their own projects without having to sacrifice their dev board. Or maybe they want to make their own Arduino variant, that is compatible with the IDE. Either way, a common problem is how to burn the bootloader onto the fresh AVR chip. Since AVRs come blank, they need to be set up to be Arduino IDE compatible but to do that you need an AVR programmer (like the USBtinyISP).

The good news is that you can burn bootloader using your existing Arduino with only a little bit of work. There's even a minitutorial on the arduino.cc site.

This tutorial is an extention of that tutorial. First we'll show how you can make a permanent bootloader-burner by soldering a 28-pin ZIF socket to a proto shield and use the PWM output line of the Arduino to generate a clock. This will let you 'rescue' many chips that have been set to the wrong type of oscillator, or change ones that are set from external oscillator (most Arduino bootloaders) to internal (such as the lilypad).

Parts

You will need…If you bought the kit from Adafruit, you'll have an extra few items such as a Piezo beeper, LEDs, buttons, etc. that you can use for the Standalone version of this project, just ignore them for now!

Assemble

First up, place the ZIF socket on the proto shield like so:

learn_arduino_zifplace.jpg

Solder all 28 pins for a solid connection!

learn_arduino_zifsolder.jpg

Solder the following wires to the ZIF socket

learn_arduino_ispwiring.jpg

Follow the protoshield tutorial to solder in the Red LED into LED1 position, Green LED into LED2 position. Also solder in the two 1.0K resistors next to the LEDs. We'll use the LEDs as indicators. Then solder a wire from the LED2 breakout (white) to analog 0 and a wire from LED1 breakout (white) to digital 8.

learn_arduino_extras.jpg

Finally, you'll need to solder on the header to allow the shield to be placed on, break the 0.1" male header and place it into the Arduino sockets. Then place the shield above on top to solder it in place.

learn_arduino_diecheader.jpg

Load the Code

Time to load the sketch! Grab the code from our Github repository and paste it into a new sketch. Then upload it to the Arduino.
We have a report that this procedure does not work with Arduino 1.5.2. Use the latest mainstream Arduino release instead!
Plug the shield on top, lift the latch, pop in the chip and then lower the latch. Make sure the chip orientation is like so (so with the lever on the left side you can read the text):

learn_arduino_extras.jpg

With the USB cable still plugged in (and the same Serial port selected as before) Select Tools→Burn Bootloader→w/Arduino as ISP

learn_arduino_burnbootloader.gif

On newer versions of the Arduino IDE, select Arduino as ISP from the Tools→Programmer menu, then select Burn Bootloader from the Tools menu.

learn_arduino_Arduino_ISP_menu.png

The Green LED will be on during the programming, when its done you'll see this message and the LED will turn off.

learn_arduino_done.gif

Thats it! Don't forget, you can burn a few different kinds of bootloaders, such as Uno, Duemilanove, Lilypad so depending on your situation you may want to use one over the other.

Bonus! Using with AVRdude

You can use ArduinoISP from the command line very easily, with AVRdude which is the standard program used to program AVRs by running:
Copy Code
here
  1. avrdude -c arduino -p atmega328 -P COMPORT -b 19200 -U flash:w:filetoburn.hex
Instead of atmega328 you can also program atmega8 atmega88 atmega48 atmega168, etc.
Last updated on 2014-05-22 at 04.44.09 PM Published on 2013-01-12 at 10.00.13 PM