Friday, April 29, 2011

AVR Serial Port Programmer

This simple COM PORT based  AVR atmega Programmer will allow you to painlessly transfer hex programs to most ATMEL AVR microcontrollers
without sacrificing your budget and time. It is more reliable than most other simple AVR programmers available out

there and can be built in very short amount of time.

AVR programmer consists of in-circuit serial programmer (dongle) and small pcb with a DIP socket where you can fit
your microcontroller and have it quickly programmed.

You may also use this programmer as a stand alone in-circuit serial programmer that can be used to conveniently
program AVR microcontrollers without removing them from the target circuit.

Entire AVR programmer has been build with using common parts and fits in the case of the serial connector. The socket pcb has been created to fit a 28-DIP AVR ATmega8 microcontroller, but you can build a socket pcb for any other AVR microcontroller out there. This AVR programmer is compatible with a popular PonyProg software that shows you a status bar of the programming progress.

AVR In-Circuit Serial Programmer Schematic

Ensures that the chip is receiving exactly +5V voltage it ensures error free programming.

+5V voltage supply for AVR chip may be provided from external power supply or even better - directly from USB

Pony Prog :The Programming software

To be able to send hex file from your computer to AVR microcontroller you will need to download and install PonyProg2000. After the installation, the first thing you will need to do is configure PonyProg to work with our AVR Programmer. To do this go to "Setup" menu and select "Interface Setup". The following window will be shown and highlighted areas show you exactly which options should be selected.

In the next step select "AVR micro" and your microcontroller type that you will be programming (ex. ATmega8

At this point PonyProg configuration is complete and we can open hex program with which AVR microcontroller will be flashed. Go to "File" menu, select "Open Program (FLASH) File ...", and point to the hex file to open it up. You should see hex numbers as shown on the screen below. If you haven't connected AVR Programmer dongle to your computer's serial port yet, then now is the time. Make sure that AVR Programmer is physically connected to your AVR microcontroller through Socket PCB or through ICSP 6-PIN connector. Finally click on the highlighted icon "Write Program Memory (FLASH)", or go to "Command" menu and select "Write Program (FLASH)".

!! IF your Flash(.hex) file have special configuration bits Then you have to configure those bits manually.

Click on "Yes" button to confirm the programming.
Now sit tight, relax and watch the programming progress on the status bar. PonyProg will program AVR microcontroller and verify if the hex file was transferred without any errors. For your information this process shouldn't really take more than 10 to 30 seconds. This depends on the size of the program that you're trying to flash.

After programming is completed "Write successful" window will be shown letting you know that AVR microcontroller has been programmed, and is now ready to be used.

Programming The Security and Configration Fuse bit (if needed)

First click on the sercurity and configration button in the tool bar,  a dilog box will apper as shown in the image blow.

To read the current security bit from the devive please click Read button in the securit and configration bits dialog box

now you are ready to change the configration bits
To caclulate these ceck box values accoring to your needs or to claculte by use hfuse and lfuse

just check and uncheck the boxes accoring to your setting and click write button.

now you are ready to go

If somebody need more help then please make a comment

1. which zener diode should we choose to pull down down the signal level on MOSI and SCLK ...i think zener may hinder the fast switching of signals on sclk and mosi lines..does that happen

2. Hi!

I found this post really useful for beginners and would like to advise them that this programmer might have problems if used with a USB to serial converter. I tried it a while ago on my laptop which does not have a serial port. Consider buying a PCMCIA to serial adapter for a laptop, commonly available at a reasonable cost at computer stores. It works with it with no problems like decreased speed (usually programs in around 1 minute).

Joel

1. Can you please tell me why this wont work with a USB to SERIAL cable.
I built this circuit and I tried to brun my ATMEGA32 but it does not work. The pony prog tries to write. I dont see the status bar moving forward and after some 3-4 minutes it shifts to verifying and then no progress further. My laptop does not have a serial port hence i use a USB to SERIAL cable. I can program my 8051 with the same cable. The cable works fine.

2. Hi if you want a programmer with USB support then. Why didn't you use my USBasp programmer and I also have a special USBasp programmer which support 80515 too

check this link for USB avr and 8051 programmer

http://www.circuitvalley.com/2011/06/usb-8051-avr-microcontroller-programmer.html

3. This programmer will work only with avr mcu and. Cant't program 8051

4. The reason why most programmers (AVR or PIC) will not work with a USB serial port is that a PC serial port runs at 12 to 15V and a USB serial cable runs at 3 to 5 volts.

Also these programmers typically source all their power from the serial port which has enough to do the job. USB to Serial cables run at much lower voltages and are not designed to handle something pulling on the current.

3. Hi Joel

you are absolutely correct,

this programmer will not work with a usb to serial port converter..

i will soon post a usb based AVR & 8051 programmer

1. Hi Gaurav,

Can you please tell me why this wont work with a USB to SERIAL cable.
I built this circuit and I tried to brun my ATMEGA32. But my laptop does not have a serial port hence i use a USB to SERIAL cable. I can program my 8051 with the same cable. The cable works fine.

4. very nice.
can i use this schematic for atmega2560?

5. hi vikram

you can use this schematic for atmega2560
if there is any problem just make a comment

keep visiting my blog for more microcontroller poject soon i will post more than 50

6. I made programer but PonyProg is not recognizing it. Im getting error Device is missing or unknown device -24. I think something is wrong with AVR Socket PCB i checked 4Mhz quartz with scope and its not oscillating.
Maybe you got some ideas what to tray to solve this problem ?

7. hi Kristijan

The error you are getting is really common, i know may guys to face this due the reasons blow

i first recommond you to check all the connection properly,lot of people get this problem due to lose soldering

after checking the soldering connection connect the programmmer to com port and
do i/o setting as per the imge shown
then click on the probe in i/o setting dialog box (without connecting the target microcontroller)
if probe retrun with passed then it's fine
but if probe result "test failed"
then there is a problem with the programmer harware it self

now if all the above is okey but you still face the problem
check the vlotage level at the programmer
(this programmer need external power supply to work)

are you giveing the external power to both the programmer and the target microcontroller

and to conferm that weather the crystal is working or not please use a mulimeter and check the frequency

if you still face any trouble then let me know

1. This comment has been removed by the author.

8. Hello Gaurav, I am redirected here from " http://diy4fun.blogspot.com/2009/01/simple-serial-programmer-for-avr.html " by you and your blog is quite useful. Thank-you. :) But since I have already made the design specified by MIROSLAV BATĚK(diy4fun.blogspot.com) and there are some differences in the circuit diagram( the connection to the base of BC547, does it cause any major problem...
Even I am getting the same problem of "missing or unknown device -24" , but my hardware is OK, and i got the "Probe OK" test passed :)
The reason might be that I have not connected the crystal. Is the crystal necessary ??? And why only 4Mhz , not anything else ?
Please let me know, I am a robotics enthusiast and love work out on these.. :)

