Building and installing USBASP-USB programmer of AVR microcontrollers

-->

USBASP is well known USB programmer for Atmel AVR microcontrollers originally supported by Thomas Fischl. USB ASP is made of an Atmega8 and few components. The programmer uses a firmware driver that makes this programmer attractive to many amateurs.

Another thin why this programmer is so popular – because it is officially included and supported in WinAVR (now version 20070122).

Once again lets see what this programmer is made off and how to set it up.

Original circuit you will find in authors site: http://www.fischl.de/usbasp/

usb_asp_cir_thumb.png

 

The core of USBASP adapter is Atmega8 microcontroller clocked by 12MHz crystal. Soldered board is ready to be connected via simple USB cable with B type connector (Computer side needs A type of connector). Resistors R2 and R6 are current limiting resistors, that protect computer USB port. Resistor R7 helps computer to recognize device as LS (Low Speed). Diodes D1 and D2 indicates about data transfer. Header SV1 is compatible with STK200/300 just 4 and 6 pins are used for RXD and TXD (may be used for other purposes).

STK200.png

 

SCK signal can work at two frequencies 1.5MHz and 8MHz 375kHz and 8kHz which can be selected by Jumper JP3. If Jumper is unconnected, then SCK speed is 8MHz 375kHz. Low speed SCK is used when MCU is clocked with low speed oscillator like 32kHz.

USB_ASP_block.png

 

Jumper JP1 is used for programming adapter itself via ISP adapter. And last Jumper JP2 is used for powering adapter from USB port (not recommended).

This is how my adapter looks like:

USBASP_Device_close.jpg

 

To make this adapter work you need to program Atmega8 with driver firmware which can be downloaded from http://www.fischl.de/usbasp/ page (usbasp.2006-12-29.tar.gz -118 kB).

Few words about setting up USBASP adapter for work in Windows XP system.

After firmware is uploaded, then connect USB cable to adapter.

  • Connect cable directly to USB port of computer avoiding Hubs (in my case computer didn’t detect adapter connected through hub);

  • Wait for windows information “New Hardware Found USBASP”. If device isnt detected, check the board for errors and reconnect again;

  • After device is detected Driver setup wizard opens. Select where USBASP driver is located. It is in directory you’ve downloaded with firmware. If you unpacked in C: drive, than driver should be in C:\usbasp.2006-12-29\bin\win-driver\ and press next:

instaling_uasbasp.jpg

 

After successful setup you should see following view in device list:

USBASP_Device_ready.jpg

 

When device is unplugged – the device disappears from the device list. This is it with first stage. Now it is time to start programming with usbasp adapter, but this will be discussed later.

You can download various PCB and circuit configurations directly from http://www.fischl.de/usbasp/ site. Good luck.

Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
 |  TrackBack URI for this post

New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,
Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …
Programming AVR ADC module with WinAVR,
Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut …
New on WinARM Tutorial
What are differences between WinARM and WinAVR,
Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …
LPC2000 watchdog timer,
As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount …

