# Introduction

This is part 2 of my playing around with AVR microcontrollers. Last time, I had a basic setup which could program an AVR using the Arduino ISP. I used it to drive a simple 7-segment, multiplexed 4-digit LED display. This is a follow up where I try out some of the other features the ATTiny24A has to offer. I also decided to invest some money in an AVR Dragon programmer/debugger so I'll go over some basic playing and setup with this device. I'll also discuss some of the problems and pitfalls I've encountered along the way.

# AVR Dragon Setup

The AVR Dragon is a decently low-cost AVR programmer/debugger. It supports a wide variety of programming and debugging capabilities (as far as I know, every AVR protocol is supported). This includes the high-voltage programming capabilities used for fixing fuse problems with certain AVR devices. Even though the product is made by Atmel, it comes in a very hobby-like package. The device doesn't come with any cabling required to use it, nor does it come fully populated with all the headers. It doesn't even come with a case, you just get a bare PCB device.

Despite these faults, it isn't too difficult to setup the device to use. What other items you will need (including what it's used for):

• USB A-B cable. This is used to power the AVR Dragon/communicate with it.
• 6-pin 2x3, 0.1" pitch female-female cable. I had a hard time finding a cable which could be used for this so I decided to make my own. This is used for SPI programming, aWire debugging, PDI debugging, and debugWIRE debugging. Note that the 5V AVR Dragon power supply for target boards also has the same connector, but you don't necessarily need the full six pins since half the pins are ground and the other half are 5V. Since I am making my own cable, I decided to make it so the AVR Dragon end has a solid 6-pin 2x3 connector. On the other end, I put individual female connectors so I can have any cable configuration on the target board. This is not a requirement, but it will make programming/debugging chips on a breadboard possible/easier rather than a fixed 6-pin connector. As a note, it's not required that this be a female-female cable, only the AVR dragon side needs to have a female connector.
• 10-pin 2x5, 0.1" pitch female-female cable. This is used for JTAG programming/debugging. Again, I chose to make my own cable with the same 10-pin solid connector on one end and individual connectors on the other end. Note that not all 10 positions need be loaded, only 8 are and arguably you might be able to get away with fewer.
• 20-pin, 2x10, 0.1" pitch female-female cable. This is used for the high-voltage serial/parallel programming. What I believe the primary use of this interface is for is to reset fuses if you accidentally set them incorrectly and brick your device. Again, I have a fixed 20-pin connector on one end and individual pins on the other.
• 20-pin, 2x10, 0.1" pitch male-pin rectangular connector. The AVR Dragon does not come populated with a header for the high-voltage serial/parallel programmer pins, so if you need this functionality you'll need the header (or solder directly onto the board).
• 40-pin, 2x20, 0.1" pitch male-pin rectangular connector. This is for use with the on-board prototyping area. Each pin matches each of the various pinouts for any chip attached to the prototyping area.