The first PCs shipped in 1981 used serial ports and parallel ports to connect external peripherals. Although the RS-232 serial and Centronics parallel technologies had improved gradually over the years, by the mid-'90s those technologies had reached their limits. In terms of connectivity to external devices, the PC of 1995 differed very little from the PC of 1981; the ports were a bit faster, perhaps, but they were fundamentally similar.
In the interim, the bandwidth needs of external peripherals had increased greatly. Character-mode dot-matrix and daisy-wheel printers had given way to graphic-mode page printers. Modems were pushing the throughput limitations of RS-232. Also, it was obvious that emerging categories of external peripherals—such as digital cameras, CD writers, tape drives, and other external storage devices—would require much more bandwidth than standard serial or parallel connections could provide. Neither was bandwidth the only limitation. Serial and parallel ports have the following drawbacks for connecting external peripherals:
Low bandwidth:Standard serial ports top out at 115 Kb/s, and parallel ports at 500 Kb/s to 2 Mb/s. Although these speeds are adequate for low-speed peripherals, they are unacceptably slow for hi-speed peripherals.
- Point-to-point connections: Standard serial and parallel ports dedicate a port to each device. Because there is a practical limit to the number of serial ports and parallel ports that can be installed in a PC, the number and type of external devices that can be connected are limited.
- Resource demands: Each serial or parallel port occupies scarce system resources, in particular an IRQ. A PC has only 16 IRQ lines, most of which are already occupied. It is often impossible to install the required number of serial or parallel ports because insufficient interrupts are available.
- Ease-of-use issues: Connecting devices to serial or parallel ports may be complex and trouble-prone because cable pinouts and port configurations are not well-standardized. Serial ports in particular accept a wide variety of different cables, none of which is likely to be interchangeable with any other. Parallel ports use more standardized cable pinouts, but various parallel devices may require different port configurations. In particular, attempting to daisy-chain parallel devices via pass-through ports often introduces incompatibilities. Also, serial and parallel ports are always located on the rear of the computer, which makes connecting and disconnecting them inconvenient.
What PCs really needed was a fast bus-based scheme that allowed multiple devices to be daisy-chained together from a single port on the PC. SCSI had the potential to fulfill this need, but its high cost and complexity made it a nonstarter for that purpose. IEEE-1394, also called FireWire, might have been suitable, but FireWire is a proprietary Apple technology with, at the time, high licensing costs that motherboard and peripheral makers refused to pay. The PC industry had long been aware of the need for better external peripheral connectivity, but it was not until 1996 that vendors finally began to address it. Their solution is called Universal Serial Bus (USB).
USB is aptly named. It is universal because every modern PC or motherboard includes USB and because USB allows you to connect almost any type of peripheral, including modems, printers, speakers, keyboards, scanners, mice, joysticks, external drives, and digital cameras. It is serial in that it uses serial communication protocols on a single data pair. It is a logical bus (although the physical topology is a tiered star) that allows up to 127 devices to be daisy-chained on a single pair of conductors.
One convenient way to think about USB is as an outside-the-box Plug-and-Play bus. All connected USB devices are managed by the USB Host Controller Interface (HCI) in the PC, and all devices share the IRQ assigned to that HCI. Devices can (in theory, at least) be plugged or unplugged without rebooting the computer.
Although nearly all PCs and motherboards made since 1997 have USB ports, for a long time those ports were nearly useless, for three reasons:
- USB requires native operating system support to provide full functionality. Until Windows 98 and Windows 2000 began to proliferate, that support was lacking. Windows NT 4 and early Windows 95 releases have no USB support, although a few peripheral makers provided custom drivers to allow their devices to work under these operating systems. Windows 95 OSR 2.1 introduced limited support for a few USB devices, but using USB under Windows 95 is an exercise in frustration. Windows 98/98SE/Me/2000/XP support USB 1.1. Windows XP supports USB 2.0 natively if SP1 or later is applied, although you may need to download the latest release of the USB 2.0 driver from the Windows Update site. Even with the latest service pack installed, Windows 2000 does not support USB 2.0 directly, although you can download native Windows 2000 USB 2.0 drivers from the Windows Update site. For more information about USB 2.0 support under Windows 2000 and Windows XP,. The Linux kernel has included USB support since 2.2.18. The Linux 2.4.20 or later kernel supports USB 2.0 directly.
- USB peripherals were hard to find prior to 1999, and were often more expensive than versions that used legacy interfaces. By 2000, that situation had reversed itself, with USB peripherals readily available and often cheaper than peripherals with legacy interfaces. As of July 2003, nearly all mainstream external peripherals use the USB interface, and old-style serial and parallel peripherals are becoming hard to find.
- Early USB ports and peripherals often exhibited incompatibilities and other strange behavior. Removing a connected peripheral might crash your system, or a newly connected device might require a reboot to be recognized. Some peripherals demanded that their drivers be reinstalled every time they were disconnected and then reconnected. Some peripherals drew so much power that other devices on that USB port would cease operating or the system would refuse to boot until the offending device was disconnected. And so on. In fact, these conflicts and incompatibilities remain a problem with more recent USB interfaces and devices, although the problems are less severe. As of July 2003, it appears that the teething pains USB experienced during its early days have largely been overcome, although even some very recent motherboards and chipsets continue to cause problems.
Despite these problems, by mid-2000 USB had achieved critical mass. With Windows 98/SE/Me and Windows 2000 available and USB peripherals shipping in volume, USB transitioned from a developing standard with great potential into a real-world solution, albeit a flawed one. USB has now largely replaced the legacy connectors that clutter the back of recent PCs.
Legacy-reduced motherboards that began shipping in 2000 replaced or supplemented serial and parallel ports with additional USB ports—usually four rather than the previously standard two. Legacy-free motherboards provide nothing but USB ports for connecting external peripherals (other than perhaps video), and are usually equipped with six USB ports—four at the rear and two on the front panel. A few legacy-free motherboards also include IEEE-1394 (FireWire) ports. Most external peripherals now have only a USB interface, as serial and parallel peripherals now teeter on the edge between obsolescent and obsolete.
Despite its slow start and the nagging problems that still sometimes plague it, USB has moved from being the wave of the future to being the current standard.
USB Characteristics
All USB devices share several general characteristics. Among these are:
- Hot swapping :In theory, at least, USB peripherals can be connected to and disconnected from the bus at any time, without shutting down the computer or taking any action to inform applications or the OS that a device is being added or removed. In practice, this is not always the case, particularly with older interfaces and devices.
- Automatic configuration: The USB host controller chipset installed on the PC motherboard or an add-on USB port card manages driver software and allocates bandwidth to each USB device attached to the bus. When a device is added or removed, the USB host controller automatically loads or unloads the driver for that device.
- Interrupt sharing : A USB host controller occupies one interrupt, which is shared among all devices attached to the bus. This small resource footprint allows multiple USB host controllers to be installed in a system without undue demands on scarce IRQs. Although each USB host controller can in theory support as many as 127 devices, it's often better to distribute multiple USB devices among host controllers to avoid conflicts.
- Bandwidth sharing and allocation : A USB 1.1 bus provides 12 Mb/s of bandwidth and a USB 2.0 bus provides 480 Mb/s of bandwidth, which is shared among all devices attached to the bus. Many devices may communicate simultaneously on a USB, provided that adequate bandwidth is available to service all of them at the same time. Properly designed USB peripherals and drivers use bandwidth dynamically, releasing bandwidth they are not using so that it can be used by other devices. For isochronous (time-critical) tasks such as audio or video streams, USB permits dedicating bandwidth as needed to a particular peripheral, although that dedicated bandwidth then becomes permanently unavailable for use by other peripherals.
- Embedded power connections: In addition to providing a data connection, USB provides electrical power to peripherals, allowing you to eliminate the tangle of power cables required by traditional peripherals. That power, however, is limited to 500 milliamps (mA), which must be shared by all unpowered devices connected to the USB port. In practice, that means that only low-power peripherals, such as keyboards and mice, can be powered directly by a USB connection. High-power peripherals, such as printers and scanners, usually (but not always) have their own power bricks and are powered directly from a standard AC receptacle. For example, the Canon Canoscan 1220U relies on the USB port for power. Despite the minimal amount of current available on the USB port, it is possible to connect multiple unpowered USB peripherals by connecting them to powered USB hubs, each port of which has its own 500 milliamp supply.
The following sections detail other important characteristics of USB interfaces and devices.
USB Versions
Three versions of USB exist:
- USB 1.0 : USB 1.0 was the original specification. Most systems produced from 1996 through mid-1998 have USB 1.0 ports. USB 1.0 supports data rates of 1.5 Mb/s and 12 Mb/s. Relatively few USB 1.0 peripherals were produced because by the time USB peripherals began shipping in volume, USB 1.0 had been superseded by USB 1.1. USB 1.0-compliant peripherals generally operate properly when connected to a USB 1.1 or USB 2.0 interface, but USB 1.1 or USB 2.0 peripherals may not function properly when connected to a USB 1.0 interface. USB 1.0 interfaces are primitive and buggy, so if your motherboard has USB 1.0 ports, we recommend you disable those ports in BIOS Setup and install an add-on PCI USB port card. The first release of Windows 98 included USB 1.0 support.
- USB 1.1 : USB 1.1 was formalized in September 1998, although many manufacturers produced USB 1.1-compliant motherboards and peripherals based on the proposed standard long before the formal standard was adopted. USB 1.1 also supports data rates of 1.5 Mb/s and 12 Mb/s, and was largely a clarification of ambiguities in the USB 1.0 specification. A few functional definitions were changed in USB 1.1, including minor changes to hub specifications, removing provision for battery-powered hubs, adding interrupt-out mode, and changes to recommended enumeration to eliminate the requirement for an 8-byte endpoint zero. Most changes, however, merely tightened up the existing requirements because experience had shown that there were enough ambiguities in the USB 1.0 specification to allow producing interfaces and devices that complied with the standard but were not interoperable. USB 1.1 interfaces and devices began shipping in mid-1998 and are still in production. Early USB 1.1 interfaces and devices suffered many incompatibilities, but current production models have relatively fewer such issues. You can download the Universal Serial Bus Revision 1.1 Specification from http://www.usb.org/developers/docs/usbspec.zip.
- USB 2.0 : USB 2.0 was formalized in April 2000, with various errata and Engineering Change Notices later incorporated as supplements. USB 2.0 supports data rates of 1.5 Mb/s, 12 Mb/s, and 480 Mb/s, and provides full backward compatibility with USB 1.0 and USB 1.1 devices.
The uptake of USB 2.0 was slower than expected because USB 2.0 chipsets were slower in arriving than expected and because Microsoft initially did not provide USB 2.0 Windows drivers. Microsoft shipped native USB 2.0 drivers for Windows XP in early 2002 and for Windows 2000 in late 2002. Microsoft has no plans to provide Windows 9X USB 2.0 drivers. Using USB 2.0 under Windows 9X requires drivers supplied by the manufacturer of the motherboard (or PCI/USB card) and USB 2.0 peripherals.
With so many of the major players in the computer industry backing it, USB 2.0 saw a fast ramp-up during late 2002 and into 2003. Most motherboards introduced during fall 2002 and later have chipset-level USB 2.0 support, and by early 2003 USB 2.0 peripherals such as external hard drives and optical drives were readily available. Older systems can be upgraded to support USB 2.0 by adding an inexpensive adapter.
In addition to its much higher speed, the attraction of USB 2.0 is its standardization. Earlier USB versions had frequent compatibility problems, not the least because two different and slightly incompatible controller standards existed. USB 2.0 defines one controller interface, called the Enhanced Host Controller Interface (EHCI), which eliminates many compatibility issues. You can download the most recent complete Universal Serial Bus Revision 2.0 Specification from http://www.usb.org/developers/docs/usb_20.zip.
USB Speeds
USB defines the following three speeds, all of which can coexist on one bus:
- Low Speed : Low Speed USB peripherals operate at a data rate of 1.5 Mb/s, and are supported by USB 1.1 and USB 2.0 interfaces. Low Speed USB is intended for such low-bandwidth devices as mice and keyboards, and is designed to be inexpensive to implement. Low Speed USB devices use a captive cable that can be no longer than 3 meters. Actual throughput on Low Speed USB is typically limited by overhead and other factors to about 1.2 Mb/s, or 150 KB/s.
- Full Speed : Full Speed USB peripherals operate at a data rate of 12.0 Mb/s, and are supported by USB 1.1 and USB 2.0 interfaces. Full Speed is the fastest speed supported by USB 1.0 and USB 1.1, and is intended for such moderate-bandwidth devices as printers and scanners. Full Speed USB devices use active components, which are more expensive to implement than the passive components used by Low Speed USB. Full Speed USB devices use a detachable cable that can be no longer than 5 meters. Full Speed USB seldom exceeds actual throughput of 900 KB/s or so.
- Hi-Speed: Hi-Speed USB peripherals operate at a data rate of 480 Mb/s, and are supported only by USB 2.0 interfaces. Hi-Speed USB is intended for such high-bandwidth devices as external drives. Hi-Speed USB devices use active components that are more expensive than Full Speed USB components. Also, Hi-Speed USB hubs require additional circuitry to arbitrate between mixed Hi-Speed and Full Speed devices connected to that hub. Accordingly, Hi-Speed USB devices, particularly hubs, were initially more expensive than USB 1.1 devices, although that differential had largely disappeared by early 2003. Hi-Speed USB devices use the same detachable cable used by Full Speed USB devices, which can be no longer than 5 meters. Hi-Speed USB typically achieves actual maximum throughput of 35 to 40 MB/s, which is fast enough to keep up with all but the fastest hard drives.
Note that USB bandwidth is shared among all devices connected to the bus, and that the system reserves some bandwidth (typically 10%) for control signals and other administrative purposes. Although many Hi-Speed USB devices require much less than 480 Mb/s, if you do connect more than one high-bandwidth Hi-Speed device to a single USB channel, you may throttle the bandwidth available to each when more than one are operating. In that situation, if your system has more than one USB 2.0 HCI, we recommend splitting your high-bandwidth devices among different host controllers.
USB Topology
USB uses a tiered-star topology. At the center of the star is the USB host, which defines the USB, and only one of which is permitted per USB. (Note, however, that more than one USB host may be installed in a PC, and in fact most recent motherboards have multiple USB hosts installed.) The USB host resides inside the PC, and is implemented as a combination of hardware, firmware, and software. The USB host has one or more USB root hubs, which provide attachment points called USB ports to which USB hubs and USB functions may be connected. (Loosely speaking, a USB function is a peripheral such as a scanner, printer, mouse, digital camera, etc.)
USB hubs use two types of connections. An upstream connection links the USB hub to another USB hub in the next-higher tier. A downstream connection links the USB hub to another USB hub or to a USB function located in the next-lower tier. Each USB hub has one upstream port, and may have as many as seven downstream ports. Via daisy-chaining, USB allows connecting a maximum of 127 devices (USB hubs and USB functions) in a maximum of seven tiers. The limitation on the number of tiers is required to ensure that the most distant USB device can communicate within the maximum allowable propagation delay defined in the USB specification.
If you mix USB 1.1 and USB 2.0 devices on a bus, it's important to understand the following points:
- USB 2.0 hubs support USB 1.0/1.1 and USB 2.0 devices, including downstream USB 1.0/1.1 hubs and USB 2.0 hubs, providing full bandwidth to each device according to its version.
- USB 1.0/1.1 hubs support USB 1.0/1.1 and USB 2.0 devices, but USB 2.0 devices connected to a USB 1.1 hub function as USB 1.1 Full Speed devices (i.e., at 12 Mb/s maximum), which means that it is pointless to connect a USB 2.0 hub downstream from a USB 1.1 hub.
- Although USB 2.0 hubs provide transparent support for Low Speed and Full Speed USB devices, that support incurs significant overhead on the USB 2.0 hub and is intended only for limited use, such as connecting a USB mouse and keyboard. Connecting multiple Low Speed or Full Speed USB devices to a USB 2.0 hub, either directly or downstream, degrades the ability of the USB 2.0 hub to support Hi-Speed USB 2.0 devices. If you have many Low Speed or Full Speed USB devices, connect them to a USB 1.1 root hub port and reserve your USB 2.0 ports for Hi-Speed devices.
USB Cables and Connectors
USB connectors and cables are simple and rigidly standardized. USB defines three plug/jack combinations, designated Series A, Series B, and Series mini-B.
The narrow Series A jacks appear on the back of a PC or USB hub, and may be labeled "down" jacks. These provide connection points for USB peripherals, including USB hubs. Some USB peripherals have permanently connected cables that terminate in a Series A plug. Series A plugs always face upstream, toward the host system, and Series A jacks always face downstream, toward the device.
- USB Series A connector: Peripherals that do not have a permanent cable instead have a Series B jack, shown in figure. Series B plugs always face downstream, and Series B jacks always face upstream. Use a standard USB A-B device cable to connect these peripherals to the PC or hub.
- USB Series B connector: A USB cable uses four wires, two each for data and power. The data wires are a green/white twisted pair that carry +Data and -Data, respectively. USB uses differential digital signaling, which means that the same signal is present on each data wire, but with different polarity. This allows electrical noise to be eliminated from the circuit because induced voltages affect the + and - signals equally, netting to zero. The power wires may or may not be twisted. The red wire carries nominal +5V DC, and the black is a ground return for the power circuit. The USB specification permits cables as long as 5 meters (~16 feet), a limitation enforced by the allowable propagation delay between a port and a connected device.
The USB specification defines only three types of USB cable:
- Low-speed captive cable : Keyboards and similar low-speed devices use a USB low-speed captive cable. The maximum allowable length for a low-speed USB cable is 3 meters (9 feet, 10 inches). This limit is determined by the rise and fall times of low-speed USB signaling, which restricts low-speed USB cables to a maximum length only 60% that of standard full-speed/hi-speed cables. A USB standards-compliant low-speed cable must be captive or hardwired, which is to say that the cable either must be permanently connected to the device or must use a nonstandard or proprietary connector on the end that connects to the device. The concern is that if a low-speed USB device used a standard USB device connector, a standard detachable USB cable longer than acceptable for low-speed USB devices could be used to connect that device.
- Standard detachable cable : Most full-speed and hi-speed USB devices use a USB standard detachable cable. This cable is terminated on one end with a Series A plug and on the other with a Series B plug or Series mini-B plug. The maximum allowable length for a standard detachable cable is 5 meters (16 feet, 5 inches).
- High-/full-speed captive cable: Some full-speed and hi-speed USB devices use a USB hi-/full-speed captive cable. This cable is terminated on one end with a Series A plug. The other end terminates either as a hard-wired connection to the device or with a vendor-proprietary connector. The maximum allowable length for a hi-/full-speed captive cable is also 5 meters.
Although the USB standard states that only these three cable assemblies are acceptable, it further emphasizes it by specifically prohibiting the following cable assemblies, all of which have been manufactured and sold despite their non-compliance:
- Cable assembly that violates USB topology rules:Some vendors produce cables that terminate with two Series A plugs, two Series B receptacles, or two Series mini-B receptacles, which allow connecting USB ports and devices in prohibited combinations.
- Extension cable assembly: A cable that terminates with a Series A plug and a Series A receptacle, a Series B plug and a Series B receptacle, or a Series mini-B plug and a Series mini-B receptacle is specifically prohibited by the USB specification. However, many vendors sell such cables, including some vendors who should know better. The purpose of these cables is to extend the distance between port and device by joining multiple cable segments. The risk is that the joined cables will exceed the maximum 5 meters permissible under the standard, which can cause problems, from sporadic operation to complete failure of the entire USB. Even if the joined cables total less than 5 meters, the electrical characteristics of the extended cable may fall outside specifications. Avoid using extension cables under any circumstances.
- Standard detachable cable assembly for low-speed USB devices : The USB specification does not permit low-speed devices to use standard detachable cables. Standard detachable cables are used only to connect hi-speed/full-speed devices. Their capacitive load exceeds the maximum allowable for a low-speed device.
USB uses a set of unidirectional and bidirectional pipes to transfer user data and control information between the host and USB devices. Each device may support multiple pipes for different purposes, and data transferred in one pipe is independent from data transferred in other pipes. For example, a USB printer might have one pipe that it uses to receive page data from the host, and a second pipe that it uses to transfer status information to the host. USB defines the following data flow types:
- Isochronous Data Transfers : Isochronous Data Transfers are used for periodic, continuous communication between the host and a device, typically time-critical data such as audio or video streams. Isochronous Data Transfers are enabled by reserving the required amount of bandwidth for the isochronous device, which the USB host controller makes unavailable to other devices whether the isochronous device happens to be using that bandwidth at any given time. Isochronous Data Transfers have the highest priority for bandwidth. If all available bandwidth is reserved for Isochronous Data Transfers, no other device can use the USB.
- Interrupt Data Transfers : Interrupt Data Transfers are used for small, limited-latency transfers when timely, reliable delivery of data is required—for example, to receive coordinate changes from a mouse or status changes from a modem. Interrupt Data Transfers have lower priority for available bandwidth than do Isochronous Data Transfers.
- Control Transfers: Control Transfers are used to configure a device when it is connected to the USB, and may be used for other device-specific control, configuration, and status commands, including controlling other pipes on the device. Control Transfers usually comprise small amounts of data that are not time-critical, and have lower priority for available bandwidth than do Interrupt Data Transfers.
- Bulk Data Transfers : Bulk Data Transfers are used to communicate large amounts of nonperiodic, bursty data with relaxed timing constraints to a device—e.g., sending page data to a USB printer. Bulk Data Transfers are not time-critical, and have the lowest priority for available bandwidth. Some early HCIs implemented bulk mode poorly, and so work properly with USB devices such as keyboards and mice but are unsuitable for use with devices such as scanners and printers.
No comments:
Post a Comment