SACC

/ / navigation

target Board
build it
Code
A Project

/ / Minimalist target boards



This is a quick how-to guide on making ultra-simple development boards for programming AVR microcontrollers. Most recent-vintage AVRs can be programmed through an ISP (in-system programmer) connection; all that is really needed is a place for the chip to sit and a way to connect to the programmer. That's where these minimalist AVR "target boards" come in. These little boards cost only about $2 and don't take long to make.

There are two basic types of microcontroller programmer that you can imagine: one that has a socket for your chip, and one that hooks up to your circuit where your chip is installed. We're interested in the latter, the set of so-called in-system programmers, sometimes called in-circuit programmers. You can also get programmers with dedicated sockets, of course, but they are typically more expensive and are not fundamentally "better." With an in-system programmer, not only can you program microcontrollers that are in larger circuits, but you can also easily make programmer target boards with sockets, giving you the benefits of a programmer with a socket.

USBtinyISP, assembled

The new USBtinyISP AVR Programmer from Adafruit industries (Reviewed here) is probably a better choice for most applications. It comes as an easy kit and it includes both 6-pin and 10-pin interfaces. The killer feature versus the AVRISP mkII is that it lets you use the USB power to directly power your target board. Well, that and that it comes with both 6-pin and 10-pin ISP cable connections.



One other neat option (for some of you): You can use Arduino as an AVR-ISP programmer.

Previously we've mainly used "real" development boards that include power supplies, communications, and a crystal oscillator.

ATMEGA168, and its messy dev board

Typical varieties are these available from SparkFun Electronics, which are mostly made by Olimex. There is also an excellent board from Futurlec, and there are dozens of others from other sources as well. (Notably these excellent open-source reference designs by Pascal Stang.)

It's often overkill. In the dev board shown here, I'm only using the power connector, socket and the ISP connector of the original board-- none of the other features turned out to be handy for what I ended up building on this board.



Components - big board

Here are the components: Prototyping perfboard (BG Micro part number ACS1053, $0.99), a 2x3 DIP header (Part of BG Micro part number ACS1019, $0.33), and a 20-pin DIP socket (BG Micro part number soc1029, $0.55).

The first step is to position the socket and the ISP connector header on the protoboard, and then (important!) to mark one end of the ISP connector as being the end that contains pin 1. When you eventually hook up the ISP connector cable to the header, you will need to make sure that you have the correct orientation.

The next step is to determine how to hook up the pins of the ISP header to the pins of the socket. Atmel Application Note 42 describes the pinouts of the 6-pin and 10-pin ISP interface connectors. From above, they look like this:

The pins on the 6-pin interface are power (+Vcc) and ground, and the four "signals" of the ISP connector, which are called RESET, SCK, MISO and MOSI. You will notice that the 10-pin interface is just padded by a lot of fat-- it doesn't provide additional functionality.

(Note: The nature of the power (Vcc) line is context sensitive, and you will need to think about which way your power goes through that connector. If you are using the AVRISP mkII or most other programmers, the Vcc is expected to be provided from the target board to the programmer. This is used to indicate to the programmer that the target is "live" and ready to be programmed. If this is the case, you must provide a separate power source for the target board. If you use the USBtinyISP, you have the option to use the Vcc pin on the ISP interface to provide power to the target board. That option should be disabled if your target board does supply power to the Vcc pin of the ISP interface.)

Next, we need to identify the pins of the AVR that attach to those of the ISP connector. You can begin by looking at the datasheet for your particular flavor of AVR ( list here) and finding the six pins that match up to the names of the pins on the ISP connector. Here, I've highlighted the relevant pins of three AVR devices that I happen to like and come in 8-pin (ATtiny45), 20-pin (ATtiny2313) and 28-pin (ATmega168) DIP packages:



Many but not allof the AVR devices in a given package (e.g., DIP-8) share the same ISP connector pinouts, so these target boards can sometimes (with caution) even be used for different AVR microcontrollers. For example, the ATmega8, ATmega48, ATmega88, and ATmega168 share the same 28-pin pinouts. Note that in the figure above there are more than six connections to the ATmega168. That's because there are extra power and ground lines running to the analog circuitry of the chip, which should be wired up even when the analog section is not in use.

wired

Now that we know where the various ISP pins of the header and the chip are, we can wire things up. We need six wires (obviously)-- hook MISO to MISO, MOSI to MOSI, and so on, and solder up the lines. Remember to index the header from the end that you marked earlier, the end with pin 1.



Here's what the back side looks like; not much to look at!

Back side







Tiny target board