9. hi Sumanta

When i start dealing with mcu years ago this was my first programmer
i also face the same error as you face , but that was due to lose soldering connection and external power supply was not connected to the programmer circuit, that error was debugged as i recheck the connection ,power and target system crystal 2-3 times , i keep using this circuit for months before upgrading to the usb based programmer

and i know may people who face same error due to confusion in the pin numbering of the serial port pin,,you can visit my PIC serial port programmer page to conform the serial port pins

about the transistor i can say that,,this programmer dos't work at too high speed(target programming clock) so any general purpose transistor can be used as specified in my schematic. i my self tested this programmer with 3 of these transistors.

and the crystal is required for providing the clock to the target mcu

10. Hi Guys

i request you to please post the results of dubuging after my advice.

it can help other people to work out things much easy.

11. Hi. I'm trying to make this serial programmer without using the
crystal for 'the external clock'. Is this supposed to work?

Once I'm using an ATmega8535 and it has an internal source clock. I
understood that I only need the [1] and connect the wires to the pins
of the microcontroller [2]:

wire --> pin
RESET --> 9
+5V --> 10
SCK --> 8
MISO --> 7
MOSI --> 6
GND --> 11

I changed the microcontroller in the PonyProg2000 (Menu Device --> AVR micro --> ATmega8535).

With all this done and connected. I tested like you said (Menu Setup --> Interface Setup... --> button probe) and the "Test Ok" message appears.

I really made a double check of the wires and I connected the programer to an external source of power. But when I try to read or write at flash I receive the answer: "Device missing or unknown device (-24).

12. hi Marcelo/Porks

Marchel Plese tell me what is the level of Vce of the transistor (between emitter and collector) when you power up the programmer
and when you hit the programming button

please check if the transitor is okey?

and insted off internel clock i suggest you to please connect the external crystal.

did you have any frequency meter or something???
please verify that the crystal is on it's frequency

