AVR Serial Port Programmer

download AVR Serial Port Programmer

of 34

  • date post

    17-Oct-2014
  • Category

    Documents

  • view

    167
  • download

    3

Embed Size (px)

Transcript of AVR Serial Port Programmer

AVR Serial Port ProgrammerAbout AVR 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

AVR Socket PCB

There are two connections; ICSP that connects to AVR Programmer, and external +5V supply

Ensures that the chip is receiving exactly +5V voltage and provides very reliable 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 please visit this page Click here 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 Posted by Gaurav Chaudhary at 9:02 PM Email ThisBlogThis!Share to TwitterShare to Facebook Labels: Atmel AVR, COM Port Programmer, Programmer, Serial Port Programmer 97 comments:

1. RishirajMay 10, 2011 10:56 PM 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 Reply

2. Gaurav ChaudharyMay 11, 2011 07:06 AM hi rishiraj you can use any zener you have,, when i made this i use general 5v1 zener.. you can use the fast swithcing zener. its fine. Reply

3. Joel M. PintoJun 9, 2011 07:40 AM 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 Reply

Replies

1. gan007Feb 19, 2012 11:21 PM 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. Can you please help???

2. Gaurav ChaudharyFeb 20, 2012 10:57 PM 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-microcontrollerprogrammer.html

3. Gaurav ChaudharyFeb 20, 2012 11:00 PM This programmer will work only with avr mcu and. Cant't program 8051 Reply

4. Gaurav ChaudharyJun 10, 2011 01:52 AM 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 Reply

Replies

1. gan007Feb 19, 2012 11:09 PM 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. Can you please help??? Reply

5. vikramJun 12, 2011 11:45 PM very nice. can i use this schematic for atmega2560? Reply

6. Gaurav ChaudharyJun 13, 2011 12:43 AM 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 Reply

7. KristijanJun 18, 2011 02:19 PM I made programer but PonyProg is not recognizing it. I`m 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 it`s not oscillating. Maybe you got some ideas what to tray to solve this problem ? Reply

8. Gaurav ChaudharyJun 18, 2011 09:55 PM 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 Reply

9. SumantaJun 19, 2011 09:23 AM Hello Gaurav, I am redirected here from " http://diy4fun.blogspot.com/2009/01/simple-serialprogrammer-for-avr.html " by you and your blog is quite useful. Thank-you. :) But since I have already made the design specified by MIROSLAV BATK(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.. :) Reply

10. Gaurav ChaudharyJun 19, 2011 10:39 AM 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