USB

What is USB

USB (Universal Serial Bus) is a simple way of connecting a variety of devices to a computer. It has improved over the years to increase speeds and how devices can be connected. Because it is a serial bus, there are only 4 wires in the cabling. You can use hubs to extend your cabling or to enable plugging in multiple devices.

Interfaces

Each USB device has one or more interfaces. Each interface has a type:

Interrupt

This allows notification from a device to the computer. For example a cell phone may use it to indicate there is an incoming call, or a scanner may use it to indicate that a button has been pressed.

Bulk

This is bidirectional allowing data to be sent to and from the device. BitPim talks directly to the bulk interface on devices, or via device drivers that talk to tbe bulk interface.

Isochronous

This is used for devices where lots of data is generated, and where you don't need 100% reliability. An example would be a webcam sending its images.

Drivers

While the method of talking to devices is standardised (using USB request blocks), each device still needs to have its data interpreted and presented to the operating system in the correct manner.

For example, a USB modem needs to look like a communications port, USB speakers need to look like audio devices and a USB keyboard needs to look like a keyboard.

Device drivers are responsible for hooking into the right level in the host computer and for formatting URBs and interpreting the responses. The device drivers use the identification information to hook into the right device.

Identification

Each device is identified by a 16 bit vendor ID, and a 16 bit product ID. By convention these are written as 4 digit hexadecimal numbers, but usually without any sort of prefix indicating the number is hexadecimal.

There are then a number of interfaces identified by type. Each one also lists what protocol it is. For example class 7 is printer and subprotocol 2 within that is bidirectional. Some operating systems use this information to automatically assign generic device drivers.


BitPim Online Help built 17 January 2010