Part III – Making Programmer and Target.
Now you know what tools are required for MCU based development. And you are familiar with their uses. Now time to start some real development.To cover these parts you must have some basic knowledge and tools of electroniccircuit fabrication. So now, let us start with the most important tool the programmer.
Making a programmer.
There are many different types of programmers available on the net. The basic difference is their interface with the PC. Basically, there are three types of programmers.- Serial Port based
- Parallel Port based
- USB Port based.
Of these serial port based and parallel port based programmers are easy to make in minimal cost. However, the parallel port is little bulky as compared to serial port, I prefer serial one. One of the best programmers I have come across is PonyProg(http://www.lancos.com) Serial Device Programmer it is a package of simple and low cost programmer with easy to use GUI software. I have been using it from long time. So here I will teach you to make PonyProg device programmer.
| Note |
| As the serials and parallel ports are very old technologies they are fast disappearing from PCs. Most laptops are not having them and even desktops are dropping them. Therefore, its no surprise that your PC does not has serial ports. In this case, you have to use USB AVR programmer. See our shop http://shop.extremeelectronics.co.in it’s available for only Rs320 ($6.00). The future is USB. |
Things you will need.
| S .No |
Component |
Value |
Qty |
| 1 | Transistor | BC 547 | 1 |
| 2 | Zener Diodes | 5.1V | 2 |
| 3 | Resistor | 3.3K | 2 |
| 4 | Resistor | 10K | 1 |
| 5 | Resistor | 15K | 1 |
| 6 | DB9 Female connector | 1 | |
| 7 | 6 Pin Connector | 1 | |
| 8 | General purpose PCB, Wires | - |
DB9 connector is which connects to your PCs serial Port. Its looks like this.
![]() |
![]() |
A DB9 Connector. |
|
And the 6 Pin connector will make you programmer easy to connect/disconnect from the target board. Now assemble the programmer according to the schematic. Note that the pin numbers are marked on the DB9 connector itself.
|
|
Schematic (Download) |
|
|
My Prototype |
|
|
Finished with protective cover. |
- RESET(1)
- MOSI(2)
- MISO(3)
- SCK(4)
- GROUND(5)
- NOT-CONNECTED(6)
A basic target system
To design a basic target capable of ISP for AVR series of microcontrollers you need to have- Power supply for MCU.
- Crystal Oscillator (for CPU clock)(optional)
- Proper signal at Reset.
- ISP connector
- Aref For ADC.(optional)
Power Supply
Most of the MCUs available works off a 5v power supply except their low voltage versions. They need a clean and stable 5V power supply. This is achieved using the 7805 voltage regulator IC. Also the MCUs have a separate power supply for its analog parts to increase their accuracy and reduce noise. This must not be connected directly with the digital supply but connected via an LC network with the Vcc. You need not care this if you are not going to use the ADC(analog to digital converter) . You can conned AGND to GND and AVcc to Vcc.Crystal Oscillator
This is like a heart for MCU. It provides a beat that makes the MCU take steps. In AVR series of MCU each clock pulse executes one instruction (some instruction needs more than one clock cycle to execute) for accurate timing in you application you need a crystal oscillator. It provides a clean, voltage and temperature independent clock source. Generally,you can use crystals from 1 MHz to 16 MHz on most AVRs as required for your project. Actually the AVR has a internal oscillator also !!! that means this can be omitted. But one limitation is there the internal oscillator provides maximum frequency of 1 MHz if that’s enough for you, then its ok else you have to go for an external crystal of say 12Mhz or 16 Mhz.Reset Signal.
This signal must be high (5V) for normal operation and can be pulled low to reset the device. You can connect a switch to reset the device from it.ISP Connector
For flexibility you should have a nice connector for is so that you can connected/disconnect a programmer easily for programming. The MCU has 3 PINs for the downloading a program in its flash namely • MOSI – Master Out Slave In • MISO – Master In Slave Out • SCK – Serial Clock That’s for date transfer and you also need to connect RESET PIN of MCU to the ISP Connector so that programmer can put it in programming mode. One more pin should be their that is the common or ground of the two system. So all you need is a 5 PIN connector for programming. However, our AVR programmer has one additional PIN that is not connected to any thing so you need a 6 PIN connector in your target system.Aref
This pin must be provided with the reference voltage for the inbuilt Analog to digital convertor. Also this pin is suggest by Atmel to be decoupled with a 0.1uF capacitor. I am providing this in my schematic to be complete. You can omit this if you are not going to use ADC for now. More on these on tutorial on ADC. A basic target schematic
Basic Target for ATmega8 MCU.(Download) |
| S.No |
Name |
Component |
Value |
Qty |
| 1 | IC1 | Microcontroller ATmega8 | 1 | |
| 2 | IC2 | 7805 voltage regulator | 1 | |
| 3 | C1,C2 | Electrolytic Capacitors | 100uF | 1 |
| 4 | C6 | 1uf | 1 | |
| 5 | R1 | Resistor | 330 | 1 |
| 6 | R2 | 1K | 1 | |
| 7 | C3,C7,C8 | Ceramic Disk Type capacitor | 0.1uF | 3 |
| 8 | C4,C5 | 22pF | 2 | |
| 9 | LED1 | LED | 1 | |
| 10 | D1 | Diode | 1N4007 | 1 |
| 11 | Q1 | Crystal Oscillator | 12MHz | 1 |
| 12 | J1 | Power Jack Connector | 1 | |
| 13 | 6 PIN Connector | 1 | ||
| 14 | General Purpose PCBs, wire etc |
You can make the above in general purpose PCBs (Vero board) or in a Breadboard. After making it, double check the connections. Use a socket for the MCU so that it can be easily removable. Then check the voltage levels at the supply pins in the socket with multi-meter. It should be very close to 5 volts.
See Also
Download PDF version| Get Adobe ReaderFree !!!
| Whats next |
| Now you have the basic hardware tools in the next part we will be downloading and installing software tools.WinAVR – A free C compiler for AVRsAVR Studio – The IDE for AVRs from there manufacturer. This will be our front-end for the above compilerPonyprog – A free serial device programmer. |







[...] let’s do it! I have described the basic connections required by any AVR MCU in Part III of my AVR tutorial series so I am jumping right to the [...]
November 3rd, 2008 at 7:08 pmThank you for ur simple circuit solution. I will try out then come back to you.
January 13th, 2009 at 2:25 pmThanks K.Asokan
January 13th, 2009 at 5:00 pm[...] can program the chip using this simple avr programmer or buy a USB Programmer. addthis_url = [...]
February 8th, 2009 at 11:15 amIt’s the first time I commented here and I must say that you provide genuine, and quality information for bloggers! Great job.
March 14th, 2009 at 6:09 pmp.s. You have an awesome template for your blog. Where have you got it from?
Do you guys have a recommendation section, i’d like to suggest some stuff
March 19th, 2009 at 1:15 am@Lorie,
Sure you can mail me any recommendations
March 19th, 2009 at 8:24 amavinash@eXtremeElectronics.co.in
Hi Avinash,
I tried above serial programmer but it not work properly with pony prog.
I want to use this programmer with CodeVision AVR or AVRStudio for direct programming with these IDE what settings required for that.
Good Work,
May 2nd, 2009 at 4:02 pmWaiting for new tutorials,
Kapil
[...] For complete info check out the webpage:AVR Serial programmer from Extremeelectronics.co.in [...]
May 13th, 2009 at 6:00 amhi avinash
May 17th, 2009 at 2:06 pmdoes it work with all the avr like atmega16 , atmega32 ?
YES it works with popular AVRs like ATmega16 , ATmega32 and a dozen others too !!!
May 17th, 2009 at 3:37 pmhi avinash
May 17th, 2009 at 7:47 pmwhen i use it with ponyprog , it is not passing probe test in interface setup
avinash actually i am completely new to this topic that’s why i am getting a bit confused. i have following question for you to answer.
what is an adapter?
in pony prog site they gave different kinds of adpter for different kind of ics of atmel
which site should i visit so that i can learn about these things from scratch?
June 5th, 2009 at 2:55 amplz reply soon. soon for the big blog:)
Dear,
I’ve found from another reference, that ISP for ATMEGA series is not working with MOSI MISO, but will working by using Rx Tx pin (PE0 and PE1 on ATMEGA128).
So what is the solution for creating the ISP schematic?
Thanks.
June 7th, 2009 at 8:51 amhi avinash,
great tutorials.. very resourceful.
i used the serial isp, avrstudio and ponyprog as indicated by you for serial programming. Moreover i used a usb to serial converter for serial programming from the usb port of my laptop.
The codes are burnt successfully but the verification of the code done by ponyprog while writing takes about an hour to complete..
is this normal?
July 1st, 2009 at 1:44 pmif not then can you suggest what might be the problem?
please help..
A very common problem. USB TO SERIAL CONVERTERS CANNOT BE USED WITH THESE TYPE OF PROGRAMMERS !!! SORRY
Get a direct USB Burner from here
http://shop.extremeelectronics.co.in/product_info.php?cPath=21&products_id=28
We also sell the USB to serial convertors here and WE CLEARLY MENTION THAT IT WON’T BE USED THAT WAY !!!
July 2nd, 2009 at 11:24 amhttp://shop.extremeelectronics.co.in/product_info.php?cPath=26&products_id=34
Hi ! avinash, thanks for excellent tutorials. i am using ATMEGA32 and ATMEGA8535 microcontroller.
presently i use internal 1MHz clock , as it is factory preset, but i want to use 12 MHZ external Crystal, what is necessary settings in ponyprog.
I have 3 new ATMEGA32 and due to some wrong settings they are not working how can i use them again.
Please reply me. Waiting for your reply.
July 6th, 2009 at 2:15 pmthank you.
Hi avinash
today i done same thing with ATMega8535 when i accessing the port B for LED and then connected with LED ant programmed with PONyprog the suddenly all led’s glow then error displayed in ponyprog software “device missing or unknown device(-24)”. please this is my fourth Microcontroller.
how can i make them usable.
thanks in advance.
waiting for your reply.
July 8th, 2009 at 1:46 pm@kapil see the forum.
July 9th, 2009 at 12:11 pm[...] Part III – Making Programmer and Target. | eXtreme Electronics 14 Mar 2008 … Of these serial port based and parallel port based programmers are …. For complete info check out the webpage:AVR Serial programmer from … extremeelectronics.co.in/avr…/part-iii-making-programmer-and-target/ – [...]
July 10th, 2009 at 2:03 amI have tried Parallel Port AVR programmer but I failed. I would ask that ir really works? Don’t mean it any other way. I want to know it for my self esteem.
July 10th, 2009 at 5:01 pmhey im going to build this but I have seen references of this same schematic but without a transistor, I would like to know if its absolutely necessary want to program a atmega8
July 16th, 2009 at 2:59 ami tried avr insystem programmer
July 28th, 2009 at 4:06 pmi using the following config
atmega8, 12 Mhz crystal osc,
its always giving “device missing -24 ” error
were could be the problem. plz reply
i’m trying to connect my progammer with ponyprog, but it doesn’t work…
i made a PCB, it is on this link – http://img43.imageshack.us/img43/2571/plocica.jpg
Can U please tell me if I made any mistake or what, because it doesn’t work…
P.S.
July 31st, 2009 at 11:15 pmDo I have to make ” A basic target system” and connect it to be able to program or I can do that only with this programmer????
Can you please tell me what is wrong with my programmer, because it won’t work…
There is picture, and please tell me if I did something wrong in PCB or what…
Please…
P.S.
August 1st, 2009 at 4:38 pmDo I need to have DEVBoard to be able to program Atmega8 or just having programmer is enogh…
@Cicak
i’m trying to connect my progammer with ponyprog, but it doesn’t work… [ clarify "connect" what do u mean by it]
Can U please tell me if I made any mistake or what, because it doesn’t work…
P.S.
August 2nd, 2009 at 12:15 pmDo I have to make ” A basic target system” and connect it to be able to program or I can do that only with this programmer????
[How Can u program ONLY with this Programmer ???]
“How Can u program ONLY with this Programmer ???”
Well, I’m new in programming Atmel, I used to program PIC microcontrollers, and for PIC I found few JDM programmers that are very simple, so I thought that this is similar but just for atmel…
I didn’t know that I have to make devboard also and connect it with programmer to be able to program atmega8…
August 2nd, 2009 at 9:20 pmCan You please send Your PCB layout of devboard to email, so I can make one at home…
August 2nd, 2009 at 9:22 pmCan I connect a serial programmer to USB port using USB to serial converter
September 15th, 2009 at 11:06 pmI have made this one to program an ATMEGA8L. Using ponyprog read operation is successfully done.But when I tried to write, program is verified after writing and at last “Write failed” is shown. then I have read it again but it shown 00 as a hole. Also the read write operation is very slow.can u help me to make a successful and faster read write operation?
October 3rd, 2009 at 10:02 amDoes this is the exact Programmer found in the shop of extreme electronics.
November 11th, 2009 at 3:46 pmCan I monitor clock frequency at pins 9 or 10 of ATMEGA8?.
February 9th, 2010 at 11:28 amI have tried to probe with a osciloscope but could not see ant trace. How to find that The chip is runnung at the crystal frequency?
Hello Avinash,
Thanks for the informative tutorials. They should be really helpful for any newbie.
However, In this Serial programmer circuit, I think there should be a connection form the +5V supply of the uC to the collector of the BC547.
please refer to this circuit: http://electronics-diy.com/avr_programmer.php
Hope this helps..
In appreciation
February 15th, 2010 at 11:08 amBiswarup Mukherjee