The standard was made to improve plug and play devices. This means that a device can be plugged into a free socket, and simply work. The computer will notice the device. The computer sometimes installs special software to use the device. The device can be removed after it stops being used. This technology is called "hot swapping". "Hot swapping" means it can be plugged and unplugged while the power is on. The computer does not need to be turned off for people to change the devices.
USB can provide a small amount of power to the attached device through the USB cord. Devices that only need a little power can get it from the bus, and do not need a separate electric power plug. That allows gadgets like USB battery chargers, lights, and fans.
The first version of the Universal Serial Bus was created in 1995. This new technology became an instant success. Since the introduction of USB, people that make electronic devices thought about how it could be used in the future. Today, USB connects a computer or other devices like laptops and MP3 players to peripheral devices.
The bus was introduced by seven companies which represent the leaders in the industry of information technology: Compaq, IBM, Intel, Microsoft, NEC, Northern Telecom, and Digital Equipment Corporation (DEC).
Several years earlier, adopters and developers of USB held a meeting called Plugfest at a special hotel in California to test their devices. They selected a hotel that included rooms for sleeping and for testing. The meeting lasted three days. During the meeting, the representatives of about 50 companies connected their USB devices to one general host system.
The logo of the USB device also has its own history. The USB logo was in development for several months.
Currently, five different USB standards are used: USB 1.0, USB 1.1, USB 2.0, USB 3.0 and USB 3.1. USB 3.1 was released in 2016 and doubled the speed of 3.0. It optionally uses a different connector called USB Type-C, which is reversible (meaning you can plug it in both ways). USB 1.0 is now rarely used.
USB offers five different transfer speeds: 1.5 MBit per second (called low speed), 12 MBit per second (Full Speed), 480 MBit/second (Hi Speed), 5Gbit per second (called super speed), and 10 Gbit/s (“super speed+“). Hi speed is only available in USB 2.0 and later, and Super speed is only available in USB 3.0. These speeds are raw bit rates (in Million bits per second). The actual data rate is usually lower due to protocol overhead.
In order to use the hi speed transfer rate, the USB controller and the connected device both need to support it. USB is backwards compatible. Faster and slower USB devices and controllers can be connected together, but they will run at the slower speed.
Almost all computers sold today have USB ports, and most of them support USB 2.0 or later. The number of ports they have is usually limited, though. Between two and six ports are common. USB allows connecting USB hubs to add more USB ports.
The hubs themselves are also compliant to one of the USB standards. Devices connected to a USB 1.1 hub will only go as fast as USB 1.1 rates. Devices connected to a later controller can use different standards.
USB was designed to be easy to use. The engineers learned from other connectors before they designed USB connectors. There are 3 connectors.
A USB system has an asymmetric design. It is made of a host, several downstream USB ports, and multiple peripheral devices connected in a star topology. Additional USB hubs may be included in the tiers, allowing branching into a tree structure with up to five tier levels.
A USB host can have multiple host controllers. Each host controller provides one or more USB ports. Up to 127 devices, including the hub devices, may be connected to a single host controller.
USB devices are linked in series through hubs. There is always one hub known as the root hub. The root hub is built into the host controller. There are special hubs, called "sharing hubs". These allow multiple computers to access the same peripheral devices. They work by switching the access between PCs, either manually or automatically. They are popular in small-office environments. In network terms, they converge rather than diverge branches.
A physical USB device can have several logical sub-devices that are referred to as device functions. A single device may provide several functions, for example, a webcam (video device function) with a built-in microphone (audio device function).
USB device communication is based on pipes (logical channels). Pipes are connections from the host controller to a logical entity on the device named an endpoint. The term endpoint is occasionally used to incorrectly refer to the pipe. A USB device can have up to 32 active pipes, 16 into the host controller and 16 out of the controller.
Each endpoint can transfer data in one direction only, either into or out of the device, so each pipe is uni-directional. Endpoints are grouped into interfaces and each interface is associated with a single device function. An exception to this is endpoint zero, which is used for device configuration and which is not associated with any interface.
When a USB device is first connected to a USB host, the USB device enumeration process is started. The enumeration starts by sending a reset signal to the USB device. The speed of the USB device is determined during the reset signaling. After reset, the USB device's information is read by the host, then the device is assigned a unique 7-bit address. If the device is supported by the host, the device drivers needed for communicating with the device are loaded and the device is set to a configured state. If the USB host is restarted, the enumeration process is repeated for all connected devices.
The host controller polls the bus for traffic, usually in a round-robin fashion, so no USB device can transfer any data on the bus without an explicit request from the host controller.
The computer hardware that contains the host controller and the root hub has an interface for the programmer. It is called Host Controller Device (HCD) and is defined by the hardware implementer.
For USB 1.0 and 1.1, there were two different HCD implementations, Open Host Controller Interface (OHCI) and Universal Host Controller Interface (UHCI). OHCI was developed by Compaq, Microsoft and National Semiconductor, UHCI by Intel.
VIA Technologies licensed the UHCI standard from Intel; all other chipset implementers use OHCI. UHCI relies more on software. This means UHCI is slightly more processor-intensive than OHCI but easier and cheaper to make. Because there were two different implementations, operating system vendors and hardware vendors needed to develop and test on both of them. This increased cost.
The USB specification does not specify any HCD interfaces and is not concerned with them. In other words, USB defines the format of data transfer through the port, but not the system by which the USB hardware communicates with the computer it sits in.
During the design phase of USB 2.0, the USB-IF insisted that there was only one implementation. The USB 2.0 HCD implementation is called the Enhanced Host Controller Interface (EHCI). Only EHCI can support hi-speed (480 Mbit/s) transfers. Most of PCI-based EHCI controllers have other HCD implementations called 'companion host controller' to support Full Speed (12 Mbit/s) and may be used for any device that claims to be a member of a certain class. An operating system is supposed to implement all device classes, so it can provide generic drivers for any USB device. Device classes are decided upon by the Device Working Group of the USB Implementers Forum.
Device classes include:
|00h||Device||Unspecifiedclass 0||(Device class is unspecified. Interface descriptors are used for determining the required drivers.)|
|01h||Interface||Audio||Speaker, microphone, sound card|
|02h||Both||Communications and CDC Control||Ethernet adapter, modem, serial port adapter|
|03h||Interface||Human Interface Device (HID)||Keyboard, mouse, joystick|
|05h||Interface||Physical Interface Device (PID)||Force feedback joystick|
|06h||Interface||Image||Digital camera (Most cameras function as Mass Storage for direct access to storage media).|
|07h||Interface||Printer||Laser printer, Inkjet printer|
|08h||Interface||Mass Storage||USB flash drive, memory card reader, digital audio player, external drives|
|09h||Device||USB hub||Full speed hub, hi-speed hub|
|0Ah||Interface||CDC-Data||(This class is used together with class 02h - Communications and CDC Control.)|
|0Bh||Interface||Smart Card||USB smart card reader|
|DCh||Both||Diagnostic Device||USB compliance testing device|
|E0h||Interface||Wireless Controller||Wi-Fi adapter, Bluetooth adapter|
|EFh||Both||Miscellaneous||ActiveSync and Palm sync device|
|FEh||Interface||Application Specific||IrDA Bridge|
|FFh||Both||Vendor Specific||(This class code indicates that the device needs vendor specific drivers.)|
Note class 0: Use class information in the Interface Descriptors. This base class is defined to be used in Device Descriptors to indicate that class information should be determined from the Interface Descriptors in the device.