for by Jan Axelson
Projects on a Budget
Adding a USB interface to a device can
seem like a daunting task. Every USB
device must contain device-controller
hardware and must have a software driver
in the PC. Many options exist for device
controllers and drivers, and the right
choices can make a big difference in how
quickly you get a project up and running.
This article shows three ways to add
USB to devices. Each takes a different
approach, but all are suitable for devices
built in small quantities and on limited
budgets. For a review of USB technology, see the USB in Brief sidebar.
USB Virtual COM Port
For years, every PC came with one
or more RS-232 serial ports. Software
accesses these ports as numbered COM
ports (COM1, COM2, and so on). But
not every COM port has an RS-232
interface. Some devices with USB ports
can function as virtual COM ports.
Applications access virtual COM
ports in the same way as RS-232 ports.
Users can communicate using terminal-emulator software such as Windows
Hyperterminal. Programmers can use
the SerialPort class in Microsoft’s .NET
Framework. The only difference is that
the hardware interface is USB instead of
RS-232. Lower-level drivers handle the
details of accessing the hardware.
Virtual COM ports provide a way to
If you have an idea for a device that communicates with PCs, the chances are good
that the device will connect to the PC via the Universal Serial Bus (USB). You’re
probably well acquainted with USB as the interface used by mice, keyboards,
drives, cameras, and other mass-market peripherals. But USB is also versatile
enough for use in specialized devices produced in single or small quantities.
62 April 2007