Knowledge Base‎ > ‎General Gyaan‎ > ‎Tutorials‎ > ‎

Making your own AVR ATMEGA programmer

posted Sep 17, 2016, 6:57 AM by Rohit Bhaskar
Having worked on a parallel port bot before,I wanted to move on to something more complicated. Making intelligent bots,that work on only sensors,somehow didn't appeal to me and I wanted software to play some role on it...So I decided to work on a micro-controller project. 

Well,for programming a micro-controller,I need a programmer : Hardware that will interface the chip with the computer. I bought an AVR ATMEGA32L chip, as it seemed enough for my foreseeable projects. I browsed the web for a programmer.Lots of links are available with tons of information on making as well buying one. Well, I asked a friend and he told me that it was possible to make one and that it would also be more convenient to just buy it,as it was pretty cheap. However, being in the electronics field, I decided to make one myself, just to learn how things work(which I would never have bothered to do otherwise). Well, the experience has been great and have had moods ranging from puzzled to pure frustrated !!

 After almost a week of 3 hours daily and almost an entire weekend,I finally managed to piece everything together...It necessarily doesn't take this long, I just spent lots of time planning the layout..which eventually got messy anyways... Its nothing more than assembling a circuit on a General Purpose PCB,which requires basic soldering and planning skills.  

Click the image for a larger view 

Here's the power circuit :

  
(Click the image for a larger view)

Here's how to go about making the programmer : 

1. Get a mount for your chip. That way,the chip can be plugged in or removed any time, improving portability...Beats soldering the chip directly... 
2. Get safety resistors for all pins going to the parallel port..They limit the current and protect the parallel port from blowing up 
3. Get a diode (I couldn't because I have fixed polaritites..) to prevent everything from blowing up in case you connect the power cable wrong 
4. Get LED's before the regulator and after the regulator..It goes a long way in troubleshooting...Has saved me a lot of frustration 
5. Get a switch for the power supply...This will save you the trouble of removing the power plug every now and then 
6. Use a LED for the RESET port....This will tell you when a RESET has been applied. 
7. The capacitors in parallel with the voltage regulator are optional..generally to be used if dealing with radio circuits to reduce noise and stabilise voltage... 
8.The external clock is optional and used to increase the speed. It won't be used until you make some settings in the software,so you might as well put it on your board and keep for future use.. 

The connection between the parallel port pins and the pins of the ATMEGA32L are as follows : 
Pin 7 ------------------> ~RESET (Reset Bar) 
Pin 8 ------------------> SCK 
Pin 9 ------------------> MOSI 
Pin 10 -----------------> MISO 
Pin 19 -----------------> GROUND 

Here's how my programmer looks 

 

Here's one with the power on :

 

And one with the reset switch pressed :

 

Tips while soldering: 
1. Use solder wisely. You don't want to make unwanted connections just because you used too much solder.. 
2. The solder should not only be adequate, it should also hold the component in place.I had two such problems,where the switch and a resistor were soldered,but not held in place, due to which there were loose connections leading to power problems.This is extremely dangerous,as you wouldn't want power going off while you are programming it... 
3. Tap your circuit vigorously and also wave it in the air vigorously,while the LEDs are glowing. Also the PCBs are slightly flexible,so try bending them and see if the LEDs go off...This will help you detect loose connections. 
4. I also had an issue with the LED that comes before the voltage regulator. Even though I supplied more than 12V from the eliminator, most of the voltage dropped across the resistor connected with the LED and so the regulator did not get the needed supply and the chip did not work. If this happens, you will get a "AVR Device not responding" error when you try to program it . If so,remove the LED and resistor. They are supposed to be indicators, but there's no point in keeping them if they only spoil the fun. 

This programmer can be used with the ATMEGA16,ATMEGA32 and the ATMEGA32L
 Hope you found this easy to understand and fun.. 

If you have any questions or suggestions, please comment



Contributed by :
Ankit Daftery
ankitdaf [at] gmail [dot] com
Comments