April
2005, Issue 177
Simple
USB Data Acquisition
CROSSING
THE BRIDGE
After
the code is running on the LPC2138, the raw temperature
data exits the MCB2130 board’s serial port and meets
the USB-to-UART bridge board, which contains the CP2101
USB-to-UART bridge controller and an RS-232 transceiver.
The board’s power also comes from the USB port, once
again eliminating the need for an ugly wall wart power
supply. I used the board to convert RS-232 serial data
from the MCB2130 board to compatible USB data for the
PC.
The
CP2101 is highly integrated and requires no components
other than a USB connector. It includes a USB 2.0 full-speed
function controller, USB transceiver, oscillator, EEPROM,
and asynchronous serial data bus (UART) with full modem
control signals. The device’s packaging is an unbelievably
compact 5 mm × 5 mm MLP-28. I’ve soldered many surface-mount
components under the microscope on prototype boards,
but this device was by far the trickiest, especially
because it doesn’t have external leads! (If you plan
on soldering by hand, make your PCB footprint pads a
bit longer to allow for better solder flow with a fine-tipped
iron.)
Looking
toward the software end of things, the nice part about
using this device is that special software isn’t needed
for the RS-232-to-USB conversion. This allows USB communication
to become totally transparent for the LPC2138 and its
UART. Just connect the LPC2138 UART pins to the CP2101,
and it will take care of the rest.
You’ve
probably guessed that there must be some software intervention
for CP2101 data to get to the PC over USB. Yes, there
is. It’s via a virtual COM port driver installed on
the PC side. These drivers make your USB port seem like
another COM port on your PC’s operating system (thus
the virtual COM port name). Silicon Labs provides the
virtual COM port drivers with its development board
for Windows, MAC, and Linux.
The
interesting thing about the drivers is that existing
PC applications, like terminal emulators, will work
with them. You can have a terminal session over USB
or use existing applications that use COM ports to talk
over USB. The Visual Basic PC application does this.