Choosing an AVR Microcontroller for Data Acquisition

Arduino is a wonderful platform for designers, artists and anybody who doesn't want to spend hours picking out chips and learning the AVR toolchain. But for tasks that require high-speed data acquisition, the Arduino has a fatal flaw: no built-in USB means that funneling data to a PC is sub-optimal. The Arduino uses an FTDI chip to do serial to USB conversion, which doesn't allow you you to take full advantage of USB speed.

The new Arduino UNO uses the ATmega8u2 for serial to USB conversion, but it's unclear whether there are hidden bottlenecks according to posts on the Arduino forum. Moreover, the Arduino is quite large and it's smaller alternatives, such as the Arduino Pro Mini and the Arduino Nano are still using the FTDI approach.

AVR offers a number of ATmega chips with A/D converters + built-in USB capability that can give you better data throughput. This page collects notes on how to find and use these chips.

ATmega Chips with A/D + USB Support

Atmel offers a range of chips with built-in USB support, but not all of them have A/D converters. The chips in the table below have either 8 or 12 10-bit A/D converts each.

Chip A/D PWM Flash RTC IO Pins
AT90USB1286 8 9 128 Yes 48
AT90USB1287 8 9 128 Yes 48
AT90USB646 8 9 64 Yes 48
AT90USB647 8 9 64 Yes 48
ATmega16U4 12 8 16 No 26
ATmega32U4 12 8 32 No 26
Packages: TQFP/VQFN 64/44
USB: LS/FS Device (+OTG)
Fmax: 16MHz
Vcc: 2.7V-5.5V

Breakout Boards

* The Teensy 2.0 board from PJRC provides a breakout for the ATmega32u4 along with a bootloader, lots of documentation, example code and support for Arduino via "teensyduino". Thanks to the “halfkay” bootloader, the Teensy can be programmed over USB.

  • The Teensy++ 2.0 board from PJRC is similar to the Teensy 2.0, but uses the ATmega90USB1286 chip, which has almost double the I/O, but fewer A/D converters. It's also almost twice the size.
  • The Micropendous 2, 3 and 4 boards from Opendous are open source designs utilizing the range of USB-compatible AVR chips listed above. The series 2 uses the ATmega32u4, the series 3 uses the AT90USB647 and the series 4 uses the AT90USB1287.
  • The Ada Fruit ATmega32u4 breakout board is alot like the Teensy 2.0, but a bit bigger. It includes an open source avrdude compatible bootlader and space for an ISP header, so, unlike the Teensy, you need to program it using an AVR programmer.

Libraries

  • Adrian Freed from CNMAT (creator of Open Sound Control) has written an Arduino sketch called OSCuino that turns most Arduino compatible microcontrollers into an OSC data acquisition device. The usual Arduino chips as well as the ATmega32u4 (Teensy) are supported. (Note: OSCuino does not implement the entire OSC protocol; most notably time tags are left out. This is in part due to the fact that there is no real-time clock (RTC) on the ATmega32u4.)
  • Also at CNMAT, Andy Schmeder has written a µOSC implementation for the SparkFun Bitwhacker and the CREATE USB Interface, both PIC-based boards (though you can add an AVR chip to a CUI to get the best of both worlds).
  • LUFA seems to be considered the best library for doing USB on AVR microcontrollers.
  • LUFAduino is firmware for the Micropendous boards that combines LUFA and the Arduino libraries. This could probably be ported easily for use with other boards (such as the Teensy).
  • Procyon AVRlib is a set of high level libraries for AVR microcontrollers. Additional instructions on using these can be found at the CCRMA websites listed below.

References on A/D Conversion