How to update AVR USBasp firmware to latest version

The common reason why you would like to update this firmware is unlock slow-sck function for cheap (e-bay or Aliexpress) USBasp programmers, like this one on the picture. The slow-sck function allows to program AVR chips running at very low frequency clock source (i.e. 128kHz).

When your USBasp programmer prints that warning it means that firmware update is required!

avrdude -p attiny13 -c usbasp -B 1024 -F -P usb

avrdude: set SCK frequency to 500 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x685ba2
avrdude: Expected signature for ATtiny13 is 1E 90 07

avrdude done. Thank you.

What You Need

  • two USBasp programmers (first one require update, and second to burn the chip of first one)
  • one jumper, two 2×1 pin headers and soldering iron (optionally, depends on your programmer type)

USBasp Programmer Preparation

We need to set a jumper JP2 for USBasp programmer we want to update. This jumper will enable “ISP self-programming”. It may happen that you will need to add to PCB a missing pin-header for a JP2 . Same with pin-header for a jumper JP3 which will enable “Slow-SCK” when we will have firmware updated. Eventually, make a short connections on PCB if there is no place for pin-headers.

Figure-1 AVR USBasp programmer board (source: tosiek.pl)

Figure-2 AVR USBasp programmer schematic

Downloading the latest firmware

The software is maintained by Thomas Fischl, the author of USBasp programmer, and can be found on his official download page – https://www.fischl.de/usbasp/.

cd $HOME
wget https://www.fischl.de/usbasp/usbasp.2011-05-28.tar.gz
tar -xvf usbasp.2011-05-28.tar.gz

Flashing the chip of USBasp programmer

At this step we’re sure that jumper JP2 of the first programmer which we want to update is on its place (while JP3 is not set). Now, we will use second USPasp programmer to burn the new firmware into first programmer’s chip. So, we need to connect first USBasp programmer and second programmer using IDC-10 sockets and then connect second programmer to a computer using USB socket.

cd $HOME/usbasp.2011-05-28
avrdude -p atmega8 -c usbasp -U flash:w:bin/firmware/usbasp.atmega8.2011-05-28.hex:i -F -P usb

Verifying

After firmware update, we need to unset jumper JP2 and set JP3 (Slow-Clock).

avrdude -p attiny13 -c usbasp -B 1024 -F -P usb

avrdude: set SCK frequency to 500 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9007 (probably t13)

avrdude: safemode: Fuses OK (E:FF, H:FF, L:7B)

avrdude done. Thank you.

That would be all! Now, if JP3 is set, you can programm AVR chips running with very low frequencies.

13 thoughts on “How to update AVR USBasp firmware to latest version

  1. Hi,

    FYI, I just finished making the USBasp firmware WCID compliant https://github.com/dioannidis/usbasp . This means that USBasp doesn’t need driver on Windows any more. No more Zadig, signed libusb etc. It uses the native Windows winusb driver.

    A WCID compliant device ” … is an USB device that provides extra information to a Windows system, in order to facilitate automated driver installation and, in most circumstances, allow immediate access. ” . You can read more here https://github.com/pbatard/libwdi/wiki/WCID-Devices .

    If you use or used or plan to use V-USB on a project, you can be sure that your windows users will not have any problem again. The hard work was done by by Marius Greuel @mariusgreuel ( https://github.com/mariusgreuel/USBasp ). Mine is a non intrusive version, using an unaltered V-USB with no changes in it’s usbdrv code.

    regards,

      • Hi,

        Thank you !

        FYI, I implemented UART support, also, for the USBasp, using usb control transfers. Because of that ( No CDC ) I wrote a dll and a GUI app, which can be used in windows and linux ( didn’t tried in mac ) to communicate with it but as the code is open source anyone can create his own communication library / app.

        Mind you, that, because of the timing constraints, based on my tests, only the 19200 baud rate, can be used reliably with a steady data stream. The 38400, 57600 and 115200 baud rates, if the data stream are short ( so it can be stored in the 128 bytes internal ring buffer without overflowing it ) are working also. Small tip, if one replaces the 12 MHz crystal with a 20MHz one, then a 38400 baud rate can be used reliably also but TPI programming is lost ( working on that ).

        My goal was to use only one inexpensive device, i.e. USBasp, for programming and serial debugging. If anyone is interested, I’ll upload the sources and binaries for both, firmware and dll / app in my github in a week or two.

        regards,

  2. USBasp can be programmed also with Arduino… I programmed my USBasp using avrdude, ArduinoISP and Arduino Nano. Another USBasp is not mandatory.

  3. Hello Lukas,

    can you please tell me what to do ?

    I follow your instructions, Chinese USBASP is flashed.

    BUT then the verifying process gives me that:

    avrdude: set SCK frequency to 500 Hz
    avrdude: error: programm enable: target doesn’t answer. 1
    avrdude: initialization failed, rc=-1
    avrdude: AVR device initialized and ready to accept instructions
    avrdude: Device signature = 0x656675
    avrdude: Expected signature for ATtiny13 is 1E 90 07

  4. Stupidest community ever, I have f**kn 3 arduinos and 1 USBasp , and all of their bootloaders are f**ked. And Now I need to buy another Arduino or, UsbAsp. F**k that. Get f**ked. F**kn imbeciles, year 2020, still we need billions of tiny devices to update each others firmware. A fuckn usb device needs another f**kn usb device to update itself. Bullshit

  5. Could you explain why you are using avrdude with “-p attiny13” in some places and “-p atmega8” in others?

  6. Hi Łukasz,
    thx for this blog post. It seems like solution of my problem.
    My question is: Is it necessary to have one ORIGINAL programmer, or the solution is functional with two Aliexpress USBasps?

    P.S. Captcha is terrible

    • Hi Petr, I’ve tested scenario with two aliexpress USBasps and it works fine.

      P.s. I know that captcha is ugly solution but it helps me a lot to filter comments.

Leave a Comment