Sunday, 4 January 2009

Simple Serial Programmer for AVR

This is a very simple and easy to build programmer for Atmel microcontrollers from AVR family. The microcontrollers must support serial programming. This programmer is connected to a PC through the RS232 serial interface and can be used with the PonyProg or Avrdude software programmer.





Description of the serial programmer:
The programmer is quite simple and it is based on the SI-Prog from the author of PonyProg software. The Zener diodes D2, D3 with the resistors R2, R3 reduce the voltage from the ouput pins DTR, RTS on the serial port to around 5V which is suitable for microcontroller (MOSI, SCK). MISO signal is connected directly to the input CTS pin. The Zener diode D1 with the resistor R1 drive the NPN transistor T1, which controls RESET signal. The AVR microcontrollers are in reset when the signal has low level. The resistor R5 works as a pull-up for reset signal. The resistor R4 helps to close the transistor T1. The programmer has standard 10 pins header.

Schematic of the serial programmer


Assembly diagram


PCB (top side)


PCB (bottom side)


Panelization (When you need more pieces.)


Assembled PCB (top side)


Attention:
The transistor T1 should be in opposite position then is depicted in the assembly diagram.
Please check the position of Base-Colector-Emitor on your transistor.

I use this programmer for programming Attiny13, Attiny26, Attiny2313, Atmega48, Atmega88, Atmega168, Atmega16 and it works very well. I also use the programmer with desktop computer, laptop, with and wihout USB-to-RS232 adapter and it works in all cases.


Using PonnyProg2000:
When you want to program your microcontroller with the PonnyProg2000 you have to setup the program as you can see on the following picture. You have to select chosen COM port, where is connected your programmer.

Ponyprog I/O port setting


Using Avrdude:
When you want to program your microcontroller with Avrdude you have to select the keyword "ponyser" as a programmer type and appropriate COM port. I'm using this method to program my microcontroller directly from the Atmel AVRstudio when I'm debuging my application. I create a batch file with the command for the avrdude and I call the batch file directly from the tool bar. It is very fast and easy. Avrdude is also part of the WinAVR package.

Microcontroler programming by avrdude


Programming header reduction:
Sometimes you have to program microcontroller in a aplication where is only 6 pins header instead of 10 pins. I created small adapter for this purpose. The adapter has 10 pins header, 6 pins header and 6 pins header in one line. 6 pins header in line is useful when you want to bring the signals to the breadboard.

Schematic of the programming header reduction


Assembly diagram


PCB (bottom side)


Assembled PCB (top side)


With this equipment you should be able easily program your AVR microcontrollers. Good luck.