and one more thing with frequency meter put the frequency meter's gnd prove to circuit's gnd and other prove to first MOSI then MISO and then CLK and clik the programming button ,,then look for any frequency change ((we are not measureing any freq here lust looking for any change))

if the fmeter display stay the same the there is a problem of interface cable between pc and the hardware

and please check for pin nummbering of the serial por once more most people do mistke right there

tell me if this work, if not

then tell me about those voltage level i will let you know more

13. hi Marcelo/Porks

one more thing please connect the avcc pin(30) to Vcc

and pin 31 to gnd

14. Hi Gaurav,

I saw your comment right now, thanks! But it was not necessary.

Yesterday I tried to replace every single component that I used and I found a bad zener diode. Somehow the diode was not working correctly.

So, I just replaced that diode and everything worked fine. Thanks again.

NOTE: I tried to use the programmer with the software 'avrdude' but it not worked (-c siprog). The avrdude failed sometimes in diferente steps. So I find out that I need to use the option '-i 100' (It causes a delay on the process). I found someone saying the same thing when he used an Athlon X4 (That's my case).

Sorry for the noise and thanks again. Your programmer works properly.

15. Thank you
it was my pleasure to assist you

16. hey gaurav is rs232 and db9 connectors are same thing .I want to use the same thing you have used in picture.So tell me it's name.And can I use this programmer with at89c51 and at89s51.

17. parth pandya

DB9 is type of connector.
rs232 is a protocol (standered) of serial communication.

in this this rs232 protocol based communication is used whihc db9 type of connectors

now a days most computer have rs232 port(serial port) in db9 type of connectors, but in old day there is a possiblity that the rs232 may be implemented on db15 or db25 also

and the plastic case you see in the image is call DB9 Cover
just take a female db9 connector and a cover and you are ready to go, this cover cost 10-15 INR and db9 connctor also cost 10-15 INR from delhi.

it can't programm 89s series of mcu

you can see another one
http://microembeded.blogspot.com/2011/06/usb-8051-avr-microcontroller-programmer.html

The link above will take you to another page of my blog this programmer support 89s series with usb interface

18. thank you very much sir.you solve my confusion between rs232 and db9.You suggest me your usb programmer but i am just a third year it seems very much advanced to me.I just want to start with AT89c51 because 8051 is in our college course so I will be very much thankful if you can suggest me any programmer for that.Means how i can load program to the AT89c51.

Sir I want a complete project guide means starting from writing the program in c genrating the HEX file and send it to AT89C51.

Jay Hind.Jay Bharat

19. Hi parth

i will post a compleate step by step tutorial on code writing and programming of 8051 mcu

but please tell me what programming language you are using , assembly or what??

and i will look for a 8051 serial port based programmer for you asap.
but the programmer which i suggest you is really simple
all you need to do is make this serial port based avr programmer
and then goto usb 8051 progammer page download the firmware , burn into the newly buyed atmega8,
connect as per the circuit
and you are with your programmer.
but still you want a progammer for 8051 with a serial interface i will soon give you that.

20. i have chacked all the things .. bt i am still getting the -24 error i am buiding serial programmer

21. Hi prashant

plese measure the voltage arround the mcu,
frequency between the crystal points.
and one more thing with frequency meter put the frequency meter's gnd prove to circuit's gnd and other prove to first MOSI then MISO and then CLK and clik the programming button ,,then look for any frequency change ((we are not measureing any freq here lust looking for any change))

please check the diode and the transistor for any missplace or fault

may be you should try all this on another computer
may be with another traget mcu too

plese let me know about the voltage between the target mcu

plese free to ask any thing you want.

22. thanks a lot..... now programmer is reading the mcu .... and i want to move 2 dc motors using l293d but i m nt getting the program for this..... can u help me with it

23. prashant

that's rellay good you debug this

you need the circuit and program to interface the motor using l293D yes i will post this within 3-4 days.
if the 3-4 days is too long then tell me i will try to cut this time.
Thank you

24. great!!
bt plzz cut the time nd send asap ..... and also tell me that l293d can be use to run 3 motors??....thnxs!

25. hi prashant

would you please explain why do you need these mortor,

2. which mcu you are useing ( i will try to post with 8051

3 which pgoramming language you prefer

4 do you need speed control over the mortor or just the direction of the mortor

26. i am making a robot for wich i need 3 motors

i m using atmega 16

and want to use same programming hexadecimal one in pony prog

i need speed control in 2 motor and other can b just simple ..direction..

27. Hi prashant

i will get you a circuit with in 1-2 days,

i will give you for atmega 16 mcu and c language
i will get you hex code too

with one l293d you can control only 2 motor if you want direction to be changed.

so for total three motors you need two l293D
and i will use pwm to control mortor speed

28. thanxs waiting for ur ckt.......

29. parashant

actually i was busy in other things i will post asap

30. I think i should prefer serial port programmer to usb programmer. but i'm using ubuntu. how can i use this circuit tp program my mcu

31. ok but waiting for the ckt

32. still no ckt !!!!!??

33. Sir,I have decided to make a project with AT89S52 which has the pins MOSI and MISO so can I use this AVR Serial Port Programmer for my project.And sir I also want to know that can I use one c programing code of AT89c51 for AT89S52 the code is about LCD interfacing.

34. Hi... It works... :-).. Thanks... Will this circuit work?

http://www.sourabh.sankule.com/tutorial/avr/serial_prog.html

Is there any risk involved?

35. I have made the programmer as described here. When I connect the prorammer to the serial port (without target)the voltages at the SCK and MOSI lines are -0.7V. Is this all right? In the datasheet the maximum negative votage at any pin is given as -0.5V. So Iam confused. Please clarify.
When I select 'Read All' option from ponyprog(without target), the voltages at SCK and MOSI becomes 1.1 to 1.2V after the 'device missing' message. Are these voltage levels correct?
In hyperterminal window when I press 'connect' the voltages at SCK and MOSI becomes 4V.
So is my programmer all right? I haven't tried to program with it yet.

36. Venky

yes this did work i have tested and used this

37. hi sukalyan

are you checking with dso or multimeter

multimeter can't show you exact value if there is low to high and high to low transaction

you just go ahead and try programming

and the question about the max negative voltage.

the data sheet says max negative voltage is -.05 volts
it means you can't put the signal less then -0.5 volts with reference to ground

when max voltage is vcc+0.5
it means if you are running your mcu at 5v then you can't give the signal more then 5.5 volts

38. Thank you sir for your support. I realized the fact that a dc multimeter cannot show proper voltages later. Now, I am running the uc at 5v. But after connecting the serial port the voltages at mosi and sck is -0.7v (<-0.5v).Is it okay for the uc? I will try to program with it.

39. Thank you sir, it worked. Thanks for your support.

40. Sir, I have constructed both the serial and usb programmer and both are running beautifully. But I am having problems with an atmega16 which was programmed previously with an universal programmer. Ponyprog is flashing the message 'device missing' and eXtreme Burner is 'not able to communicate with the device'. The chip is executing the previously loaded program- hence the chip is not faulty. But how can I rectify the problem?

41. Hi Sukalyan

i advice you plese try with other atmega16 because i just programmed atmega 16 with the usabasp without any problem

and your chp is executing the previously loaded program ,,, you can't reprogram or read this mcu if security setting bits are enabled for protection

42. Thank you sir. Today I reprogrammed them with the required fuse bit settings with a universal programmer. They are working fine now. I really want to appreciate your support to the followers of your blog. Please keep it up. You people give a lot of encouragement to us.

43. Hi Gaurav,

In the begin of this page you posted a photo from on side of your circuit [1].

Could you, please post a photo from the other side?

I ask this because I'm trying to do a this cuircuit as small as I can and yours seems to be very tiny.

Thanks so much.

[1] http://3.bp.blogspot.com/-i0rK-B9AtsI/TbrEajrm0RI/AAAAAAAAAFM/uZEIXguQtuw/s1600/Internal.png

44. hi marcelo
i don't have this programmer any more ,, i don't use this for my work , i have a professional programmer ,, so can't provide you image... sorry

these image are just to give a basic idea

45. Ok! Thanks anyway

46. hi gaurav.. i'm new to this avr. and i tried building this programmer. i got the probe test ok, but i'm still getting the msg as device missing or unknown device -24. i checked al the components as u've suggested but couldn't check the crystal as i cant afford to a freq meter. could u plz suggest another way to check the xtal...

47. which mcu you are programming?

have you checked the voltage level of mcu

if you do't have the freq meter then try to use another crystal

48. i'm using atmega8 and the voltage level i'm getting for the mcu is a proper 5 volts. and as u said, i'll try changing the xtal and let u know sir. thank u

where are you in india

50. yes.. bangalore

51. if you plan to build usb avr programmer then
you can send me the atmega8 and then i will program it for you and

52. i'm really thank full for your concern sir. but actually i'm planning to build the serial programmer which you have shown.. and i wish to have a programmer of my own cuz that would be helpful for my future programming. so i would like to build the one u've shown as it's a lot simple..

53. ok then.

54. Hello,
Is this compatible with at89s52???

55. hi aldrin

this programmer is not compatible with 89 series of Devices

Thank you

56. hello,
can this circuit program all avr series mcs,at90xxx,at-tiny,etc?

57. Hi,
I built the AVR serial programmer and want to use it to program an atmega8 microcontroller to be part of an AVR USB programmer. From what i read it looks like writing the hex file is a two step process. First I flash the hex file and then after successfully writing the hex file, i separately write the fuse bits. IS my understanding correct Sir.

Thanks,
vinay

58. yeah

you are correct. burning the hex needs two things but actually they burned together in one step.
means open the hex file into software and adjust the fuse bits and click burn button..

59. Thanks a lot Sir. I shall try it.

vinay

60. Hi
I've ATmega168v and ATmega88v can i use them ?

61. sure you can use atmega 88

does contain .hex file for atmega88 too

62. and ATmega168v ?

thanks =)

