ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
■ BY FRED EADY
AVOIDING TUITION AT USB UNIVERSITY
I HAVE A LOVE/HATE RELATIONSHIP WITH USB. I love it because it is convenient
and user friendly. I hate it because understanding the underlying processes of
USB can be difficult. Think about this. You don’t have to know the down and
dirty details of how a PIC ALU (Arithmetic Logic Unit) works to employ a PIC
in a microcontroller-based application. So, why should we have to know so
much about USB to put it to work for us?
I’m obviously not alone when it comes to wondering
why deploying USB in an embedded application has to
be so darned complicated. The war began when personal
desktop computers and laptop computers dropped the
RS-232 interface for multiple USB interfaces.
Microcontroller manufacturers such as Microchip, Texas
Instruments, and Atmel stepped in and offered lines of
microcontrollers with built-in USB engines and embedded
USB interface devices. Microchip is still on the front line of
the embedded RS-232-to-USB revolution.
A USB firmware package called USB Framework is
available for download from Microchip. The Microchip
USB development package extends from the PIC18F eight
bit microcontrollers up through the PIC24F 16 bit
microcontrollers and out into 32 bit space with backward
compatible USB API extensions designed for the 32 bit
PIC32. Officially, the Microchip USB tools are packaged
as the MCHPFUSB Framework for the eight bit and 16 bit
PIC microcontrollers. The MCHPFUSB Framework opens
up PIC18F and PIC24F projects, drivers, and PC-based
resources. The MCHPFUSB USB stack is API compatible
with its 32 bit counterpart, the USB Device and
Embedded Host Stack for PIC32.
Other microcontroller manufacturers tackled the lack
of PC RS-232 port access by introducing USB-to-UART
bridge integrated circuits. For instance, FTDI (Future
Technology Devices International) has a full line of RS-232
converter replacement integrated circuits. The FTDI
RS-232/USB ICs do everything necessary to build a data
link between a USB device and a microcontroller UART.
Most of the FTDI parts also contain additional user-accessible I/O pins. The latest FTDI device — the FT232R
USB UART IC — can internally generate a clock that is
suitable for driving an external host microcontroller. The
FT232R doesn’t leave any USB hardware loose ends. The
clock generation is performed on-chip and no external
crystal is required. All of the USB termination resistors are
16 December 2008
also fully integrated on-chip. The FTDI engineers thought
of everything including on-chip power conversion and
transmit and receive LED drive signals. USB likes to
“describe things.” So, the external EEPROM that normally
holds some of the USB descriptions has been incorporated
into the bowels of the FT232R.
If you don’t need the extra I/O and only want to
convert the interface from RS-232 to USB, Silicon Labs
offers the CP2102 Single Chip USB-to-UART Bridge.
Like the FTDI FT232R, the CP2102 pulls the USB clock,
termination resistors, 1024 byte EEPROM, and power
conversion down to the chip level.
All of the aforementioned USB conversion ICs are
supported by free PC drivers that are supplied by each of
the USB-to-RS-232 converter IC manufacturers. With the
USB hardware distilled into a single IC and free PC driver
software, the only USB deployment obstacle we may
possibly see as hobbyists is soldering down the very small
USB IC SMT packages. You can overcome the SMT soldering obstacle in your development phase by purchasing
preassembled USB modules from FTDI and DLP Designs.
Thus far, we’ve only discussed the replacement of
RS-232 converter ICs with spiffy USB interface ICs. Sure,
easily getting a PIC’s UART to communicate directly with
a PC’s USB port is a step forward. However, if we design
in a dedicated USB-to-UART bridge IC, we’re only going to
be able to communicate in the same manner (UART-to-PC
terminal emulator) as the RS-232 circuit we replaced.
That is not a bad thing if all we need to do is replace the
RS-232 interface on our embedded device. What if we
wanted to interface our embedded creation with another
USB device other than a PC?
Vinculum, as defined by the Merriam-Webster
dictionary, originates from the Latin vincire, which means