Construct your own cheap avr icsp programmer with usb power supply

Note: This example is based on parallel port, so if there is no parallel port available in your PC/Laptop then this method will not be useful.

In this post I will explain how I have constructed an AVR circuit with ISP programmer for ATMEL Atmega8 which requires a minimum of only four resistors (if status LEDs are not required), power supply and oscillator circuit.This method will be applicable for other ther AVR microcontrollers also. In this method we need only five lines for programming. This method is called as ISP or ICSP (In Circuit Serial Programming) four plus one line for ground is used. The four lines are used for
  1. MISO (Master In Slave Out)
  2. MOSI (Master Out Slave In)
  3. CLK (Clock)
  4. Reset
Now if we want we can add additional lines for status LEDs like busy, porgramming, ready, vreifying etc.

What makes this programmer so simple is the ISP featre of the AVR microcontroller and software used for programming. AVRDUDE is the most popular programmer software available. It supports lots of programmer hardwares available in the market. But the main advantage is that, we can can define a programmer in its configuration file. So if we connect wires differently also, we can create the programmer definition with the connection which we have done. This makes it easy to add status LEDs.


Programmer cicuit from example page
 You can find in the page "Make your own, ultra simple, universal AVR programmer !!" an example connection to start with, but in that example, PonyProg2000 is used with the programmer selection “Avr isp i/o”. But I prefer AVRDUDE because we can configure the connections. You can visit this page for example on how to use AVRDUDE with windows or linux. While wiring you can add an LEDs with transistor switches(if necessary) for the status LEDs.

Now inorder to configure the programmer for avrdude, open file avrdude.conf. In the header of the file, there will be format for how to define a programmer, which has lot of parameters, but we can define a simple programmer as below

  id     = "ANameForProgrammer";
  desc   = "Description about programmer";
  type   = par;
  vcc    = 2, 3, 4, 5;
  reset  = 7;
  sck    = 8;
  mosi   = 9;
  miso   = 10;
  errled = 1;
  rdyled = 14;
  pgmled = 16;
  vfyled = 17;

Here it is simple to understand, eg:- mosi is connected to 10th pin of parallel port and so on. Dont forget to update the fields according to the connection you have made. vcc=2,3,4,5 mentions that programmer uses those pins for powering the programmer circuit. But this will not be necessary if we are giving external power supply.

Power supply
One simple method for powersupply is to use the vcc option of the AVRDUDE mentioned above and and use the parallel port to power. This will be the cheapest option.

But I was working with a circuit wich was already powered. There is a project called as V-USB formally called as AVR-USB. This project is about adding USB support on AVR chips using firmware. In this page we can find a circuit diagram(also shown below) on how to connect the USB port to AVR.
Connection of AVR to USB port
This circuit will be applicable for other AVRs also visit V-USB website for more details.

Final board
Board with ISPand status LED connection

No comments :

Post a Comment