65 comments:

  1. Thanks for sharing this, very useful.

    ReplyDelete
  2. I wonder why usb to serial work too slow (I tried in desktop PC dan laptop using avrdude dan ponyprog, the result is same, its too slow).
    But its normal if I using onboard serial port.
    Btw, nice schematic!

    ReplyDelete
  3. Thaks Bro...
    You are really a great engineer...

    ReplyDelete
  4. Nice work.
    Which AVR microcontroller devices are Supported?
    Regards macobt

    ReplyDelete
  5. what is the v/g on RST(bar)pin?

    ReplyDelete
  6. thanx a lot!!! but do i directly Plug the DB9 socket to my desktop, and start programming or is there an interface between of RS232???

    ReplyDelete
  7. Hi, you can connect the programmer directly to your PC to a COM port. No interface needed. The Zener diodes limits the voltage from serial port to 5V for the microcontroler.

    ReplyDelete
  8. Thanks for sharing.Very neat and informative.

    ReplyDelete
  9. thanks Miroslav. This shematic is very simple. I tried it. But i dont know why there are always a message:
    "Device missing or unknow device (-24)". Can u help me?

    ReplyDelete
  10. hey can i use this to dump my code into ATmega32 microcontroller also??...please do rep soon..

    ReplyDelete
  11. @vinay: yes you can use it to program ATmega32. It should not be a problem at all.

    ReplyDelete
  12. Hi
    i have constructed AVR ISP circuit as you gave in the site. calibration and interface setup are correct and the circuit too but while programming i get the alerts "device missing or unknown device-24" i have tried as much as possible ways, i am stuck now please help me

    by
    Sathish

    ReplyDelete
  13. @sathish: Please send me an email to diy4fun@gmail.com with more details. I will try to give you few hints.

    ReplyDelete
  14. Hi,
    I have same problem ike satish.
    i have constructed AVR ISP circuit as you gave in the site. calibration and interface setup are correct and the circuit too but while programming i get the alerts "device missing or unknown device-24" i have tried as much as possible way.
    The signal on reset pin is working fine but there is an error of device missing or unknown device-24.
    Please help . I have also sent an email to you.

    ReplyDelete
  15. Hi,
    I am using this ISP interfaced with ATmega32 controller and trying to connect via AVR Studio4.0. But AVR studio4.0 could not able to find the Device connected via COM port. Kindly let me know, whether we can connect ATmega32 Controller from AVR Studio4.0 via this simple ISP interface?

    Thanks & Regards,
    Santhosh M

    ReplyDelete
  16. Thanks for sharing this design, it's the single avr programmer design that worked for me.

    ReplyDelete
  17. Cheers, fellow Czech :) Nice programmer, I like it.

    ReplyDelete
  18. Thank you very much, it works like a charm! I burnt out my USBasp programmer, so I built this in an evening! You're great!

    ReplyDelete
  19. Sir
    you did a good job
    i have build a similar programmer

    http://microembeded.blogspot.com/2011/04/avr-serial-port-programmer.html

    i will provide live support for the programmer

    ReplyDelete
  20. this is a nice design. i want to ask weather we can use this serial programmer to change the fuse bits of the ATMega16(usging avrdude or PonyProg)

    ReplyDelete
  21. hi Sumanta
    you can use the this programmer to change the fuse bit visit my blog to know more

    http://microembeded.blogspot.com/2011/04/avr-serial-port-programmer.html

    ReplyDelete
  22. "The transistor T1 should be in opposite position then is depicted in the assembly diagram.
    Please check the position of Base-Colector-Emitor on your transistor."
    Is the schematic diagram correct?

    While we are using this programmer to program a chip, do we have to use an external oscillator with that chip?

    ReplyDelete
  23. hey,
    just a lil question...did u make the pcb layout in eagle or altium?

    ReplyDelete
  24. Hi! Can I use simple diodes or resistors instead of zener diodes? Can't get them right now...

    ReplyDelete
  25. Hi... Thanks for the design.. Do we have to externally power the MicroController before programming it or does it take power from RS232?

    ReplyDelete
  26. Worked Great.. :-). Thank you.. But i came across another serial programmer circuit..

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

    Will it work? Is there any risk involved in using this programmer?

    ReplyDelete
  27. Hello Miroslav
    Thanks for sharing this very simple ISP programmer.
    You write that it can be used with a USB-RS232 adapter. I bought a USB-RS232/TTL adapter based on a CP2102 chip. This adapter gives all the signals of the RS232 at a TTL level as well as +5V and +3.3V.
    I connected it according to your schematic, of course removing the resistors and Zener diodes limiting the voltage. Unfortunately, I was unable to connect to the atmega neither with Ponyprog2000 neither with avrdude, although your programmer works fine with the ordinary serial port (COM1) of the PC, thus without the adapter.
    It would be great if you could help using this cheap adapter with your programmer, permitting people to start working with a very low budget.
    Anyway, many thanks for your work

    ReplyDelete
  28. D1 will never have 5V across it, I don't get why it is there

    ReplyDelete
  29. i have the same problem as satish and sunil...it says "unknown device or device missing". Please help...its important. Thanks in advance!

    ReplyDelete
  30. sir can post here a serial programmer for en25t80 .thanks

    ReplyDelete
  31. sir can you post the schematic of en25t80 serial programmer,thanks.

    ReplyDelete
  32. Hi! does it support Atmega8515? thanks

    ReplyDelete
  33. thank you very much sir!!Does it support Atmega32A.and one more question sir.are atmega32 and atmega32A same and can they be programmed in similar manner.Please suggest me some software that supports atmega32A

    ReplyDelete
  34. Thank you for sharing this programmer and the other question you need to program the microcontrollers crystal and how fix he alerts "device missing or unknown device-24"

    ReplyDelete
  35. Hi

    I have a standard battery of 9v and I want to feed an atmega8 microcontroller which accepts 5 v power in the vcc pin so should I use a resistor if 330 ohm to take down the voltage to pretty close to the desired voltage about 4.49 volts which is inferior to 5 v . What shoud I do to feed the atmega 8 microcontroller without damaging it

    Thank you

    ReplyDelete
  36. How does this circuit works???
    is it follows ISP??
    ISP thro SPI???
    if so why MISO is conneted with CTS and MOSI is connected with DTR??
    Why aren't these are connected with TXD and RXD??
    I have these doubt for a long time can anyone help me please???

    ReplyDelete
  37. Great informative post as always!Thanks for taking time to share your great experience and knowledge here with us..pcb design

    ReplyDelete
  38. Can i burn bootloader in ATMEGA328-PU using this circuit ?

    ReplyDelete
  39. Nice.. Is it possible to program an 8051 using this???

    ReplyDelete
  40. I tried it and have a problem that it is Too slow , like 2 Hours time for 5Kb code , what could be that I'm doing wrong ? , is it related maybe to windows and drivers ?

    ReplyDelete
  41. Can i program a micro-controller using bafo with this board??

    ReplyDelete
  42. sir i have same problem "device missing or unknown device-24"...plz sir give me solution very soon..
    my email id:mehul_balo@yahoo.com

    ReplyDelete
  43. sir i have same problem "device missing or unknown device-24"...plz sir give me solution very soon..
    my email id:briansune@yahoo.com.hk

    ReplyDelete
  44. send me the schematic
    my id is reiner.281@gmail.com

    ReplyDelete
  45. Link for downloading of schematic and pcb doesnt works.
    Please repair it. I need PCB.

    ReplyDelete
  46. does it needs a external power?
    I tried but its saying avr device not responding.

    and i am getting negative voltage in all the pins..why??

    ReplyDelete
  47. Sorry! it worked perfectly. I just forgot to give it an extra power input.
    and the negative voltage fault was because of my faulty multimeter.

    ReplyDelete
  48. Worked like a charm with Atmega8
    thanks!

    ReplyDelete
  49. Hi
    i have constructed AVR ISP circuit as you gave in the site. calibration and interface setup are correct and the circuit too but while programming i get the alerts "device missing or unknown device-24" i have tried as much as possible ways, i am stuck now please help me

    email: iamsaranvs@gmail.com

    ReplyDelete
  50. Hi, thanks for share...
    What software you used to draw the board?

    ReplyDelete
  51. Initially I could not connect my ATMega32 with this ISP, but later I found that the MISO and MOSI were interchanged in my uC board. I corrected that and them this ISP worked well. But it is very slow on USB-Serial converter. I used BAFO (Prolific PL2303) converter.
    Thanks for the simple circuit.

    ReplyDelete
  52. Hi was wondering if its ok to power this off usb +5v? This won't interfere with other voltages present on board?

    ReplyDelete
  53. which Micro controllers are supported by this serial port programmer.
    can i burn hex code with only this serial programmer. does any hardware needed for programming?

    ReplyDelete
  54. Hi
    i have constructed AVR ISP circuit as you gave in the site. calibration and interface setup are correct and the circuit too but while programming i get the alerts "device missing or unknown device-24" i have tried as much as possible ways, i am stuck now please help me



    email:harishn28@gmail.com

    ReplyDelete


  55. ********************************************************
    ----BUY ELECTRONIC COMPONENTS AND GADGETS ONLINE AT-----

    ............ www.kimaginations.com .................

    ===============LOWEST PRICE IN INDIA ===================

    (Get Exciting Offers and Discounts)

    (ROBOTICS,EMBEDDED,VLSI KITS,MATERIALS AND PROJECTS)

    USE COUPON CODE : KI100DISC

    *GET Rs. 100 /- OFF ON PURCHASE


    ********************************************************
    *T&C Apply

    ReplyDelete
  56. sir i have made a this programmer according to the schematic you had posted but its not working

    ReplyDelete
  57. why this man has stopped giving the support and giving answers to the questions of a lot of persons ??? since long time !!
    this is just a wastage of internet pages n time n network space that people make something and then make it wrong and show their dumbness !!
    read all the comments very carefully and you will never find the answer of the question people ask almost 20 times that we get an error ---> "unknown device or device missing". "device not find code (-24)" why this person say theM to send the email ? and WHY NOT POSTING HERE IN THE PLACE ITSELF ??? BE AWARE THIS IS A SCAM .!! OF MAKING PEOPLE FOOL AND WASTING THEIR TIME! THIS IS A SOCIAL CRIME !!
    SHAME ON YOU WHO MADE THIS!!

    ReplyDelete
  58. What is the C1 for? To ensure the data is there before sending the serial clock pulse?

    ReplyDelete
  59. Hai , thanks for this tutorial . I'm using atmega 16 , in ponyprog2000 always show pop up "Device Missing or unknown (-24)" and if ignore , this working but show pop up "Writing Failed" , and my atmega 16 not fully working. Any solution ? Im using serial to usb adapter. Thanks :)))

    ReplyDelete
  60. Ótimo post, gostaria de baixar os arquivos porem esta off, poderia se possível um novo link, agradeço muito.

    ReplyDelete
  61. Amazing Job!!!

    can you share your files again? rapidshare doesn't work anymore. THX :D

    ReplyDelete
  62. This comment has been removed by the author.

    ReplyDelete