Posts Tagged ‘USB’
USB Communications Under Windows
Posted by Parkzone Corsair in USB on January 12th, 2010
This chapter explains how a Windows PC manages communications with USB devices. The driver architecture described applies to Windows XP and Windows Vista, but much of the information also applies to other Windows editions.
A device driver is a software component that enables applications to access a
hardware device. The hardware device may be a printer, modem, keyboard, video display, data-acquisition unit, or just about anything controlled by circuits the CPU can access. Most USB devices are external devices that connect via cables (or wireless links). Some USB devices, such as fingerprint scanners, are in the box with the CPU.
USB communications under Windows use a layered driver model where each
driver in a series, or stack, performs a portion of the communication task. At the top of the stack is a client driver that the operating system has assigned to
the device. Another term for client driver is function driver. USB class drivers and vendor-specific device drivers are client drivers. Applications access a USB device by communicating with the client driver. The client driver in turn communicates with lower-level bus and port drivers that access the hardware. One or more filter drivers can supplement a client driver or bus driver. Dividing communications into layers is efficient because devices that have tasks in common can use the same driver for those tasks. For example, it makes sense to have one set of drivers that handle tasks common to all USB devices. An operating system can provide these drivers so device vendors don’t have to do so with much duplication of effort.
The Device Uses USB or Another Interface
Posted by Parkzone Corsair in USB on December 15th, 2009
To communicate with USB devices, a computer needs hardware and software that support the USB host function. The hardware consists of a USB host controller and a root hub with one or more USB ports. The software support is typically an operating system that enables device drivers to communicate with lower-level drivers that access the USB hardware.
A typical PC has one or more hardware host controllers that each support multiple ports. The host is in charge of the bus. The host has to know what devices are on the bus and the capabilities of each device. The host must also do its best to ensure that all devices on the bus can send and receive data as needed. A bus may have many devices, each with different requirements, all wanting to transfer data at the same time. The host’s job isn’t trivial.
Fortunately, the host-controller hardware and drivers in Windows and other operating systems do much of the work of managing the bus. Each device attached to the host must have an assigned device driver that enables applications to communicate with the device. System-level software components manage communications between the device driver and the host controller and root hub.
Applications don’t have to know the hardware-specific details of communicating with devices. All the application has to do is send and receive data using standard operating-system functions or other software components. Often the application doesn’t have to know or care whether the device uses USB or another interface. The host performs each of the tasks described below.
Of USB’s Four Transfer Types
Posted by Parkzone Corsair in USB on November 19th, 2009
Because all devices share the bus, a device has no guarantee that a particular rate or maximum latency will be available on attachment. If the bus is too busy to allow a requested transfer rate or maximum latency, the host refuses to complete the configuration process that enables the host to schedule transfers. The device’s driver can then request a configuration or interface that requires less bandwidth. To take full advantage of reserved bandwidth, the device driver and application software and device firmware must eliminate retries as much as possible.
The device should have data ready to send when the host requests it and should be ready to accept data when the host sends it.Of USB’s four transfer types, the fastest on an otherwise idle bus are bulk transfers,with theoretical maximums of around 1.2 MB/s at full speed, 53 MB/s at high speed, and 400 MB/s at SuperSpeed. Isochronous transfers can request the most bandwidth (1.023 MB/s at full speed, 24.576 MB/s at high speed, and 393 MB/s at SuperSpeed). Low speed doesn’t support bulk or isochronous transfers, and the maximum guaranteed bandwidth for a single low-speed transfer is 800 bytes per second.




