Sunday, September 27, 2009

The USB Process

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 is 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 is available. 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 are guaranteed the bandwidth they need. Bulk and control transfers use whatever space is left. The technical links at the end of the article contain lots of detail if you would like to learn more.

USB Features
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.,the bus has a maximum data rate of 480 megabits per second.
•A USB cable has two wires for power (+5 volts and ground) and a twisted pair of wires to carry the data.
•On the power wires, the computer can supply up to 500 milliamps of power at 5 volts.
•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.
•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 USB cable to carry power and data.

Inside a USB cable: There are two wires for power -- +5 volts (red) and ground (brown) -- and a twisted pair (yellow and blue) of wires to carry the data. The cable is also shielded.

No comments:

Post a Comment