This week I’ve been trying out a new low-cost AVR programmer from Adafruit Industries, and it looks like a winner. The USBtinyISP AVR Programmer is an open-source, USB, in-system programmer (ISP) that you can get as a kit for $22. The design is simple, straightforward and fairly easy to assemble. It also manages to incorporate a couple of important features that I have found to be missing from the low-end USB AVR programmer from Atmel, the AVRISP MkII, while coming in at only half the price.
The kit does not contain printed instructions, but a detailed set of build instructions is part of the project documentation. Since this is an open-source project you certainly don’t need to buy the kit, you can just build it on your own. However, there is a potential bootstrap issue here: one of the things that you will need is a pre-programmed AVR microcontroller– so buying a kit is a very good idea if you don’t already have a programmer.
Here are the contents of the kit. Among other things, notice the hard plastic case, the printed circuit board, the USB-B connector, the pre-programmed microcontroller with socket, and ribbon cables. Assembling the kit was pretty simple, and I’m not going to go into details about how or what is done, since that is documented quite well on the project site. The total assembly time for the kit was 34 minutes, counting time looking at instructions. About 20 minutes of that was populating the circuit board and soldering, and the last 14 minutes were connecting the ribbon cable ends and snapping the case together (that is the hardest part of the kit). All of the soldering is easy through-hole construction, no surface mount anything.
Assembled, the box is slightly smaller than the AVRISP MkII, and has a similar design: USB-B connector on one end, ribbon cable on the other end. However, you might notice that there are actually two ribbon cables coming off of the USBtinyISP. That’s because there are really two different standard ISP connectors, 6-pin and 10-pin, and the ribbon cables lead to one of each type. This allows you to program AVRs on development boards and target boards, whether they have the 6-pin or 10-pin connector. Two LEDs poking through the case indicate power and programming activity. (Unfortunately, the programming indicator is just on or off. As a fan of blinkylights, I assert that it should at least blink during programming. )
The simplest usage of a programmer like this is to hook the USB cable from the computer to the programmer, and then to hook one of the ribbon cables up to a simple programming target board like the one shown here. At a bare minimum the board needs to provide a place to put the AVR chip itself, and an ISP header (either 6 or 10 pin variety). We also need to provide the microcontroller itself with power, which is done in the case shown here with a 3 X AA battery box.
The other neat feature of the USBtinyISP is that it provides an option, with an accessible header jumper, to provide power from USB to the target board. That makes it so that you don’t even need the battery box at all. If your circuit uses less than a few hundred mA, you can probably get away with powering a few other external components as well, so long as you are using a high-power USB port. (If not, keep it under 100 mA total.)
( If your target board has independent power, you do of course need to disconnect the USB-power jumper.)
The biggest caveat to this programmer is that it is not supported by the current release of avrdude, the free tool commonly used to download compiled code into the flash memory of AVR microcontrollers. On the bright side, patched versions of this software are available for download here, and seem to work just fine. There is also a piece of “bridge” software allowing this programmer to be used with AVR Studio, in case you use that. While I haven’t tested the bridge, I have tested that the patched version of avrdude works transparently on both Mac and Windows systems. (For clarity, I tested it with a direct (unix-layer) install on an Intel-based Mac. I also tested it on a fresh install of OSX-AVR on a PowerPC Mac, using XCode, and on an XP machine using a fresh install of winavr.) The plan in the long term is to merge the patch into the main branch of avrdude development, which ought to make things a little easier yet. In any case, you will need to know that the avrdude “programmer type” for the USBtinyISP is ‘usbtiny’.
One thing that’s particularly sweet about this setup is that it’s an open-source AVR programmer that itself runs on an AVR, an ATtiny2313, which happens to be in a socket. That means that if you want to change the what the programmer does, it’s simple: just program a second ATtiny2313 with the modified firmware and swap it out. If you do this, I suggest keeping the chip with the original firmware somewhere safe and well labeled– just in case.
In conclusion, the USBtinyISP looks like an excellent programmer for the price, and it’s furthermore an excellent option for beginners that want to get into AVRs. Assembly is no big deal, and the software patches that are needed are nowhere near as difficult as those for any Microsoft product. I am particularly in favor of the versatility that the USBtinyISP offers, with the multiple ISP connectors and the jumper allowing the programmer to power the target. The mind boggles how those features so simple and useful could have been left off of the versions by Atmel.
Update: The USBtinyISP is supported by avrdude as of version 5.5.