Home How It Works How a Universal Serial Bus (USB) works

How a Universal Serial Bus (USB) works

150
0

Universal Serial Bus (USB) is a technology specification used to connect computers with input/output peripherals. The specification consists of a male and female four-pin plug, with one pin used to transmit power (five-volt DC, 500-900mA), two pins to send or receive data and one as a ground.

USB connections differ from the serial and parallel ports that they replaced, as they can transmit power and have increased – albeit nonguaranteed – data-transfer speeds. When a USB connection is made between a host device and peripheral (such as a computer to keyboard), a set processing pattern begins. First a reset signal is sent from the host device to the peripheral to ascertain its data rate. Next the connected device’s information is read by the host and, if supported, its drivers are transferred and installed so that proper communication can take place. Finally, under direct control from the host device, data transfer is begun, with files, data packets or media transferred from one to the other. Currently, over two billion USB devices are sold annually.

When the host powers up, it queries all of the devices connected to the bus and assigns each one an address. This process is called enumeration — devices are also enumerated when they connect to the bus. The host also finds out from each device what type of data transfer it wishes to perform:

Interrupt – A device like a mouse or a keyboard, which will be sending very little data, would choose the interrupt mode.

Bulk – A device like a printer, which receives data in one big packet, uses the bulk transfer mode. A block of data is sent to the printer (in 64-byte chunks) and verified to make sure it’s correct.

Isochronous – A streaming device (such as speakers) uses the isochronous mode. Data streams between the device and the host in real-time, and there is no error correction.

The host can also send commands or query parameters with control packets.

As devices are enumerated, the host is keeping track of the total bandwidth that all of the isochronous and interrupt devices are requesting. They can consume up to 90 percent of the 480 Mbps of bandwidth that’s available (USB 3.0 increases that speed to 4.8 gigabits per second). After 90 percent is used up, the host denies access to any other isochronous or interrupt devices. Control packets and packets for bulk transfers use any bandwidth left over (at least 10 percent).

The Universal Serial Bus divides the available bandwidth into frames, and the host controls the frames. Frames contain 1,500 bytes, and a new frame starts every millisecond. During a frame, isochronous and interrupt devices get a slot so they’re guaranteed the bandwidth they need. Bulk and control transfers use whatever space is left.

The Universal Serial Bus has the following features:

The computer acts as the host.

Up to 127 devices can connect to the host, either directly or by way of USB hubs.

Individual USB cables can run as long as 5 meters; with hubs, devices can be up to 30 meters (six cables’ worth) away from the host.

With USB 2.0, the bus has a maximum data rate of 480 megabits per second (10 times the speed of USB 1.0).

A USB 2.0 cable has two wires for power (+5 volts and ground) and a twisted pair of wires to carry the data. The USB 3.0 standard adds four more wires for data transmission. While USB 2.0 can only send data in one direction at a time (downstream or upstream), USB 3.0 can transmit data in both directions simultaneously.

On the power wires, the computer can supply up to 500 milliamps of power at 5 volts. A USB 3.0 cable can supply up to 900 milliamps of power.

Low-power devices (such as mice) can draw their power directly from the bus. High-power devices (such as printers) have their own power supplies and draw minimal power from the bus. Hubs can have their own power supplies to provide power to devices connected to the hub.

USB devices are hot-swappable, meaning you can plug them into the bus and unplug them any time. A USB 3.0 cable is compatible with USB 2.0 ports — you won’t get the same data transfer speed as with a USB 3.0 port but data and power will still transfer through the cable.

Many USB devices can be put to sleep by the host computer when the computer enters a power-saving mode.

The devices connected to a USB port rely on the cable to carry power and data.

LEAVE A REPLY

Please enter your comment!
Please enter your name here