Help: An Absolute Beginner's Guide to 8-Bit AVR Programming-AVR Dragon

 by PopSci
If you'd like to test the waters of microcontroller programming, the new AVR Dragon by Atmel Corporation is a nifty, low-cost entry-level development tool. Unfortunately, right out of the box, the AVR Dragon is not the definitive answer for the beginner looking for an all-in-one solution. Rather, the AVR Dragon is a great microcontroller programmer foundation, but it is seriously lacking in enabling the beginner to hit the ground running.

What is an AVR?

An AVR is a relatively inexpensive user-programmable microprocessor that can be integrated into just about any project that needs a brain. Unlike most computer/electronics terms, decoding the AVR acronym is tricky. While some Atmel AVR devotees will claim that it doesn't have a definition others will state with a straight face that it isn't even an acronym. Some microcontroller programmers think that AVR is derived from the initials of the engineers who designed the AVR--Alf & Vegard + RISC. After extensive research, however, the most believable definition could be: AVR = Advanced Virtual RISC.

Enter the AVR Dragon

Whether it's a marketing lapse or a brilliant design configuration feature, beginners should be aware that Atmel Corporation does not include several vital pieces of equipment in the AVR Dragon box.

Yes, the AVR Dragon is USB-powered and yes, there is a free programming application that can be used with the AVR Dragon; but, you will need to provide your own USB cable and you will have to download the latest version of AVR Studio from the Atmel Web site.

Furthermore, you will be required to solder several components to the AVR Dragon to enable it to work with the widest variety of 8-bit AVR products. These components enable the budding AVR user to program and emulate many of the products in the AVR device family. A properly configured AVR Dragon offers these programming interfaces:

  • In-System Programming
  • High Voltage Serial Programming
  • Parallel Programming
  • JTAG Programming

As well as these emulation interfaces:

  • JTAG
  • debugWIRE

Still the nagging question for the beginner is what components do I need for making the AVR Dragon easy to use?

 
Remove these adsRemove these ads by Signing Up

Step 1: How to Prepare the AVR Dragon for AVR Programming


2 hours
Cost: $56.67
Easy

Parts List


  • AVR Dragon (Digi-Key; ATAVRDRAGON-ND $49)
  • (1) AMP 6-Position, 2-Row, .100 Connector Housing (Digi-Key; A3032-ND $1.30)
  • (32) AMP 1-Position, .100 Connector Housing (Digi-Key; A26962-ND $11.12)
  • (38) AMP 15 Au, Crimp 27-32 AWG, Connector Socket (Digi-Key; A25955-ND $25.02)
  • (1) IDC Multi-Color 20-Position Ribbon Cable with 20-Position, 2-Row Socket (Digi-Key; M1AXA-2036R-ND $4.39)
  • (1) AMP 20-Position, 2-Row .100 Straight Breakaway Header Connector (Digi-Key; A26525-10-ND $1.21)
  • (1) AMP 40-Position, 2-Row, .100 Straight Breakaway Header Connector (Digi-Key; A26525-20-ND $1.61)
  • (1) ARES 40-Pin ZIF Socket (Digi-Key; A306-ND $12.02)

1-40 of 41Next »
Gonras says: Aug 14, 2011. 6:21 AM
I think I am stupid...
but on my avr dragon the "B" and "G" are both VCC the whole column 2,4,6 is vcc and 1,3,6 is gnd. did I miss something why you short that to the ground pin of the MCU?
Please help me out there!
IMG_0364.JPG
cdingdong says: May 11, 2011. 7:17 PM
There's actually no need to build that cable. All you have to do is by some jumper wires like these: http://www.sparkfun.com/products/8430 (Jumper Wires Premium 6" F/F Pack of 10). Just use as many as you need, as according to the AVR Dragon manual. I think it's ridiculous to make that $50 cable that involves crimping and stuff. Just get the Dragon and headers from Digikey and two packs of those jumper wires from Sparkfun, and you'll be set.
shanakaplus says: Apr 7, 2011. 9:09 AM
um looking for elevator avr program. Do you have example program ?
pannaguma says: Jul 8, 2010. 5:50 AM
Only $16? Thats a lot for something that originally costs just a couple of dollars.
nandki says: Jan 19, 2010. 11:40 PM
 I want a complete programmer, how much u wil cost it exactly
