This example shows how to program an ATmega micro-controller using only an Arduino.

If you have a project or part of it that uses an AVR and you just want to program it this is a very easy way on doing so. The avrdude program can upload instructions into many types of AVRs however in this case since we are using the Arduino IDE in order to compile the code we are limited to the types of AVRs that the Arduino IDE supports.

In this example I used an ATmega8, but you can use any Atmel AVR that is supported by the Arduino IDE. The basic circuit configuration in order to communicate with the ATmega can be found in the Arduino community forums, you can find a link to download the code snippet I used in the video further down.

NOTE: If you didnt previously set the fusebits on the AVR to use an external crystal or if this is a brand new AVR you dont have to connect the crystal oscillator with the two capacitors. If you want to use an external oscillator with your AVR then you need to connect the crystal with the two capacitors and Click Here to watch how to set the fusebits in the same method.

circ_atmega_stup.PNG

Components list:

1 x Arduino Board

1 x ATmega IC1 (In this example an ATmega8 was used) (Datasheet: Download)

1 x 1KΩ Resistor R1

1 x 330Ω Resistor R2

2 x 22pF Capacitor C1,C2

1 x 16Mhz Crystal X

1 x Button S1

1 x LED D1

 

Source Code:

Arduino source: Download

Other Resources:

avrdude: Download

(If once downloaded the avrdude program informs you about a missing file called libusb0.dll you can find this file in the Arduino IDE installation folder and copy it into the avrdude folder)

 

Video demonstration:

 

Breadboard layout: bb_atmega_stup.png