USB Basics
9
replacement motherboard. For Windows systems, the edition must be Win-
dows 98 or later.
If upgrading the PC to support USB isn’t feasible, you might think an adapter
would be available to translate a peripheral’s USB interface to the PC’s RS-232,
parallel, or other interface. An adapter is rarely an option when the computer
has the legacy interface because an adapter that contains host-controller hard-
ware and code is too expensive to design and manufacture for its limited mar-
ket.
Even on new systems, users may occasionally run applications on older operat-
ing systems such as DOS. Without a driver, the operating system can’t access a
USB device. Although it’s possible to write a USB driver for DOS, few device
vendors provide one. An exception is mice and keyboards, which the system
BIOS typically supports to ensure that the devices are usable any time, includ-
ing from within DOS and from the BIOS screens that you can view on
boot-up.
&GXGNQRGT%JCNNGPIGU
For developers, challenges to USB are the complexity of the protocols, operat-
ing-system support for some applications, and for small-scale developers, the
need to obtain a Vendor ID.
Protocol Complexity. A USB device is an intelligent device that must respond
to requests and other events on the bus. Controller chips vary in how much
firmware support they require to perform USB communications. In most cases,
to program a USB device, you need to be familiar with the USB protocols for
exchanging data on the bus. On the host-computer side, device drivers insulate
application programmers from having to know many of the low-level details
about the protocols and hardware interface. Device-driver writers need to be
familiar with USB protocols.
In contrast, some older interfaces can connect to very simple circuits that soft-
ware addresses directly. For example, the PC’s original parallel printer port is a
series of digital inputs and outputs. You can connect to input and output cir-
cuits such as relays, switches, and analog-to-digital converters with no com-
puter intelligence required on the device side. With a driver to enable port
access, applications can monitor and control the individual bits on the ports.
USB is a shared bus with defined protocols, and the operating system prevents
applications from directly accessing the hardware. To access a USB device,
applications must communicate with a class or device driver that in turn com-