3

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.

JYelton
  • 32,302
  • 33
  • 134
  • 249
mFeinstein
  • 4,293
  • 11
  • 45
  • 84
  • 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. – Suirnder Apr 19 '13 at 03:41
  • 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?) – mFeinstein Apr 19 '13 at 03:56

2 Answers2

5

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.

akohlsmith
  • 11,162
  • 1
  • 35
  • 62
  • Nice post, but is all of this applicable to Xmegas and AT32UC3s? – angelatlarge Apr 20 '13 at 23:28
  • xmega can use any PDI or JTAG programmer. AT32s can do JTAG and they seem to also have a DFU USB mode. – akohlsmith Apr 21 '13 at 00:01
  • I think it would be a better answer if this was addressed (in the answer), since that's what OP asked about. – angelatlarge Apr 21 '13 at 03:01
  • What about the other programmers/debuggers? What benefict they have to be so expensive? – mFeinstein Apr 21 '13 at 07:42
  • @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. – akohlsmith Apr 21 '13 at 12:33
  • @AndrewKohlsmith thanks a lot! very clarifying. I saw the ladyAda's tutorial, but I was afraid it was years old. As far as I can see JTAG is good because its universal and you can program and debug even chips from other manufacturers. But it takes lots of pins. HV programming looks like a good backup to have in case the fuses are wrong and I want to save a chip. But still PIC Kit looks incredibly simple compared with all the AVR programming flavours... So far I am going with the Dragon...cheap, has Studio integration, programs and debugs JTAG, HV and cool name haha – mFeinstein Apr 21 '13 at 18:24
  • @AndrewKohlsmith I thought the AVR ONE! was the offical recommendation, since it's the only one label as professional, right? – mFeinstein Apr 21 '13 at 23:32
  • @AndrewKohlsmith the SAM ARM devices...as far as I can see they dont work with any of the regular programmers right? I thought they were JTAG as well...but in this link http://www.atmel.no/webdoc/atmelstudio/supported.devices.html it appears they need a SAM-ICE. – mFeinstein Apr 22 '13 at 08:41
  • I have worked with several SAM ARM devices (AT91SAM9G25 the most recent) -- it works fine with JTAG but they also have their retarded bootloader that works with SAM-BA and SAM-BA is a royal pain in the ass. Buggy, Windows-only (an alpha closed-source Linux release that doesn't work), undocumented, binary blobs for configuration... just use JTAG. :-) – akohlsmith Apr 22 '13 at 12:22
  • @mFeinstein I've been doing a lot of reading on the Dragon and unless they've fixed it, it's a full-featured programmer that is less rugged than I'd expect. I documented everything I learned about it on my wiki: https://www.mixdown.ca/redmine/projects/mixdown/wiki/AVR_Dragon -- I by far prefer the Olimex but need Dragon for HVSP. – akohlsmith Apr 22 '13 at 12:28
  • @mFeinstein AVRONE is their pro-grade development tool (not just a programmer). JTAGICE is their cheaper one. If you're going into production you want a production-grade programmer (tighter voltage regulation, stricter programming cycle and verification, etc.). Not worth it for anything but production in my opinion. – akohlsmith Apr 22 '13 at 12:31
  • @AndrewKohlsmith thanks a lot for the answers! I think the HVSP options is important for me, since I am a beginner I can see myself setting some wrong fuses, which can only be corrected by HVSP. I am sorry, what's the difference between a programmer and a development tool? – mFeinstein Apr 23 '13 at 05:28
  • @AndrewKohlsmith I forgot to aks, why do you prefer the Olimex? Pros and cons please :) – mFeinstein Apr 23 '13 at 05:34
  • the Olimex cable is cheap, rugged and small. It's just a FT232R and level translator inside, which shows up as a serial port on Windows, OSX and Linux. AVRDude and AVR Studio both support it well. No other reasons, I am not loyal to Olimex or any other vendor for this kind of stuff. :-) – akohlsmith Apr 23 '13 at 12:34
  • thank you for the answer...when you said "AVRONE is their pro-grade development tool (not just a programmer).", what's the difference between a development tool and a programmer? They seem to be the same stuff to me...I mean, a programmer is a development tool.. – mFeinstein Apr 24 '13 at 02:24
-1

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).

Marko
  • 825
  • 4
  • 8
  • 1
    why arent AVR? They are in the AVR section of Atmel's website though. – mFeinstein Apr 19 '13 at 19:47
  • @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). – DrFriedParts Apr 21 '13 at 02:25