4
\$\begingroup\$

I am dealing with PICs for some time and now I want to learn how to use an AVR. I have 2 MCUs in here, the AT32UC3C2512C-A2UT and the ATXMEGA32A4U-AU but I still dont have any programming tools.

In the PIC, things are pretty simple: You just buy PIC Kit 3 and you can program and debug all PICs for a cheap price. But in AVR I can see so many options in Atmel's website, and not just in products but in technologies (PDI, JTAG etc..).

Since I am pretty noob in this subject, I wanted a quick comparison of the options out there and not just the programmers and debuggers but also about the technologies inside them. The DIY options will be most welcome.

In the internet there are some quick reference guides, like this one, but they are years old and they do not compare the technologies inside them (in that link they don't say for example the difference between TPI and PDI or JTAG and the benefits of each one of them), just what they do, so it's hard to choose one.

Please bear in mind I need a programming board for the MCUs I mentioned. I appreciate all the help!

EDIT: I think this link might help.

\$\endgroup\$
  • \$\begingroup\$ USBasap is just a programmer, it doesn't support debugging. Go to atmel . com, search for the devices you have, then click on "tools". The tools page will show you all the tools available. \$\endgroup\$ – Suirnder Apr 19 '13 at 3:41
  • \$\begingroup\$ I know but I believe they are expensive development tools. I was looking for something more DIY, on the USBasp price range. (why the -1?) \$\endgroup\$ – mFeinstein Apr 19 '13 at 3:56
5
\$\begingroup\$

There are dozens of different programmers, but they all fall into one or more of these categories:

  • JTAG. any JTAG programmer can program any device (not just AVRs, and not even just micros) that accepts JTAG. I have several JTAG programmers (Olimex AVR-JTAG-USB, Terasic's Blaster, Abatron BDI2000). Requires 4 or 5 lines.

  • PDI. AVR-specific, 2-wire protocol for programming and debugging. Many AVR programmers support PDI (Dragon, AVRISP, JTAGMkII, etc.)

  • ISP. AVR-specific, 5 wire protocol built on top of SPI. Most AVR programmers support this and I believe that every AVR supports this. The bus pirate also works as an AVR ISP programmer.

  • HVPP. This mode uses a lot of pins and uses 12V to program the device (as opposed to the normal 1.8-5V supply). I have never used this.

  • HVISP. AVR-specific 5 wire protocol which can be used on the ATTiny parts or other AVRs which have had their reset pin disabled. Uses 12V like HVPP, but with much fewer pins. The Dragon is one of very few programmers which support this option.

  • TPI. I don't know much about this method, it looks very similar to PDI to me. Used on the ATTiny devices.

For my own stuff, I use JTAG or ISP since they both work well in-circuit, but on a recent design I am using the ATTiny13A and need every pin, so I use a Dragon and HVISP for that design. HVISP isn't really meant for in-circuit programming and there are some caveats that I've had to incorporate into the design to make it work.

Which programmer is right for you? Look around for an inexpensive USB ISP programmer with a case. Get a Dragon if you really need the HV programming modes, but you probably don't need them at this point. Digikey or Mouser are the usual sources but you can build your own, use ebay or any number of sites like ladyada or sparkfun. Definitely don't spend more than $50, you can get the Dragon for $56 from Digikey.

You want a case to protect the programmer because one thing you don't want to is to start guessing whether it's your design or the programmer that's causing you grief. :-)


Edit 1

Which programmer to use for AVR32 and XMEGA? Both can use JTAG, so I'd look for a JTAG programmer. JTAG programmers can be built out of pretty much anything, there are homebrew/"free" designs available, and you could even make one out of a parallel port. I suggest looking at something like a AVR-JTAG-USB or ByteBlaster since they're both about USD$50 and well supported by avrdude (the software which programs AVRs under Linux and OSX), but as I said, any JTAG cable will work. If you're using AVR Studio then I'd check their list of supported programmers (a link to which I could not find, sadly). I know it does support the AVR-JTAG-USB, and I believe Atmel's official recommendation is the JTAGICE3.

You may want to take a look at LadyAda's AVR Tutorial -- the link goes to their "choosing a programmer" section but the whole tutorial is good.


Edit 2

Why the cost disparity between programmers? Features mostly. Some programmers can only do ISP or JTAG. Some programmers only work with a specific VCC, or make assumptions about whether the device you're programming is powered by the programmer or not. Some programmers do not take care to protect themselves against misconnection, or have "dumb" power supplies which don't shut down in the case of short circuits or overcurrent. I already mentioned that most programmers DO NOT support the high voltage (12V) programming that you may need in some cases.

For starting out with XMEGA and AVR32, I'd recommend the Olimex AVR-JTAG-USB or Terasic ByteBlaster as menitoned above. They're reasonably rugged, have level shifters to match the power supply of the device you're going to program, and reasonably priced.

\$\endgroup\$
  • \$\begingroup\$ Nice post, but is all of this applicable to Xmegas and AT32UC3s? \$\endgroup\$ – angelatlarge Apr 20 '13 at 23:28
  • \$\begingroup\$ xmega can use any PDI or JTAG programmer. AT32s can do JTAG and they seem to also have a DFU USB mode. \$\endgroup\$ – akohlsmith Apr 21 '13 at 0:01
  • \$\begingroup\$ I think it would be a better answer if this was addressed (in the answer), since that's what OP asked about. \$\endgroup\$ – angelatlarge Apr 21 '13 at 3:01
  • \$\begingroup\$ What about the other programmers/debuggers? What benefict they have to be so expensive? \$\endgroup\$ – mFeinstein Apr 21 '13 at 7:42
  • \$\begingroup\$ @angelatlarge actually he asks the differences between the different modes, not what to use for a specific AVR. I'll modify to address that too though. \$\endgroup\$ – akohlsmith Apr 21 '13 at 12:33
-1
\$\begingroup\$

XMEGA and UC3 (AVR32) aren't really 'AVR', so most AVR programmers won't work with them.

XMEGA needs PDI (or JTAG). UC3, I'm not even sure. surely JTAG, possibly another method though.

There's a PDI programmer in the LUFA library, that will run on any USB AVR (like one on teensy, or chinese dongle for uh.. Playstation).

\$\endgroup\$
  • 1
    \$\begingroup\$ why arent AVR? They are in the AVR section of Atmel's website though. \$\endgroup\$ – mFeinstein Apr 19 '13 at 19:47
  • \$\begingroup\$ @mFeinstein -- ...because AVR typically means 8-bit core. AVR32 is 32-bit. XMEGA is a bit of a hybrid (8-bit core with some 16-bit instructions, but, most importantly a vastly different internal architecture to the older AVR). \$\endgroup\$ – DrFriedParts Apr 21 '13 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.