63. Sir

I made the programmmer but while setuping the inferface. It flashed a message
"" DLPORTIO.SYS is not loaded ""

What could be the mistake

pls help

64. hi ashin

this is pc software problem you must redownload and try to run .

thank you

65. This comment has been removed by the author.

66. Does Windows 7 supports pony prog.

Can it be made to work on win 7.
What should be done to make it work on windows 7.

AsH

67. how to set the program to use serial port.

68. Hi ashin

how to set the serial port is shown in the images above.

69. Sir

Its working fine now

I got the pins wired incorrectly!!

Thanks 4 all the help.

Ash

70. dear sir ,
i am using usb2serial converter and so i was unable to use this ,i am using atmega8 ,pls help me ,i want to construct USB 8051 (89 series) & AVR Microcontroller Programmer .

71. Sir
I am facing a little problem . I cant have +5v steadily.
i am getting 4.8 - 5.0v variations.I used a 5v regulator to get 5v to the programmers but it reduces to 4.8 v as i connect it to 5v pin of the programmer circuit. IS this normal and what can we do about it.

Ash

72. hi ashin

4.8v is fine go ahead any try to program

73. Hi, I am getting the problem on clicking probe, it says Test failed!! What should be done? I am using Windows XP SP 2. Please help me asap

74. yes

