X-A4U stick

Notice: I have some leftover PCBs, selling on Tindie.

A small programmable USB stick, with ATMEL's ATxmega128A4U on board. It's also got a microSD socket, RGB led and two buttons (one of which is RESET).

The possible usages of this stick that I had in mind when designing it were:

It is designed to be solderable by hand - I soldered it with just a regular soldering iron (and a lot of liquid flux - it works like magic).

Downloads/resources

x-a4u-r2-top.jpg             x-a4u-r2-bottom.jpg

Description

Usage notes

Software/firmware side

The atxmega is bootloaded with ATMEL's DFU bootloader, which is entered by pressing the E0 button during power-up or reset. So to program the stick, enter the bootloader mode, the stick should enumerate as ATMEL DFU device (this probably needs a driver on Windows - I haven't tested it yet), and then either use ATMEL's FLIP utility, or the open source dfu-programmer.

Probably the easiest way to write firmware for this stick is to use avr-gcc (windowed people can get it as WinAVR distribution). Alternatively ATMEL Studio can be also used on Windows. Of course, instead of C or C++, you can go full hardcode with assembler.

For programming USB interfaces (i.e. to make the stick pretend it's a keyboard, mouse, MIDI device, etc...), Dean Camera's LUFA is incredibly handy. For some examples directly for this stick, see the Test firmwares linked also in the Downloads section.

The stick is now supported in Arduino using xmega-arduino add-on - still alpha quality, and with some caveats (e.g. only USB Serial, no Keyboard or Mouse yet, no autoreset), but nevertheless it is useful for some quick testing.

Hardware side

The button is wired to PE0, the RGB LED to PE1 (green), PE2 (red) and PE3 (blue). (Note there's a mistake on the silkscreen, red and blue are switched.)

The through-hole pads are (as marked on the board):

The voltage regulator is rated to 250mA, same as the PTC fuse. However it's SOT-89 package, so the heat dissipation provided by the package might not be sufficient when one gets close to the rating.

The analog supply voltage pin (AVCC) is connected to the supply through a ferrite bead, as per ATMEL's recommendation, so the analog output (DAC0/1) and analog input should be relatively clean - but I don't have an oscilloscope to verify this.

Pinout diagram

                    /-------------\
 [A6 16]      ADC6  | A6       A7 | ADC7            [17 A7]
 [A5 15]      ADC5  | A5       B2 | ADC10 DAC0      [8]
 [A4 14]      ADC4  | A4       B3 | ADC11 DAC1      [9]
 [A3 13]      ADC3  | A3      3V3 |
 [A2 12]      ADC2  | A2      GND |
 [A1 11]      ADC1  | A1       C0 | SDA       OC0A  [0]
 [A0 10] AREF ADC0  | A0       C1 | SCL  XCK0 OC0B  [1]
                    | 3V3      C2 |      RXD0 OC0C  [2]
                    | GND      C3 |      TXD0 OC0D  [3]
          PR1 TOSC1 | XT1      C4 | /SS       OC1A  [4]
          PR0 TOSC2 | XT2      C5 | MOSI XCK1 OC1B  [5]
                    | RST      C6 | MISO RXD1 OC1C  [6]
                    | PDI      C7 | SCK  TXD1 OC1D  [7]
                    \             /
                     \--- USB ---/

  E0/button  E1/green  E2/red  E3/blue  B0/cardselect
    [18]       [19]      [20]    [21]     [22]
        (bracketed are Arduino pin numbers)

Pages below refer to the xmega AU manual.

Technical points

Soldering instructions

First, some general SMT soldering info that I found useful:

Now, for this stick in particular: The parts are mostly not too close to each other, so it does not really matter in what order you solder them. Here's the way I do it:

If you make something interesting with the stick, I'd like to hear about it!

BOM

Nnamevaluepackage
1blue 1.6mm thick PCB
1ATxmega128A4UTQFP-44
1male USB A THT connector
2SMT pushbutton
1microSD socket
1RGB LED (common anode)1210
1PTC fuse250mA1206
1MCP1703-3.3 (250mA)SOT-89
3resistor1kR0805
4ceramic capacitor (X7R)0.1uF0805
1ceramic capacitor (X7R)0.1uF1206
1ceramic capacitor (X7R)1uF0805
1ceramic capacitor (X7R)10uF1206
1ceramic capacitor (X7R)22uF1206
1ferrite bead220R@100MHz0805