Summary of Simple USB AVR programmer, USBasp using ATMega8 microcontroller
The USBasp is a low-cost, firmware-only USB in-circuit programmer designed for Atmel AVR microcontrollers. It operates without a dedicated USB controller and supports speeds up to 5kBytes/sec across Linux, Mac OS X, and Windows platforms.
Parts used in the USBasp Programmer:
- ATMega88 microcontroller
- ATMega8 microcontroller
- Passive components
USBasp is a low-cost USB programmer for AVR microcontrollers. Its hardware is an ATmega8 or ATmega88 with a few passive parts, and it uses a firmware-only USB driver, so no special USB chip is needed. It works on Linux, macOS and Windows and is supported by avrdude. This page covers the ISP connector pinouts, the avrdude commands and what to do when it will not connect.
- USBasp programs AVRs over ISP using four signals: MOSI, MISO, SCK and RESET, plus power and ground.
- The original author quotes programming speeds up to about 5 kilobytes per second.
- Use
avrdude -c usbasp -p m328pand change the part name for your chip. - Clone boards often have a slow SCK jumper for chips running at a very low clock.

ISP connector pinouts
| Signal | 6 pin header | 10 pin header |
|---|---|---|
| MISO | 1 | 9 |
| VCC | 2 | 2 |
| SCK | 3 | 7 |
| MOSI | 4 | 1 |
| RESET | 5 | 5 |
| GND | 6 | 4, 6, 8, 10 |
These are the standard Atmel ISP layouts, with pin 1 marked on the connector. Always match pin 1 and check against your board before connecting, because some clone cables are wired differently.
Connecting to a bare ATmega328P
| Signal | ATmega328P pin |
|---|---|
| MOSI | 17 (PB3) |
| MISO | 18 (PB4) |
| SCK | 19 (PB5) |
| RESET | 1 |
| VCC | 7 and 20 |
| GND | 8 and 22 |
avrdude commands
avrdude -c usbasp -p m328p # test the connection and read the signature
avrdude -c usbasp -p m328p -U flash:w:blink.hex:i # write a program
avrdude -c usbasp -p m328p -U lfuse:r:-:h # read the low fuse byte
avrdude -c usbasp -p m328p -B 32 # slow the bit clock for a slow target
These are standard avrdude options; we did not run them on a physical USBasp. The part name for other chips is listed by avrdude -p ?. Use the -B option, or the slow-SCK jumper where fitted, when the target runs from a clock slower than about a quarter of the programming clock; a factory-fresh 1 MHz ATmega328P is the usual case.
To check what a fuse byte means before you write it, use the decoder script on our avr-gcc page.
Drivers
| System | Notes |
|---|---|
| Linux | Add a udev rule so avrdude can open the device without root. |
| Windows | USBasp uses a generic USB driver; a tool such as Zadig is commonly used to install it. |
| macOS | Normally works with avrdude without extra drivers. |
If it will not connect
| What you see | What to check |
|---|---|
| could not find USB device | Cable, driver or udev rule. |
| target doesn’t answer | Pin 1 orientation, target power, and the clock (try -B with a larger number). |
| wrong signature | Wrong -p part name, or a bad contact on MISO. |
| Works once then fails | A bad fuse change left the chip waiting for a clock that is missing. |
Quick answers
More from this site
- avr-gcc toolchain: build the hex file
- AVR SPI: the bus ISP uses
- Programming the ATmega128: another ISP example
Downloads and references
- What is the USBasp?
It is a low cost USB in-circuit programmer for Atmel AVR microcontrollers. - Does the USBasp require a special USB controller?
No, it uses a firmware-only USB driver so no special USB controller is needed. - How fast is the programming speed of the USBasp?
The programming speed is up to 5kBytes/sec. - Which operating systems does the USBasp work under?
It works under Linux, Mac OS X, and Windows. - What microcontrollers can be used for the hardware?
The hardware consists of an ATMega88 or an ATMega8 microcontroller. - Can I find more details about the project online?
Yes, more detail is available at Simple USB AVR programmer and USBasp using ATMega8 microcontroller. - Is the USBasp considered a high-cost device?
No, it is described as a low cost USB in-circuit programmer. - Are active components required besides the microcontroller?
The text specifies the hardware consists of the microcontroller and a couple of passive components.