Its programming well!!

Thanks 4 all the help u provided with .....

Thank u sir.

75. Hi! does it support ATmega8515? thanks

76. Yes it does support atmega8515

77. Hi! it support ATmega128 ?

not use H/W pin Mosi and Miso it use PE0 and PE1

thanks

78. is there any solution to program using usb to serial convertor???

plz.. help me out..

79. Does this support AT89S52?

80. Hey Gaurav,
I'm building a USBasp, but I'm aware that it uses an AtMega8 with a software USB bootloader. Since it's a software based USB interface I'm guessing it's speed won't be too high and neither will it be very reliable.
Why not develop a usb programmer with a chip that has hardware usb support, like "PIC18F2xxx" series.
I'm sure this will be an interesting project for you -> [http://electronics-diy.com/USB_IO_Board.php] :)
With regards,
Shaun

81. Hi
I am using atmega8, downloaded the firmware, i changed the fuse bits following the steps given in your serial programmer tutorial, fuse bits were written ok but after that when I tried to burn the firmware, an error was displayed that "target didn't answer"

Kindly help me

1. Hi,

this kind of mcu locking porblem arrive only when you have some wrong fuse bits.

If the mcu get locked then nothing much you can do

2. thanks for your reply,I have followed all the mentioned steps to configure fuse bits,we have to configure lock bit too?

3. If it is required to burn then lock bit for your hex file then do it otherwise. Leave it like that

let me warn you !!!!!
if any wrong fuse bit is burned then it may lead you to
a useless locked microcontroller.
So read the device datasheet 's configuration bits setting. Section. Carefully

4. Hi
I got my mistake,basically I am using Khazama to burn firmwear in atmega8,to set the fuse but I used fuse bit calculator ,there is some difference in rrading the fuse bit in calculator vs khazama,eg:If calculator show chk mark on any bit its mean you have uncheck these bits in khazma,I hope I deliverd.

82. then what can i do now? how can i make my controller working now?

83. Respected Sir,

Sir do u know how to use touchpad type keypad instead of matrix keypad..? if yes then pls sir guide me with it to interface it with atmega32.

