Zibb
Subscribe to Control Engineering
FirstLight
Email
Print
Reprint
Learn RSS

USB helps connect the enterprise

Bill Kyle -- Control Engineering, 1/1/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.)

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

There are no other articles written by this author.

Sponsored Links

 

Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Discussions
  • Webcasts
  • Podcasts
  • Videos

Blogs

  • David Chappell
    Standard profits: Make2Pack and ISA88

    December 2, 2008
    Six vendors’ automation equipment integrated easily, no questions asked
    I mentioned previously that the OMAC booth at Pack Expo 2008 would demonstrate OMAC standards. At the time, I was at “Make2Pack in Europe&hel......
    More
  • Paul Grayson
    AIMing for Automated Vehicles

    December 2, 2008
    Tuesday
    SUNDAY NIGHT WORK SESSION - SNOWSTORM Scott travels 4 hours to get to the AIM workshop and then 4 hours to get home. He usually comes over on......
    More
  • View All BlogsRSS

Webcasts

Engineering-driven Ethernet
This Control Engineering Roundtable Webcast will address the engineering issues you should be aware of when exploring the adoption of Ethernet or when looking to expand its use in your facility.

Bridging gaps with wireless
Discover how you can create stronger, flexible and cost-effective wireless connections for your entire plant. Register today!

View All Webcasts
Advertisements





NEWSLETTERS

Get engineering industry news, trends, and business-critical information delivered directly to your inbox!

Click on a title below to learn more.

Weekly News (Weekly)
Process Instrumentation & Sensors (Monthly)
System Integration Monthly (Monthly)
Process & Advanced Control (Monthly)
Machine Control (Monthly)
Information Control (Monthly)
Automation Control (Monthly)
Product Review (Monthly)
Simplified Safety
Fieldbus Facts
PROFInews North American Edition
About Us   |   Advertising Info   |   Site Map   |   Contact Us   |   Useful Sites   |   FREE Subscription   |   RSS
© 2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites