Serial Port Complete - Latest Microcontroller projects

(lily) #1

Chapter 14


host is a PC or another computer that contains host-controller hardware and
software. A device is a peripheral or other computer-controlled system that con-
tains device-controller hardware and firmware.
The host assigns a driver or a series of drivers to each attached device. The driv-
ers manage communications between applications and the USB host control-
ler’s driver and define how applications can access a device. Drivers can insulate
applications from the details of a device’s hardware interface. RS-232 and USB
are very different interfaces, but with driver support, application software can
use the same COM-port functions to access internal RS-232 ports and USB
devices that function as virtual COM ports.
On power up or device attachment, the host computer and the device exchange
information in a process called enumeration. The host requests a series of data
structures called descriptors from the device. The descriptors contain informa-
tion that identify the device and its intended use. The information includes the
device’s Vendor ID, Product ID, Release Number and codes that identify any
standard USB classes the device belongs to.
During enumeration, the host also assigns a bus address to the device and
requests the device to use a configuration that specifies how much current the
device can draw from the bus.

  

$ 8
 
9 


For each device, the host computer looks for the best match between the infor-
mation in the device’s descriptors and the information in the host’s INF files (or
an equivalent information source for non-Windows systems). The information
can be a Vendor ID/Product ID pair or USB class and subclass codes. On find-
ing a match, the host uses the driver or drivers named in the INF file. After the
device accepts the requested configuration, the host and device can begin com-
municating using the assigned drivers.
A virtual COM-port device can use the serial.sys and usbser.sys drivers provided
with Windows or an alternate driver obtained from a device vendor or other
source. Some companies provide free COM-port drivers for use with the com-
pany’s USB controllers.

<



A USB host can be a desktop or notebook computer, a handheld, or an embed-
ded system. The host must contain host-controller hardware and must imple-
Free download pdf