USB helps connect the enterprise

Universal Serial Bus (USB) is an open industry standard providing a simple and inexpensive way to connect up to 127 devices to a single computer port. With USB, many computer peripherals, such as keyboards, mice, digital cameras, digital scanners, bar-code readers, modems, and specialty printers can all run at the same time.

01/01/2001


Universal Serial Bus (USB) is an open industry standard providing a simple and inexpensive way to connect up to 127 devices to a single computer port. With USB, many computer peripherals, such as keyboards, mice, digital cameras, digital scanners, bar-code readers, modems, and specialty printers can all run at the same time.

USB is a dynamically reconfigurable serial bus with an elementary data rate of 12 Mbps, and is based on off-the-shelf, low-cost microcontroller technology. Its modular, layered software protocol supports sophisticated device drivers and application programs.

A USB driver on Win32 Driver Model (WDM) platforms is known as a client driver. It is a layered driver, meaning that it is layered above the hub drivers and does not access the hardware directly. Instead, the client driver makes requests to another driver, which carries out the requests. This layered relationship is referred to as a driver stack and is a common architecture for WDM drivers.



A USB driver on Win32 Driver Model is known as a client driver
meaning that it is layered above the hub drivers and does not
access the hardware directly.

Drivers, standards

At the bottom of the driver stack is the driver that controls the USB hub (see figure). There are two standards for these hub controller drivers: Intel's Universal Host Controller Interface (UHCI) and the industry standard Open Host Controller

Interface (OHCI). Most machines built around Intel-designed motherboards use an UHCI controller, while most add-in cards and other motherboards use OHCI controllers. Although differences exist in the way the hub operates, these differences are not important to the client driver.

The most important element of the Microsoft-written components of the driver stack is the USB bus driver, usbd.sys , through which client drivers perform all communication. Usbd.sys presents an interface to client drivers that allow clients to perform USB transfers without having to know the intricacies of a particular hub controller.

USB driver detects device

The USB client driver performs two major tasks: device enumeration and device operation. During device enumeration, the client driver obtains all the configuration information it needs from the USB device, including relevant descriptors, and performs other tasks, such as selecting a configuration. During normal operation of the device, requests from user programs are handled and communication is performed with the device.

There is a distinct series of actions that are always performed when a device is plugged in, and it is crucial that the device handle these actions correctly.

When the host detects a new device, the first action it performs is to send a GET_DESCRIPTOR command for the device descriptor on the default control endpoint. The device will begin returning the descriptor on the default endpoint, but it is important to know that the operating system will read only one packet of the descriptor. After receiving one packet, apparently to confirm that the device is working, a zero length OUT packet is sent to terminate the transfer. If the device does not correctly handle the situation of an aborted transfer of a descriptor, the device will not enumerate.

The second step the host performs during enumeration is sending a SET_ADDRESS request on the default endpoint. This is performed automatically by the operating system and the device merely needs to accept the request.

The next step the host performs is sending another GET_DESCRIPTOR command for the device descriptor. On this request, however, the host will obtain all 18 bytes of the device descriptor. The operating system will use information in the descriptor to determine what device driver to load. The idVendor, idProduct and bDeviceClass fields are all used by the operating system to load drivers. The final step the host performs before handing control over to the device driver is obtaining the configuration descriptor. At this point, the operating system will load the device driver that it selects to control the new device.

USB is a modern bus standard that supports a vast range of peripherals; however, the complexity of the drivers is likewise increased. Commercially available device driver toolkits (such as bSquare's WinDK and USB Extension) make the development of drivers an easier task than just using the DDK.

We will soon see new peripherals using USB hastening the acceptance of the bus into the mainstream.


Author Information

Bill Kyle, director of marketing, Platform Technologies bSquare Corp. (Bellevue, Wash.)




No comments
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Robotic safety, collaboration, standards; DCS migration tips; IT/OT convergence; 2017 Control Engineering Salary and Career Survey
Integrated mobility; Artificial intelligence; Predictive motion control; Sensors and control system inputs; Asset Management; Cybersecurity
Big Data and IIoT value; Monitoring Big Data; Robotics safety standards and programming; Learning about PID
Featured articles highlight technologies that enable the Industrial Internet of Things, IIoT-related products and strategies to get data more easily to the user.
This article collection contains several articles on how automation and controls are helping human-machine interface (HMI) hardware and software advance.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Mobility as the means to offshore innovation; Preventing another Deepwater Horizon; ROVs as subsea robots; SCADA and the radio spectrum
Future of oil and gas projects; Reservoir models; The importance of SCADA to oil and gas
Big Data and bigger solutions; Tablet technologies; SCADA developments
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
click me