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…- An Arduino
- A proto shield kit
- 28-pin ZIF (zero-insertion force) socket (you can use a plain socket but ZIF is ideal)
- Some wire
- Blank ATmega328P
- Pin 1 to digital 10 - Blue Don't forget to bend the wire over underneath to connect to the ZIF socket pin when soldering!!!
- Pin 7 to 5V - Red
- Pin 8 to Ground - Black
- Pin 9 to digital 9 - Gray
- Pin 17 to digital 11 - Brown
- Pin 18 to digital 12 - Orange
- Pin 19 to digital 13 - Yellow
- Pin 20 to +5V - Red
- Pin 22 to Ground - Black
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.
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:avrdude -c arduino -p atmega328 -P COMPORT -b 19200 -U flash:w:filetoburn.hex
Text editor powered by tinymce.