Thursday, March 1, 2012

Getting started with Atmel's XMEGA (or, making all the old mistakes all over again)

Normally, I wouldn't communicate such a small change, but I had a few little issues in the migration from MEGA/TINY to XMEGA, so this might conceivably help someone somewhere somehow.

Because the XMEGAs use the PDI interface for programming rather than ISP, it was necessary to get a new programmer.  I settled on the Zeptoprog; it was cheap (~25USD, including postage) and MADE IN AMERICA which, beyond jingoism, means that it arrived almost instantaneously.  Furthermore, the programmer/designer/manufacturer replied very quickly to my emails.  Furthermost, the device can also enumerate as an ISP/TPI programmer, GPIO/SPI/frequency counter and serial bridge as well as allowing for firmware upgrades over USB using Atmel's FLIP application.  As a bonus, the device shows up as an AVRISP mkII.

To test out the XMEGA, I soldered one onto a header and broke out the programming and power pins along with two GPIO pins, the two DACs and a USART.  It is pictured below in all its kludgy glory.

And now, to the whole point of this post: DON'T MAKE YOUR LEADS TOO LONG FOR PDI PROGRAMMING.  I had a good foot-and-a-half between programmer and device, and I wasn't able to talk to the device.  After a prompt set of emails with the Creator (of the Zeptoprog), I tried shortening the leads to the extra-shortness shown in the pic below, and it worked.  I could have made longer leads, but I wasn't taking any chances (I was in debug mode).  In fairness to the Zeptoprog, its drivers are stronger even than those in the Atmel-made AVRISP mkII; so any situation the official programmer can handle, the Zeptoprog can, and then some.

Regrading the XMEGA itself: I love it.  It's so beefy, and has so many peripherals, and everything is quadruply configurable.  My chosen device (ATXMEGA32A4U) has two 12-bit DACs, a whole mess of PWMs and ADC channels, a couple of SPI and USART ports AND a built-in USB peripheral.  Best of all, it's got a built-in hardware CRC peripheral, which I'll be using to great effect in generating pseudo-random numbers in almost no cycles at all.

No comments:

Post a Comment