84. Can i use this programmer under windows Xp ? i have heard that Xp does not allow direct port access . can i use this with winavr ?

1. sure you can use it in windows xp ? i have tested this n working fine

85. does it support atmega644??

86. I need help since I m beginner to avrdude in Ubuntu and AVR programming,
I plan to make this one
What should I select in avrdude that is parameters for -c and -p

87. please give me ATMEGA8L datasheet

88. please give me ATMEGA8L datasheet

1. datasheet is available though out the internet just google it

89. This comment has been removed by the author.

90. HI, SIR PLEASE GUIDE ME
WHAT STEPS U FIGURE OUT FOR BUILDING AVR PROGRAMMER ?
AT DATASHEET I READ STEPS FOR SERIAL PROGMING OF ATMEGA8 LIKE

----> "RESET" AND "SCK" SET TO "0"
----> WAIT 20ms AND ENABLE PROGRAMMING THROUGH "MOSI"
----> SOMETHING SYNCRONIZATION

AND MANY MORE ...HOW U REALIZE ALL STEPS IN THIS SMALL CKT AND

PLEASE GUIDE HOW PROGRAMMING PROCESS DONE BY UR CKT ?

AND HOW U SELECTED THAT RESISTOR AND TRANSISTOR N ZENER DIODE ?
HOW THEY GENERATE DELAY , SYNCHRONIZATION ETC ?

THANK U .

1. just for your information ,this programmer don't support 8051 chips like 89c51 ,

----> "RESET" AND "SCK" SET TO "0"
----> WAIT 20ms AND ENABLE PROGRAMMING THROUGH "MOSI"
----> SOMETHING SYNCRONIZATION

this all is done in pc software

and why are you worried about all this stuff there are too many thing to take into the count.

91. Hey gaurav
I am 2nd year electronics student and at the initial stage of Robotics. I have taken up a project to build a line follower. I am using ATMega8 MCU.
Now to program it I need a programmer. But I dont want to buy it and want to make it on my own.

I have certain personal queries not related to this blog. Can you give me your Email ID so that I can contact you?

92. hey Gaurav good to msg you..!! I'm krishna(krish), firstly thanks for your valuable posts on programming the Micro controller and I design this kit and its works fine..!! now regarding the programming part I know the assembly language for ATMEGA 32 and i traansfer the hex file of atmega 32 to atmega 8 its not working is there any other way to burn the ATMEGA 32 hex file to ATMEGA 8 MC..!!

93. Hi Sir!, First of all I want to thank you that you have posted such a nice informative tutorial especially for beginners. Now, let me come to my problem. Actually, I am building the USBASP based programmer you have posted. I had ordered the same programmer a few months ago, but it worked only twice, after that it is unable to work. I thought that the problem maybe a fried ATmega8, but to my surprise when I connected it to my circuit that I have made as per the diagram provided (actually I am a novice). But there is a fault that I am facing, firstly, the power status light(ie Green LED) is not glowing and secondly, the busy flag is shown by green led, and not the red one. Secondly, the error message I am getting at my console on avrdude is "unable to set SCK clock period". Now I thought that I should make the serial programmer to program a brand new ATmega8 and connect it to my USBASP based programmer. I created the one given by you, and after a bit of mind boggling hardwork, I figured out that everything is fine (no loose soldering, no wrong connections or anything), but the error that i am getting at Ponyprog console is "device error". It says that either an unknown device is coonected or no device is connected, and by this I mean the target device. I am also providing the system with 5V regulated external supply, I am now unable to figure out what to do.
If you will help me, then I will be very thankful to you. Also tell me how to check the crystal oscillator using most simple multimeter (I am feeling that it can be a problem yet I don't know about this, I have just completed my 2nd year and don't even know about mcu, yet I have worked with them as hobbyist that too very little because my programmer broke away), since these are vacation days and I have no access to my college lab. Thank you very much in advance.

94. Hello sir,
I done this circuit. It was showing error "24"
I gone through the comments, still I cant program my Atmega8.. I this the microcontroller gets fault.. But I bought it freshly and used only. Is there is any chance that the microcontroller get damage? ... Can You help Me?

95. THE DB9 used here is female one na..??? its written in one of the figure caption, but just want to confirm it..

1. yep its female connector

96. gaurav bro i don't have DB9 port in my laptop what do u suggest me to do now ???

97. hello friend, you can program a ATmega48, thanks I'm from Argentina

1. sure this programmer support atmega48

