Frank's Random Wanderings

Atmel Xplain Xmega board Gotchas

Atmel kindly gave me an Xplain Xmega board at one of their Xmega seminars. It’s a useful tool for ATXmega development, but it does have a couple of problems. I thought I’d mention the ones I’ve tripped over, in case anybody else sees the same problems.

Board Doesn’t Restart Properly

I’ve found that when the AVRISP2 programmer is plugged in, the Xplain always reboots properly. But when the programmer is unplugged and the board is “on its own”, so to speak, it doesn’t always reboot properly and the code in the Xmega128 doesn’t always run.

The reason is a hardware problem on the board. Atmel’s Xmega documentation states that the Xmega processors have a weak internal pullup on the reset line. If there are any external devices on the reset line, an additional external pullup may be required.

This is the case with Xplain. The ATXmega128 reset line also routes to the AT90USB1287 part on the board. It seems this small additional load is problematic for the Xmega. Adding a 10k pullup resistor to the Xmega reset line solved the problem and allowed the Xmega to reboot properly every time.

Take a look at the Xplain schematic (available on the Atmel website) to see where the reset signal goes. Personally, I found it very easy to solder an 0603 10k resistor on the back of the Xmega programming connector header, between pins 4 & 6. The 0603 was the perfect size to fit between the solder joints for pins 4 & 6 on the back of the board. But, a regular leaded resistor would work fine too.

USB Serial Interface Doesn’t Work

Yep, lots of people have pointed that out. The AT90USB1287 is supposed to implement a “virtual COM port”, allowing the Xmega to transmit & receive at 9600 board, and have that available over USB thanks to the 1287. In theory. In practice, not so much. Atmel’s USB-to-serial interface doesn’t seem to work as advertised. I was able to confirm on my board that I was giving the AT90USB1287 the 9600 baud serial data it expected, but the thing never worked. I tried different drivers etc from the Atmel website, to no avail.

In theory you can reprogram the 1287 via the USB port, using Atmel’s “FLIP” utility (available on their website). For me, that didn’t work either, and I really tried hard. No FLIP for me!

So what to do? Here are a couple of options.

  • Apparently this code works, if you can get it into the AT90USB1287:
    http://www.fourwalledcubicle.com/LUFA.php
    Build the “XMEGABridge” project, program the resulting .hex file into the 1287, and you’ll have a working USB to serial interface. Of course the big trick is actually doing the programming. If you can get FLIP to work, great. Otherwise, you’ll need to program the 1287 via its 10-pin JTAG programming header. Note I said “JTAG” – you’ll need a JTAG programmer, not the AVRISP2.
  • Give up on the 1287 completely & solder a MAX232 device and DB9 connector to the board instead. This option worked for me because I had the parts required at hand, so it was fairly easy & quick. I would imagine this might not be the case for everyone though.

Programming Atmel AVR processors has become a little more difficult with Atmel’s use of a 6-pin connector on their popular AVRISP2 programmer. This is a great little programmer, fast, cheap, and USB based.

But why oh why did they put a 6-pin connector on it, instead of the 10-pin connector they use almost everywhere else? Almost all of their development boards, including the Xplain, have 10-pin programming headers. But this little programmer has a 6-pin connector. So you need to make yourself an adaptor board, or adaptor cable, before you can even use it. What were they thinking?

In fact, ideally you need to make two different 6-to-10 pin adaptors.  One for Xmega devices that use the PDI programming interface (see my previous post for pinouts), and a different one for all the other AVR parts that use the older “SPI” or “ISP” programming interface.

There you have it. A pull-up resistor to cure the “Xplain doesn’t reset” problem, and a couple of options if your Xplain USB to serial doesn’t work. Have fun!

10 thoughts on “Atmel Xplain Xmega board Gotchas

  1. Alan

    Hi Frank and all,
    I recently actually paid for an xplained for the A3BU, and had all kinds of trouble getting it to work with FLIP. But after all the misery, I had a late night epiphany and got it working. Here was my particular trouble.
    First, when plugging in the xplained to the USB on the PC, it powers up with the default application menu on the LCD. NP. I had to add the CDC driver to the PC in order to make Studio able to read the explained.
    But…! that does not work in Boot Loader mode. To go to Boot Loader, I had to hold down the SW0 switch on explained while plugging it in to USB power.
    After that, it still did not work. Then I figured out that a separate and different driver was needed in the Driver Manager to get it to communicate. I got this driver from Atmel website, loaded it on, and voila, FLIP now works like a charm.
    If you want additional details, would be happy to give the name of the drivers and other info.
    Ciao,
    Alan

  2. Kraal

    Hello, a year after, another update/correction.
    Hyper was referring, I believe, to the A1-Xplained board, not the original XPlain board that Frank has.
    There is a 100k pull-up on the A1-Xplained, but it is lacking on the original XPlain.

    Thanks Frank for your blog, it is really helping.
    Have a nice day,
    Kraal

  3. hyper

    One more update…
    I just got a rev. 7 XPLAIN board and the schematic shows R100 which is a 100K pullup on the reset line (aka. PDI CLK). I haven’t even fired it up yet, but I’m guess that the ‘Board Doesn’t Restart Properly’ problem has been fixed.

  4. Bill Somerville

    Just kicking the tyres here on an Xplain board and found your blog while looking for info on peoples experiences with the DAC.

    My Xplain came with the BOOTRST fuse un-programmed on the AT90USB1287 board controller MCU – this has to be programmed before the supplied FLIP compatible boot loader will work. Bit of a dumb setup by the manufacturer unless they had some reason for crippling the board. You need to jumper the TDI pin to ground on the board controller JTAG header to enable the FLIP bootloader as well.

    I used a JTAGICEMkII to fix mine, not sure how users without a JTAG programmer are supposed to sort it – but given that you need one to program the XMEGA I guess most will have one.

    As for the USB CDC app, I found it works OK. I also loaded the flash drive emulation app (MSC) to the board controller using FLIP and that works just fine too.

    Bill

  5. Kenneth Scharf

    Actually the avrispMKII DOES support the 10 pin cable without an adapter. Atmel just didn’t supply the cable. Get or make up a short cable with a 10 pin connector on each end. Snap open the avrisp (you have to insert a screwdriver into the plastic clamps holding the case together while prying it open with another screwdriver. It looks hard to do, but it opens easily. You’ll see that the PC board has BOTH connectors on it. In the event that they have depopulated the 10 pin connector from the board you’ll have to solder one to the provided pads, however the units I’ve opened up had both connectors installed.

  6. ArnodB

    > In theory you can reprogram the 1287 via the USB port, using Atmel’s “FLIP” utility
    > (available on their website). For me, that didn’t work either, and I really tried hard. No FLIP for me!

    Old Rev 1 Xplains didn’t have the necessary bootloader in the 1287. Rev 2 and later ones have it, but the procedure described in AVR1907 to enter the bootloader is incomplete. I have summarized my experience at http://www.avrfreaks.net I use Ubuntu, but checked that the pushbuttons I added works with FLIP under Windows, too.

  7. Dean Camera

    Hi Frank,

    Just a minor correction to your excellent post. My LUFA project does indeed contain a USBtoSerial demo which converts between a USB port and a physical serial port, however I’ve been told this won’t work on the XPLAIN board as the XMEGA->AT90USB link is via a software and not hardware UART. That said, as of this morning, there is a new “XMEGABridge” project in the LUFA SVN which should implement the required software USART bridge to restore that functionality to the XPLAIN boards.

    Cheers!
    – Dean

Leave a Reply

Your email address will not be published.