Lately I’ve been exploring low-cost USB solutions for interfacing microcontrollers to systems without legacy serial or parallel ports. A obvious and popular solution is a USB to TTL-level RS232 converter. These are available as an on-board device (as seen in the official Arduino boards) or as a cable or add-on board (popular with the smaller ‘duino clones.) The best of which seem to be the FTDI TTL232 series of cables which can be had for around $20. The Modern Device Company recently released an even lower cost USB BUB converter board that looks to be a nice solution.
Beyond simply emulating a serial port are approaches that provide a native USB interface to the microcontroller, allowing a full range of device types to be presented to the host system. One inspiring example for hobbyists is the USBtiny approach which emulates a USB low-speed device using an Atmel ATtiny microprocessor that lacks native hardware support for USB. (The Adafruit USBtinyISP AVR programmer uses this approach to great effect.) This design can be achieved for very low cost with a small number of components; however, the quirk that makes it possible limits it to low-speed operation. Yet it is still sufficient for many applications.
A step up from there are some low-cost microcontrollers with native USB support. Some time ago I picked up an Atmel AT90USB1287-based AT90USBKEY demo board, which at $30 seemed like an excellent low-cost hobbyist platform, particularly with its 16MB of onboard flash and support for USB OTG-style host mode. However the registration-required, EULA encumbered nature of their examples pretty much prevented any sort of open-source community surrounding the board. One person mentioned on a forum that they had taken the time to convert the example sources to compile under avr-gcc, but they felt they could could not share the patches legally. So the board sat around collecting dust until earlier today, when I decided to place an order for the $19 AT90USB162-based Teensy USB development board from PJRC, based on their claims of an open-source USB library and some budding support for a “Teensyduino“ integration with the Arduino IDE. The find of the day turned out to be that open-source USB library, namely Dean Camera’s LUFA (Lightweight USB Framework for AVRs.) Interestingly, Dean’s default target just happens to be the aforementioned AT90USBKEY. A short download and a (rarely occurring) successful first-time ”make all” later and I had a nice set of working examples for the board. Much kudos to Dean, now I have something else I can hack on while I await the arrival of the Teensy board. (Not that I ever seem to have a shortage of things to hack on…)
Post a Comment