98. HELLO SIR I AM USING ATMEGA8 MICROCONTROLLER BUT I DNT HOW TO PROGRAM IT CAN U HELP ME

99. Sir, I am having little confusion.
AVR uC is based on TTL logic(0v and +5V), but RS232 logic is based on (-3V to -25V and +3V to +25V) so is their any need to convert RS232 to TTL logic.
I know that the above circuit is working properly, but I have this confusion.

1. there are few 5.1V zener diode in the circuit the will work as regulator

2. But sir, Zeners are not placed at all the pins, not even at the transmitted pin no. 3 of DB9.

3. zener have done the job for SCK and MOSI
we don't need any thing for MISO as it is input

pin 3 of DB9 is connected to reset and vcc
for reset as the datasheet says
Voltage on RESET with respect to Ground......-0.5V to +13.0V
for vcc when we gonna supply the +5v to that pin there is no question of rising the voltage more then +5V

4. Ok Sir,...
Thanks.

sir I am having one more problem with IC AP89042,.. it is a speech ic, Can you tell how to program this IC, I am working on IVRS Project.

Once Again Thanks for the Description. :-)

100. Hi,

Does this work with ATMEGA328-PU, i want to upload arudino optiboot hex file. Will it work with this ?

Thanks,

Ujjwal Soni

1. haven't tried but i guess i didn't support

101. This comment has been removed by the author.

102. hi my questions is that what is the difference between all programmer used for microcontroller...what is the concept of burner or programmer

103. Programmer and the burner both do the same job. They program the hex file into the mcu.