56 Responses to “Building and installing USBASP-USB programmer of AVR microcontrollers”

  1. Abhijit K Says:

    Excellent solution for quick ISP programming with laptops! thanks very much..

  2. goldenstar Says:

    help me.i make a USBasp from Thomas Fischl pages. but it dont work.WinXP dont recognize device.Win2000 show Unknow Device.who can help me???

  3. hr paul Says:

    try to connect it through a USB hub it may solve you problem i don’t know why

  4. M.C. Says:

    I believe description of SCK frequencies is wrong. USBasp indeed has 2 programming frequencies – high when jumper disconnected and low when connected. These frequencies are 375kHz and 8kHz, however. In order to use 375kHz speed, target MCU’s clock frequency has to be at least 1.5MHz (SCK * 4, same rule for low speed).

  5. scienceprog Says:

    Thank you M.C. for this notice. That was big mistake in description. Now it is corrected.

  6. One click project with USBasp programmer - Scientific, embedded, biomedical, electronics contents. Says:

    [...] systems including Linux, Mac OS X, and windows. How to assemble this simple programmer read previous article in this site or go to original site of Thomas [...]

  7. Delson Says:

    This article is quite interesting and well explained. But I am a newbie, I want to build this programmer. It will be my first ever. But i was quite surprised/confused when i read the following: “To make this adapter work you need to program Atmega8 with driver firmware”.
    How do i program the atmega8? I want to build this circuit to be able to program amtmega’s. If i have to build another programmer then what’s the point?

  8. vivek Says:

    i bought atmega 8L by mistake instead of atmega8.
    Is there a way out to construct the ubasp mentioned above eith atmega 18L? (since they cannot be clocked to 16MHz)

  9. vivek Says:

    delson you need to make a small bsd programmer for it.

    its easy you need to plug in some wires in ur parallel port and connect them to ur atmega8

  10. OvidiuP Says:

    I tried this schematics and didn’t work. my atm8 crashed atfer firmware update :(
    I had a solution for usb (i have a laptop too.. only USBs). My card is suporting programmer, communication and power suply. :)

  11. Isaac Abraham Says:

    Sorry to ask the naiive question:
    (1) how do i unpack the tar files from fischl’s website? command line and switches please.
    (2) Can anyone please explain how to load the ATM8 with the firmware, can it be done from WINDOWS…?
    I’m new to this and would greatly appreciate the help.
    thanks. -isaac

  12. scienceprog Says:

    Hy,
    1)I simply use Total Commander unpack feature. But tar files are supported bu WinRAR program – so there should be no problem to extract simply by clicking right mouse button.
    2)It depends on what programmer you use… if it is simple COM or LPT ISP programmer you can use PonyProg software.

  13. Isaac Abraham Says:

    Hi,
    When i try to unzip (with winzip) i get “error reading header after processing 0 entries”. could there be a problem?

  14. Isaac Abraham Says:

    I downloaded winRAR and was able to untar. Please ignore my winzip question. Thanks for the help and pointers

  15. David Infante Sànchez Says:

    I built this programmer using atmega 8, and this microcontroller was programmed using my AVR Dragon; I’v installed driver, and I’ve checked all connections, but when I try to program a microcontroller with USBASP allways says the same error about “signature bytes” sometimes it reads 0 and F. I’am using slow clock, I don’t know why I can be able to program the microcontroller, Can any body tell what coulb be wrong? Thanks

  16. Sajjad Says:

    Hello,
    This article is useful and well explained !
    I made this project and I installed this on my PC .
    Now I need a little help in bascom-AVR software . I do not know which programmer should I select in Bascom-AVR software ( option >> programmer )

    Please find this picture :
    [IMG]http://i32.tinypic.com/21l7s3n.jpg[/IMG]

    Please tell me and help me to solve this problem .
    Thank You,
    Sajjad

  17. Jean-Christophe Says:

    Hello,
    I have a problem on my laptop: Windows does not detect the programmer (unknown USB peripheral). On the other hand, the programmer well work on my desktop computer… What does it occur ?

    Thank You,

  18. Ashwati Says:

    Thank you for the article. Well put.
    I have a few questions:
    1. Are the jumpers necessary? Can they be over riden with open/shorts according to required settings?

    2. The USB device will be detected even without a target board?

    Thank You

  19. Norbiv8 Says:

    Hello,

    i have a problem with programming atmega8. I use paralel programmer with uisp software. Firmware hex file programming ok, but i dont know values of fuse bits. Somebody can send me the fusebits values?

    Thank you

  20. Omiya Lee Says:

    Hello,
    I have sucessfully made it but encountered a strange phenomenon. I can 100% re-program all chips on hand but could not program any new chips (just bought). Avrdude says “Such chip could not be initialized or recognized”. I could only get it programmed once with other programmer then I can use it with this programmer.
    Thanks a lot for your help!

  21. virgoptrex Says:

    @Omiya Lee,

    Adding an external crystal (Try 3MHz to 8 MHz) may solve your problem. You need to have external crystal there. I think the program sets fuse bits without giving any indication to the user.

  22. SaLIk Says:

    Hi,
    I have made this programmer, but now i have a poblem. On my “desktop” PC programmer work ok (USBasp is detected). On my laptop (with the same drivers) i get message “Unknown device”.

    Any ideas?
    Thanks

  23. SaLIk Says:

    Hi,
    I have a new facts. I was tested the programer in 2 other PC’s (desktop and laptop) and it works fine.

    I think the problem is my Windows.

  24. SaLIk Says:

    Hi,
    problem was solved with adition two zener diodes (3V6) parallelly to data wires (+/- D).

    By the way, for programming a “low speed” AVR (mega8 with using internal 1MHz oscilator) you must short the SCK jumper.

    That’s all. Sorry for my english ;).

  25. jj Says:

    hi,i see not recognized device on my laptop,but on my desktop it works perfect.

  26. Anand Says:

    Hi,

    I have made the circuit as said and inserted in the USB port of my PC. The PC detects it but coudn`t able to install the Device driver properly.
    What can I do? Please suggest me in this regards.

  27. Rakesh Says:

    i have a USBasp programer with atmega8
    can i use this programer to program a atmega8 micro-controller.

  28. avinash Says:

    Hello Every One

    I have recently written a GUI Software for driving USBasp compatible USB Programmers. It is much easier to use than the avrdude or avrdude-gui.

    You can download it free of cost from here

    http://extremeelectronics.co.in/avr-tutorials/gui-software-for-usbasp-based-usb-avr-programmers/

  29. Rakesh Says:

    i burn hfuse and lfuse in Atmega8 as HFUSE=0xc9 LFUSE=0xef. now it is not working with usbasp can one tell me the solution…

  30. Ketan Kothari Says:

    Hi Rakesh i can solve your problem for not working of atmega8 because by adjusting the fuse bits you have switched off the spi enable pin of the controller therefore the usbasp is not working
    Know you have to reburn the fuse bits by using a universal programmer and switch on the spien bit then it will start recognizing the device.

    Try it…

  31. Rakesh Says:

    Hi..
    Ketan can you tell me about universal programmer.
    and how to use it.
    Thanks

  32. avinash Says:

    @Rakesh

    You have just enabled external crystal oscillator. Just put a crystal (say 12MHz) on XTAL1 and XTAL2 along with 2 22pf capacitor(to GND) and it will start responding again !

    :)

  33. Ehab Says:

    please check this

    http://dhost.info/bdrelectronics/Tools.html

    New HW for the USBasp able to program target device with VCC down to 3v.
    the Resistors on the output of the programmer and the protecting diodes
    in the target device limit the voltage to the VCC of the target
    and for the input to the programmer, the ATmega8 in the circuit see
    the voltage from 3 to 5V as a logic high

  34. AL_AMIN Says:

    in the pc using the usb 1.0 laptop while using usb 2.0, can be overcome by using a usb hub

  35. meysam Says:

    I use usbasp to program AVR in windows. But now I want to use it in Linux (UBUNTU) . I know Avrdude can work with usbasp but avrdude cant find usbasp. Should I install a driver for usbasp in Ubuntu? If yes, How can I download and install it?

  36. Srdjan Says:

    A suggestion: I put an alternate power source for the USBasp using 7805 and a 9V battery. I have a switch to select USB power or battery power. My laptop (dell inspiron 1525 recognizez USBasp only when battery powered.

  37. ARMAGON Says:

    Dear Sir:

    Could you be so kindly to inform me about the configutations bit for ATMega 48 and ATMega8, my programmer ask me for them (To be able to program the CHIP with firmware)
    ATMega8 ATMega48
    RSTDISBL
    WDTON
    SPIEN
    CKOPT
    EESAVE
    BOOTSZ1
    BOOTSZ0
    BOOTRST

    BODLEVEL
    BODEN
    SUT1
    SUT0
    CKSEL3
    CKSEL2
    CKSEL1
    CKSEL0

    Thanks

  38. Richard Says:

    Hey all.

    Could you be so kindly to inform me about the configutations bit for ATMega 48 and ATMega8, my programmer ask me for them (To be able to program the CHIP with firmware)
    ATMega8 ATMega48
    RSTDISBL
    WDTON
    SPIEN
    CKOPT
    EESAVE
    BOOTSZ1
    BOOTSZ0
    BOOTRST

    BODLEVEL
    BODEN
    SUT1
    SUT0
    CKSEL3
    CKSEL2
    CKSEL1
    CKSEL0

    Please, i’m having same problem…not knowing which config bits to program. Please be so kind to help with some info on that matter.
    Thanx

  39. Richard Says:

    OK, never mind…LOL. I got it to work!!!!! The config bits in Ponyprog should be set to the following…. TICKED(selected) : CKOPT, BOOTSZ1, BOOTSZ0, BODEN, SUT0. The rest must be left “unticked” Hope this helps you “ARMAGON”

  40. sandeep Says:

    Is it possible to program the avr MCU to enable xtal oscillator when you are using pony prog with the target MCU not using the XTAL oscillator

    What should be the value of the fuse bits value to be loaded into the firmware for USBASP.

    Can any one please help me with the simple PCB desin for USBASP those in homepage are quite harsh and cannot be made at home.

  41. C-ho Says:

    Hi,
    this article is very interesting for me but im a newbie too..can someone tell me how to program this usb asp using CodeVision AVR??
    thanks before..

  42. Sera Says:

    what is JP1, JP2, JP3

  43. wibi Says:

    to Sera:
    JP means jumper or simply a “switch”
    if you connect the JP1, it means you’re supplying target board with 5V voltage from USB
    JP2 must be connected IF you want to update the atmega8’s firmware. and JP3 is connected if you want to slow down the programming speed (i don’t know exactly why the speed should be slowed down)

  44. wibi Says:

    to Richard and other guys who still have problems with usbasp fuse bits settings:

    just try to program the firmware with avrdude (you should install winAVR, i suggest the 2009 version)

    to program the firmware:
    Use parallel port/STK200 programmer to flash your atmega8 in another circuit (breadboard or PCB is OK)

    open the command prompt, move to the folder where you put the firmware from Thomas Fischl’s website, and type:
    “avrdude -c stk200 -p atmega8 -P lpt1 -U flash:w:main.hex -U hfuse:w:0xC9:m lfuse:w:0xEF:m”

    it’s automatically flash the firmware and set the fuse bits.After this, just move the atmega8 to your usbasp circuit, and see what happens when you connect it in your PC/laptop. I’ve tried this and i’m so happy to see the result…
    :)

  45. dodi Says:

    hi all… just build usbasp and so far windows never detect my usbasp, hundred time i try , reprogramming, reconfigure the fuse, still didn’t work…windows wont detect it, i checks nothing wrong in connections , i cant found dioda zener 3.6V here, is that could be my only problem..?? do i have to add dioda to both D+ D- parallel ??

  46. scienceprog Says:

    Did you try on different PC?

  47. dodi Says:

    Yups… i plug it on my Acer travelmate 3000 nothing detect on usb, then i plug it on my desktop computer; detected but system said \usb device malfunction\, unknow usb divice, system don’t ask driver.
    Thanks for your response please help me, sorry my english not clear, i am from indonesia.

  48. wibi Says:

    @dodi:
    yes, you have to add the 3,6V zener to the D+ and D-, it’s important for adapting the voltage level of the USB system.
    The first time i try, i have the same problem with u too. But there’s nothing wrong in my circuit. I’ve added the 3,6V zener. And i asked help to Sajid Muhaimin’s website :
    http://sajiduc.blogspot.com/2009/02/my-usb-programmer-is-working-in-vista.html
    And he said i have to program the fusebit (hfuse and lfuse) to be 0xc9 and 0xef. And i made it.

  49. ax Says:

    why my comp not detected new hardware?

  50. dodi Says:

    hi wibi… now i add 3.6 zener to the D= and D- , but system still not recognice it “usb device malfunction “… how can i program the Hfuse and lFuse on ponyprog…??

    -dodi-

  51. wibi Says:

    Open the Command menu and select “Security and Configuration bits”. There are some checkbox in it but i found no place to write hexadecimal code for the hfuse (0xc9) and lfuse (0xef). So I suggest you to use avrdude or progisp cz it’s easier to write the fusebit settings.

    if you have avrdude installed, open the command prompt, go to the folder where you put the “main.hex” file and just type

    “avrdude -c stk200 -p atmega8 -P lpt1 -U flash:w:main.hex -U hfuse:w:0xC9:m lfuse:w:0xEF:m”
    (if you use the parallel port programmer)

    or use progisp software, download it at
    http://ftp.qrz.ru/pub/hamradio/microchips/progisp166.rar

  52. wibi Says:

    sorry i forgot about this.
    put “-U” just before “lfuse:w:0xEF:m”

    if you can’t download the file, remove the “/progisp166.rar”on the link above, and search the progisp166.rar in the page

  53. Dodi Says:

    OK wibi , my usbasp now detected the problem is on xtal, i use xtal with 14 MHz…. heheh it make serius problem, it make baud rate to usb not corect.
    After i replacing the xtal with 12Mhz USBASP detected but when i programming the target chip the problem now is cannot communicate with target chip…any suggest..??

  54. Bala Says:

    Hi i build my 1st programmer ie USB AVR ISP…..
    As discussed above the same problem programmer is not detecting…..What can i do pls explain me clearly….. and also abt H fuse & I fuse……..

  55. Mb Says:

    I have made an atmega32 board, i have used 8 Mhz external crystal. I am using ponyprog to burn the code. I have also set the frequency in ponyprog as 8 Mhz, but it gives me slow output. I checked, if I wrote codefor it to wait for 1 sec, it waits for approx 10 secs. Please help me out with it.

  56. shervaan Says:

    hey guys. i just built that usbasb programmer and now my laptop with its 32x vista cant recognize it and prompt me this device malfunctions…. im pretty sure that used 2 3.6v zener diods. and q is 12mhz. i tried it on desktop with xp. but its still Not working. can you help me to make it fixed?

Leave a Reply