The following tutorial introduces programming of your AVR microcontroller using In System Programming (ISP). This programming technique allows you to program the eeprom and flash memories of your chip while in circuit. This removes the requirement of placing your chip in a dedicated programmer every time for programming.

You will need an AVR ISP compatible programmer. These are generally USB and can be bought from atmel and many other people. Here are some places were you can buy a ISP for Atmel microcontrollers:

In this tutorial, we're going to use an ATMega8 on a breadboard.

Parts:

  • ATMega8
  • 7805 Voltage Regulator
  • 2 x 10uF Electrolytic Capacitors
  • 4.7k ohm or similar resistor
Connect the reset pin (pin 1) to 5V through your resistor. Connect power and ground from your power source to the 5V regulator. This regulator generates a contant voltage even if the current draw varies (within limits). We suggest your wire 5V along your top rail and GND along your bottom rail. This makes it easier to get power to all your devices on your breadboard. Wire VCC (pin 7) to 5V and GND (pins 8 and 22) to GND.

-- Require image of breadboard --

Cut 6 short lengths (approx 100mm) of coloured hookup wire. Each of these represents one of the following control signals necessary to program the mega8.

  • MOSI
  • MISO
  • SCK
  • RESET
  • +5V
  • GND

Simply strip about 5mm of insulation off each wire and connect the respective pins of the Mega8 and the programmer.

You have now finished setting up the hardware reqired to run your ATmega8. It's as simple as that.

Some links to the software you can use for programming:
AVRDude is getting a little old and does not support all the new microcontrollers that Atmel has brought out. For programming new microcontroller I suggest using USBasp.