But the term burner comes from the initial age of the microcontrollers because at that time most of the microcontroller weather have PROM or UVEPROM to store there instructions. So writing something to these type of memory done by burning some connection in the memory (burning doesn't mean you will have fumes and smoke this all done internally in the memory) and leaving rest as it is. So burned connections readed as 0 and non burned connection readed 1.
In the case of PROM you can program only once , you can't erase it. But uveprom memory you can program it using burner but to erase them you need uv light.
So programmer of these microcontroller is sometimes called burner.

But now a days almost all the microcontroller has flash based memory to store the program .flash memory can be erased and programed using electronic signals only . You can erase and reprogram any number of time you want ( ~10000 times) .
So nothing is burned thats whay it is called programmer more likely .

104. Hi there!
I've read all the comments trying to guess a solution, but i couldn't. I've tied VCC and AVCC together, and both grounds too. When I run the COM1 test, it's OK, but then i get the annoying "Device missing or unkown device (-24)". What can be wrong? As well, in idle, Vce = 5.16V. When I click the button however, Vce varies from 5->2->3->1->0.22(min)->2... until it gets back at 5V.
P.S. I'm running it on a proto board
P.S.2 My chip is an Atmega8, and I'm working under Windows 8

1. i guess there is some problem with the power supply. how are powering the target device. it need an external power supply to work.

2. This comment has been removed by the author.

3. Hi! Thanks for your answer. Currently, I'm using a power adapter rated 0.7A which provides 5.12V. I made a simple circuit using a voltage regulator, but it isn't working apparently
-EDIT-
I have tried now with another power supply (the one with the voltage reg) which supplies exactly 5.02V and it doesn't work either

4. does your pc have proper hardware com port or you are using USB virtual com port?

5. It has a 9 pin COM(1) port, which I'm using for this project

105. This comment has been removed by the author.

106. Hi Gaurav Chaudhary,
I just finished the "AVR in-circuit programmer" that you provided, and I am happy about it (it took me 2 days to figure out why it wasn't working). Now everything is fine and I am going to the next level which is your USB programmer. Thank you for your friendling sharing and support.

J.J.

107. can we use atmega 328 instead of atmega 8

108. I have used atmega16...The probe test is OK...

But when i tried to program it shows Device missing or unknown device...

109. Hi should we give voltage supply to VCC pin7 or AVCC pin20?

1. yes ,as i have mentioned in the post itself
" Ensures that the chip is receiving exactly +5V voltage it ensures error free programming.

+5V voltage supply for AVR chip may be provided from external power supply or even better - directly from USB "

110. Thanks for your response but, should I connect +5v to VCC i.e. pin7 directly?

1. yes ,as i have said many times.

111. whenever I am trying to write the hex file it's showing "Communication port not available (-16)"

1. do you have a physical com port in your pc ?if the yes then only you can use this programmer, usb to serial adapter can't be use, as i have mentioned above.

if you do have a physical com port then , please make sure you have selected correct com port on which the programmer is connected. or may be com port is currently busy with some other application or software having some problem opening the com port.

112. Probe test is also getting failed

113. Sorry I was using usb to serial adapter

114. Hi Gourav,
I am a newbie in this field. I built this programmer as provided in the diagram above. But while trying to program the atmega8 mcu the ponyprog is telling "device missing or unknown device (-24)". In my circuit the connection to mcu is provided through ic socket. I have a doubt that whether we need to connect crystal to mcu. Please help.

1. crystal is required to provide clock to the mcu, if the configuration bits of the target mcu is not set to use internal oscillator

115. whether the fuse bits are need to be configured 1st or hex to be burn first .. or it is not mandatory which soever ????? please rply ..

116. which Micro controllers are supported by this serial port programmer.

117. can i burn hex code in microcontroller with only this serial programmer. does any hardware needed for programming?

118. Can you post the target board schematic for atmega8 uC??

119. not working sir help mee my id teenu.1988@yahoo.co.in

120. Sir my system is not having a RS232 port, what should i do?

121. Sir can i program Atmega32 using this programmer and what device i should select in Ponyprog as it does not show atmega32 ?

122. There is necessary to fuse bit or not

123. Sir, is this programmer compatible to attiny2313 ?

124. Sir,
I am tinkering with micros.
I have an Arduino uno board with latest IDE working on Windows 8.1
To get at serius programming I need to learn to write to the AVR chips, for which I thought of buying the Extreme AVR burner 2.1 from extreme electronics. But this does not work with windows 8.1.
I have installed WINAVR 20..10...
Guidance from you will be invaluable for me.
Can I construct your USB ASP circuit to get to writing to the mcu.
Regards.
karanbir

125. HI GAURAV,
thanks for the nice work, i want to make this simplest programmer to burn the boot loader into a ATMEGA328 ic. now, the thing is, ponny prog. dont have atmega328p in the list . so can you suggest some other software to program atmega328p with this same hardware provided by you ? can i do it with atmel studio v6 ? or SI-PROG.

126. Sir
I have to program atmega16 for my project. I need to design the burner for it so can you help me with the components and the precautions I should keep in mind.

127. dear i can use this circuit with CodeWarrior to read and write MC9S08SH4

128. hi i need help , i want to design 8051 pocket size programmer with usb interface using progips software.... did u help me

129. Hey Gaurav,
i saw the circuit of the serial avr programmer . i am little bit confused about '+5' pin.i want to clarify it that we are getting 5 volts from it to supply to target mcu OR we have to give 5 volts from ext. power supply to that pin.

if we are getting 5V from it then i think i don't need an ext. power supply to give 5V to target mcu.we can give it directly from here. please tell me i am right or wrong.......

130. you need to supply 5 v from the external source

131. Greetings...
I am using ATmega32A for my project, and i tried to read and download my hex file using ponyprog2000.
It works and got the successful msg for the first time bu from second time onwards it is showing "Device missing or unknown device (-24)" msg...i have checked ckt connection 2-3 times...
pls hepl me out...

132. hi gaurav,

when i try to use ponyprog to program my atmega8,
DLportio.sys device driver not loaded.porti/o will have no effect message appeared.when i setup the interface in SIprog I/O and performed the Probe Test then it shown a message as Test Failed but when i tried with SIprog API and JDM mode then probe test shown a message as Test OK. what is the problem?
is this problem in Circuit or Pony prog software? when i tried to flash the program with Avrdude with SIprog then it is showing message as Device not responding and Initialization failed Double check connections & -F to override what it is tell me indetail. i am new to ATmega Controllers

133. hi gaurav,
i connected the programmer as you given.Test passed in Poyprog software but while reading the device it is showing the message as "Device missing or unknown device (-24)" Tell me how to solve this problem?

134. hi all any one writes these values to lfuse and hfuse, should use an external crystal on xtal1 & xtal2 of mcu, because these values of fuses stop the internal clock and work on the external one.

135. This comment has been removed by the author.

136. Hello all unknown error 24 is because of the length of the wire. Reduce length to maximum of one feet and check your programmer it should work.I hah the same error and solved it by reducing the length of the cable from db9 to the programmer

137. i made my pcb for above circuit, but have some doubt regarding its connection with atmega8. someone plz tell me how to connect above to atmega8

138. as per Shawn in circuit can i use a 10v zener , and in place of 15ohm res can i use 12ohm res

1. Yes 12Ohm will work in place of 15Ohm

139. Sir ponyprog my requirements