The University of Queensland Homepage
School of ITEE ITEE Main Website

 Programming an Atmel AVR Microcontroller using In System Programming ISP

This short tutorial will show you how to setup a breadboard with an Atmel AVR microcontroller to be programmed using In System Programming (ISP). This allows you to program and re-program your chip whilst in your own circuit, without the need to be constantly removing it and placing it in a dedicated programmer.

You will need an ISP compatible programmer. These typically plug into the parallel port of your computer and have a 10 Pin IDC connector like the one shown below.

isp pinout

In this example, I'm using a ATMega8 on a breadboard.

Parts:

  • ATMega8
  • 8MHz crystal
  • 2 x 22pF Capacitors
  • 7805 Voltage Regulator
  • 2 x 10uF Electrolytic Capacitors
Connect the crystal to pins XTAL1 and XTAL2 (pins 9 and 10). Place the 22pF capacitors between the crystal pins and ground. Connect the reset pin (pin 1) to 5V through a resistor (1k ohm or something similar). Connect power and ground up respectively I am using a 9V source, regulated down to 5V for the microcontroller and can be seen on the left hand side of the breadboard. A simple powerpack (wall wart) plugs into mains.   I have 5V running across the top rail and GND along the bottom.  Wire Vcc (pin 7) to 5V and GND (pins 8 and 22) to GND.

breadboard

The pinout of the majority of atmel programmers is exactly the same and is can be seen below. Take note of the the location of the polarising pin. We need to connect this programmer to our breadboard.  My programming header is simply 2 rows of 5 pin 0.1" spacing headers I had lying around.

isp_2isp_1


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.

ITEE has a great tutorial to get your software up and running
http://www.itee.uq.edu.au/~cse/_atmel/Atmel_AVR_Resources/

Some more tutorials on how to setup your software
http://homepage.sunrise.ch/mysunrise/pfleury/avr-devtools.html
http://www.prioria.com/docs/PonyProg2000Tutorial.rtf
http://www.avrfreaks.net/Tools/showtools.php?ToolID=376


DK 19/08/04