There are a number of reasons that I use Atmel AVR microcontrollers for my robots and electronics projects:
The STK500 (or ATSTK500) is a popular programmer development system starter kit from Atmel. It costs $79 from DigiKey or Mouser Electronics. The base programming board works with most, but not all, of the ATtiny and ATmega microcontrollers (MCUs). You need to attach your own 10V-15V DC power supply and you'll need to purchase a USB-to-RS232 serial adapter if you have a modern computer that lacks the classic DB9 serial ports.
The STK600 is a newer programming system from Atmel that also supports the XMEGA and other Atmel chips. Unlike the STK500, the STK600 comes with a USB port. However, the STK600 requires the ATSTK600-DIP40 $99 set of socket adapters (routing boards) to connect directly to any DIP packages.
I wanted to create some robotic and electronic projects using the new 14-pin and 20-pin DIP microcontrollers, specifically the ATtiny84 and ATtiny861. That means $300 for a STK600+STK600-DIP40 or $79 for the new STK505 adapter to attach to my existing STK500 programming board. Fortunately, there is a much lower-cost choice for do-it-yourselfers.
All of the Atmel microcontrollers include an in-circuit-programming (ISP) capability. That means they can be programmed even when installed on the destination project circuit board. If you design an ISP connector into your ATtiny84 or ATtiny861 project board, then you don’t need to purchase any adapters for your STK500 or STK600. In fact, you can even use a dirt-cheap third-party programming cable instead of an Atmel-brand programmer, if you so choose.
Sometimes a project doesn’t even have room or acceptable trace paths to permit an onboard ISP. In this case, you can create your own adapter board that consists of little more than a DIP socket and ISP connector, for around $5. You can even get slightly fancy (like I did) and add feet, an LED, and a capacitor or two.
Homemade ATtiny861 and ATtiny84 adapter board (right) via ISP ribbon cable to the Atmel STK500 programmer (left).
Notice that the ISP6 programming cable supplied with the STK500 programming board makes the connection to the homemade STK505 replacement board. The ribbon cable supplies both power and programming instructions.
On my board, there is a 14-pin DIP socket for the ATtiny24/ATtiny44/ATtiny84 chips and a 20-pin DIP socket for the ATtiny261/ATtiny461/ATtiny861 chips. (You can only use one socket at a time.)
Adapter matches the ISP6PIN and socket direction of the official Atmel STK500 board.
The pinout of the ISP6 header is identical to the ISP6PIN header layout on the STK500 board. Additionally, the DIP socket direction matches between the two boards.
I started with a bare protoboard, Wright Hobbies PB10 for $3. The Wright Hobbies board is superior to most perf boards in that the holes are plated through. You can solder a component or wire to either side of the board and it will connect with adjoining grouped bus holes. Because this is a prototyping board, you can add headers or pins to your own STK505 replacement adapter to monitor pin states, if desired.
Unlike the real Atmel STK505 adapter that has other features, my substitute board only supports programming two sizes of DIP chips. But, mine is cheap.
IMPORTANT: This is the wiring diagram as seen from the underside of the board, because that is how you will insert the wires into the breadboard.
The green row numbers correspond to the silkscreen numbers on the Wright Hobbies breadboard. Ignore them if you’re using a different breadboard.
STK505 substitute adapter schematic for programming ATtiny84 and ATtiny861 microcontrollers. View from underneath circuit board. (Corrected MOSI/MISO swap on ATtiny861 thanks to Doug Dotson)
Here is a view above and below the finished soldered breadboard. Click on the following image to see a larger size photo.
Thumbnail image of an STK505 replacement implemented on a breadboard. Click for larger photo.
I usually clock ATtiny chips through their internal oscillator, rather than a crystal. However, a recent project required maximum speed.
Adding a crystal ATtiny84 programming board.
There’s room on the breadboard to add a couple of 18 pF capacitor and a socket for a crystal. The ISP doesn’t connect to either of the XTAL pins on the ATtiny84, so the additional components shouldn’t affect anything except when the chip has been configured to use an external clock source.
The wires and capacitors underneath the breadboard make for an uneven surface. The first time I tried to install a microcontroller in the adapter, I noticed that the wobbling was really annoying. I feared that repeated pressure would bend a component or wire underneath the board, which would result in a short or broken circuit.
I had the choice of buying or making a project case, but that is either an additional expense or a lot of work. Or, I could have attached those sticky black rubber feet or bumpers to the bottom of the board.
Nylon screw and hex tapped spacer for simple PCB feet.
Instead, I grabbed four #4-40 nylon screws and hex threaded standoffs (Mouser 561-L4.25, DigiKey 1902AK-ND, McMaster 92319A617) from my robot fastener collection. Although they don’t protect the board against spills or stray screwdrivers, they do keep the board raised and level.
The term “hex” refers to the outer shape having six sides, which is easier to grip than a round spacer. The term “threaded” or “tapped” indicates that it has threads on the inside that mate with a screw, so that they will connect together similar to a screw and nut. The terms “spacer” and “standoff” are often used interchangeably, although standoff usually refers to the threaded variety or where a male threaded screw is molded to one or both ends.
The screw and standoff:
That’s it for the STK505 replacement board. The second half of this article describes a simple adapter board that you can plug into the STK500 to quickly configure it to program 8-pin microcontrollers, such as the ATtiny24, ATtiny44, and ATtiny84.