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.

59 comments:

Tius said...

Thanks for sharing this, very useful.

ATmega said...

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!

JusufCorp's said...

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

macobt said...

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

Miroslav Batěk said...

For supported devices please refer
Ponyprog webside and
avrdude documentation

Devina said...

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

Hitanshu said...

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???

Miroslav Batěk said...

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.

Rikil K Shah said...

Thanks for sharing.Very neat and informative.

bui said...

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?

vinay said...

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

Miroslav Batěk said...

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

sathish said...

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

Miroslav Batěk said...

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

Sunil said...

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.

Santo said...

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

Zemlyanikin said...

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

jc said...

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

tyukodi.botond said...

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!

sakthivel159 said...

perfect sharing

Gaurav Chaudhary said...

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

Sumanta said...

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)

Gaurav Chaudhary said...

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

oprime said...

"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?

Amit said...

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

ilya said...

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

Venky said...

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

Venky said...

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?

Jean-Marie said...

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

supguise said...

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

meena said...

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

jessie libron said...

sir can post here a serial programmer for en25t80 .thanks

jessie libron said...

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

ag12345 said...

Hi! does it support Atmega8515? thanks

hari1991 said...

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

jartur said...

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"

BI CONSULTING said...

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

கிள்ளிவளவன் said...

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???

Alvin Smith said...

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

Ujjwal Soni said...

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

Messy Sachu said...

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

Wiseman said...

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 ?

Aashish Gaur said...

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

Mehul Anghan said...

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

Sune Brian said...

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

Reiner christian raja said...

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

dodekm said...

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

Jimut Dhali said...

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??

Jimut Dhali said...

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.

Souradeep Naskar said...

Worked like a charm with Atmega8
thanks!

Saran Balakrishnan said...

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

Lucas said...

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

Sridhar Sampath said...

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.

Goahead said...

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

surya prakash said...

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?

Harish N said...

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

Ankita Pagariya said...



********************************************************
----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

Vishnu Chuncha said...

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

CURTAIN RAIZER said...

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!!