The USBasp is a really useful and quit inexpensive ICSP programmer that suits AVR 8 bit microcontrollers.
This article offers some hints on buying and using the USBasp.
There are lots of sellers of these on eBay, Aliexpress etc… but there are traps in buying them. I recall buying the USBasp with cable for less than $5, but they are more like double that now… or more.
Early versions of USBasp ran in a 4K chip, but the latest version requires an 8K chip. Do not buy one with a AtMega48*, but one with an AtMega8*.
They are almost always supplied with stale firmware, so you will want to upgrade it to 2011-05-28 (yes, it is old, but it is the latest) which supports the -B command line switch to slow down the SCK (see later discussion).
So, buy two, so you can use one to upgrade the other, and then switch them around and upgrade the second. If you have a spare Arduino Nano or the like, you could us it to build and run ArduinoISP (in the Arduino IDE examples folder) to do the once off upgrade of the USBasp.
Almost no one copies the original schematic exactly, in particular JP1, JP2 and JP3 from the original schematic might not be provided, and may have different designations. To upgrade one, you need to identify the equivalent to JP2, one pin of which is connected to the /RESET pin of the MCU, and JP2 must be connected for the entire upgrade process.
It is of advantage to buy one that has a shunt selectable 3.3V / 5V / NONE power to the target. Some have the facility using 0R pads on the PCB, but it is more convenient to use a shunt on header pins. One that has a plastic case probably does not allow changing the target power without breaking the case off.
You will probably buy one with the 10 pin ICSP connector and cable on it, so buy a 10P/6P adapter as shown in the pic to suite the boards with the newer 6 pin ICSP connector. The pic also shows two of those adapters with pogo pins inserted for programming boards that do not have the header pins installed and have either 6 PTH holes, or simply 6 pads. I have one of these 10P/6P adapters with the 6P locating key shaved off so it will fit one of the production Arduino boards (a UNO IIRC).
Some target boards do not have a keyed header shroud, be careful to establish correct orientation.
The USBasp shown in the pic has a shunt and header that allows selection of target power 5V, 3.3V or NONE.
WinUSB support of AVRDUDE and USBasp
I should mention an updated fork of USBasp that may be of interest to users of recent Windows versions: https://github.com/mariusgreuel/USBasp .
The combination of:
- AVRDUDE for windows v7 or later from https://github.com/mariusgreuel/avrdude; and
- updated USBasp with WinUSB support and WinUSB compatibility descriptor: https://github.com/mariusgreuel/USBasp
work conveniently with driverless installation of the USBasp under Windows.
This combination seems to work well, I have upgrade all my USBasps to mariusgreuel’s firmware and use his for of AVRDUDE (including copying it into the AVRDUDESS, which I hardly use).