jonathanjo says: Sep 24, 2008. 1:17 PM
Hi popsci thanks for the help making sense of what needed doing! For what it's worth, I did mine with pcb-mount sockets instead of flying leads; see pictures. (NB: these are for Atmega168, which has a slightly different pinout, but intended to show the principle.)
dragon+proghead.jpgproghead.jpg
j0nk13 in reply to jonathanjoOct 18, 2009. 6:29 PM
I also like the perf board. I made mine with 2 40 position receptacles and the small one. The digikey part is A32967-ND for the ones I bought.
The Real Elliot in reply to jonathanjoJun 29, 2009. 9:14 PM
I really like your idea of making the "cable" on a perfboard. Very elegant.
the pro says: Jul 20, 2008. 8:59 PM
is there any robot that you can make out of old electronics?
The Ideanator in reply to the proJul 27, 2009. 9:13 AM
Yes! I bet if you used printer or scanner guts, you could make a perfectly good, high accuracy, sliding carriage for lightweight applications (one might need to program something anyway though)
The Real Elliot says: Jun 29, 2009. 9:19 PM
Just read through this, with a Dragon in hand, and I'll admit I was a bit confused in Steps 5/6, but I think I get it now. Basically, the Dragon provides you with your choice of programming methods, and is adaptable to various chips. This means there's some configuration that still needs to be done. Steps 5/6 are essentially making an on-board version of what I'd call a "programming cradle" or "target board" for the target chip. First, you solder in in a ZIF socket to the board. Then you create a cable that will route the pins from the ISP header to the right pins on socket for the chip that you're using. The confusion I had was figuring out that the 2x20-pin header mapped to the holes that you soldered your ZIF into. That's a cool design because it means you can switch between chip families simply by switching cables. But it means that you'll probably eventually need three cables: one for the 8-pin Tinys, one for the 20-pin Tiny2313 (as you made), and then one for the 28-pin Megas (see Jonathanjo's comment). Oh, and I just noticed that the pinouts for the ISP and JTAG headers are actually screenprinted on the bottom of the board. Thanks, Atmel!
tonecluster says: Apr 23, 2007. 2:24 PM
I was a little confused about the total cost at first until I realized the Dragon wasn't included. Total cost with Dragon: $105.67. Where do the connector housings go and why are 32 of the 1-Position, .100 Connector housings required? Do the crimp connector sockets require a special crimp tool?
tonecluster in reply to toneclusterApr 24, 2007. 2:33 PM
Ok, it's slowly sinking in. The connector housings are what's pictured in Step 5.

The digikey photo for part A26962-ND (the 1 position housing) has 12 pins, but I guess it's just a photo for that family of parts (looking at the data sheet, it's just one pin). I couldn't figure out why you needed 32x12 pins, but it's just 32 single-pin sockets. Yes indeed, I'm an absolute beginner. ;)

And I guess you need a crimp tool as shown in this link:
http://www.seetron.com/lcd_an2.htm
chrisoat in reply to toneclusterMay 15, 2009. 11:08 PM
Here's how to crimp using narrow tip (needle nose) pliers:

http://www.frontx.com/crimp.html
earthshine says: Apr 23, 2009. 6:41 AM
The best introduction to AVR by far, is the Arduino. Start there, then progress onto full blown low level AVR programming.
TheMadScientist says: Dec 11, 2007. 9:51 AM
is a zif socket REALLY nessecary? I mean cmon...
neuromonkey in reply to TheMadScientistMar 27, 2009. 10:03 AM
If you're programming a pile of chips, it sure is nice.
osgeld in reply to TheMadScientistAug 3, 2008. 8:21 PM
only if you like bending and eventually breaking off the pins of a 40$ chip
The Ideanator in reply to osgeldJul 27, 2009. 9:09 AM
If you go on Atmel's site and poke around, you can find their sample button and get em for free, I haven't tried it though, since I'm totally new to the programming scene, so you might have to pay for shipping. Oh, and FTR, Radio Shack, Digi-key & Mouser are overpriced
vonnieda in reply to The IdeanatorAug 10, 2009. 12:09 AM
Any recommendations on who isn't overpriced? I've always found Digikey to be really reasonable.
The Ideanator in reply to vonniedaAug 28, 2009. 7:44 PM
Oh, NVM, I didn't mean digi-key & mouser, i meant allied elec. I was commenting to osgeld that people can get free samples on some stuff, just don't sample too much and screw it up for everyone else
zachninme in reply to osgeldAug 7, 2008. 8:46 PM
I don't know what chips you're talking about, but the attiny2313, as demoed here, only runs about two bucks a pop.
twenglish1 in reply to zachninmeAug 30, 2008. 8:55 PM
yah where does he get his chips i can get about 15 attiny2313's for 40 dollars
eggman says: Mar 23, 2009. 5:05 PM
(38) AMP 15 Au, Crimp 27-32 AWG, Connector Socket (Digi-Key; A25955-ND $25.02) i cant order 38 on digikey,but 40 of them is only $16.24. is this right?
artha_sec says: Nov 8, 2008. 10:00 PM
HI I'm a new here, I'm an AVR user to, i think for some beginner, buy a Dragon or STK is quite expensive, I use an ISP programmer, for the example i use Ponyprog from <a rel="nofollow" href="http://www.loancos.com">Lan Cos</a>, its quite cheap, in my country Indonesia i made it only for 25000 Rupiah or about US$2,5, it cost just to buy a 74LS244 Buffer IC, and then it goes well, i use a AT MEga 8535 IC, For the code editor i always use AVR Studio from atmel, it's free and satisfied me, it's have a simulation window for every register and etc, so keep on going and PEACE FROM BALI INDONESIA...by the way, it's a good article...<br/>
astrozombies138 says: Jul 25, 2008. 3:43 PM
Does AVR only work with certain controllers? I keep coming across instructables that require programming controllers like a 555, and they post the code will that work with avr? or do i need a JDM programmer for that.
James (pseudo-geek) says: Jun 9, 2008. 12:06 AM
does anyone know how to use this to make a automated targeting system? I want it to recognize a moving object, and lock onto it. Once locked on, it will activate a relay switch, and remain locked on until the motion stops. At this point it will also release the relay.
kruser495 in reply to James (pseudo-geek)Jun 22, 2008. 10:36 PM
you will need some pretty advanced stuff for that. thats like what they use in new cameras. i would suggest getting one of those light that you put in your bathroom. in the middle of the night you walk in there and the motion sensor activates a rely to light the light bulb. you would have to do something along those lines.
James (pseudo-geek) in reply to James (pseudo-geek)Jun 9, 2008. 12:07 AM
(airsoft turret, if your wondering)
twenglish1 in reply to James (pseudo-geek)Aug 30, 2008. 8:58 PM
it would be easier if you used an arduino diecimila i have one and can probably write code to control it like that i let you know if i get anywhere on the code.
Xerillum in reply to James (pseudo-geek)Aug 30, 2008. 8:19 PM
you'll probably need a lot of work to pull that off... good luck
twenglish1 in reply to James (pseudo-geek)Jul 20, 2008. 11:01 PM
i dont really play airsoft anymore i play paintball but that would be awesome (maybe i should make one for paintball)
ECROS Technology says: Apr 10, 2008. 6:40 AM
Regarding comments such as "It's very helpful to get a warning before purchasing the Dragon that it's not going to be complete out of the box", here is a related instructable that might make the AVR Dragon more "out of the box" friendly, i.e. no ZIF socket, no wire jumpers and somewhere to build an actual project to boot:

http://www.instructables.com/id/Assembling-the-Dragon-Rider-500-for-use-with-the-A

Full disclosure: I am the manufacturer of the Dragon Rider 500.
ferrariman610 says: Mar 14, 2008. 6:27 PM
this is nice an all but... is it just me or do parallax products look less intimidating? does anyone have an instructable for parallax bots?
toogers says: Feb 24, 2008. 12:43 PM
nice............ ffdsyuhbvgdshfbdhfusvfgadshfvadsfrthjgjfvhjfghagfdsj

dsjfgzdxhjfgdfgdhgf
Tailslvr7_7 says: Feb 18, 2008. 7:30 PM
my brain hurts... from all of the programming I've seen today...
1.gif
Crash2108 says: Mar 14, 2007. 2:33 AM
What is with the Wizard of Oz references?
maker12 in reply to Crash2108Dec 13, 2007. 3:15 PM
no he is using brain as
reference for atmels duh does some need a new hard drive. be glad to do it. lol!
mothflavour2 in reply to Crash2108Mar 14, 2007. 9:23 AM
Either someone just saw Wicked recently, or he's making random references to movies from the 30's. Cool instructable though. Very detailed. (I'd be more likely to scratch build my own programmer.
tonecluster says: Apr 24, 2007. 2:36 PM
The rollover info boxes on the first photo are shifted over to the left by about 1.5 inches (at least when viewed with Safari).
1-40 of 41Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!