Every personal computer you buy today comes with one or more USB port connectors. These USB ports allow you to attach peripheral devices such as printers, computer mice, and other accessories to your computer quickly and easily. Most (if not all) wide release operating systems support the USB technology as well, so the installation of device drivers is fairly quick and straightforward. Compared with other ways of connecting devices to your computer (which might include parallel ports, serial ports and special cards that you install inside the computer’s case), USB devices are incredibly simple.
In this article, we will take a look at USB ports in general – both from a user and a technical standpoint. You’ll see why the USB system is so flexible and how it is able to support so many devices so easily – it’s really an incredibly versatile system. If you’ve been around since before the dawn of the Internet age, you’re probably familiar with the issue of connecting peripheral devices to computers. Before the Universal Serial Bus became available, it was a real struggle to have something pair up with your specific model computer.
Printers would connect to their own parallel printer ports, and most computers only came with the one. Things like external storage media, which would need a very high speed connection to the computer, would use its own parallel ports as well, often with limited success and not much speed or compatibility in most cases. Modems used the serial port, but so did some printer models and a number of other ancient pieces of tech like personal digital assistants (PDAs) and large, bulky digital cameras. Most computers had at most 2 serial ports, and they were incredibly slow in most cases.
If your device needed a faster connection, then they came with their own cards, which had to fit in a card slot inside the computer’s case. Unfortunately, the number of card slots is limited as well and some of the cards are difficult to install. The goal of USB is to end all of these headaches. The Universal Serial Bus enabled you to have a single, standardized, one-size-fits-all way to connect up to 127 devices to any computer. Just about every peripheral made today now comes in some kind of USB format. Here’s a very generic list of USB devices that you can buy today:
- Flight yokes
- Digital cameras
- Scientific data acquisition devices
- Video phones
- Storage devices
- Network connections
Connecting a USB device to a computer is fairly straightforward. You simply locate the USB connector on the back of your machine and plug the USB connector directly into it. If it’s a fairly new device, then the operating system of your host computer with automatically detect it and will request the driver disk. If the device has already been installed, the computer will then activate it and start communicating with it. USB devices can be connected and disconnected at any time.
Many USB devices already come with their own built in cable and the cable has an “A” connection on it. If not, then the USB device has a separate socket on it that accepts a USB “B” connector.
The USB standard uses “A” and “B” connectors to keep it simple:
- “A” connectors head “upstream” toward the computer.
- “B” connectors head “downstream” and connect to individual devices.
By utilizing different USB connectors on the upstream and downstream end, it’s pretty much impossible to ever get confused. If you connect any USB cable’s “B” connector into a device, you can be positive that it will always function properly. In the same way, if you plug any “A” connector into any “A” socket you’ll also know that it will operate accordingly as well.
Most of the personal computers that you buy today will come with at least one or two of this USB ports. But with so many USB devices on the market nowadays, you can easily run out of them pretty quickly. The typical computer user probably has their keyboard and computer mouse plugged in first, not to mention a printer, then there’s smartphones or tablets, along with webcams, microphones, and all other kinds of USB technology. Believe me, we know.
So the biggest question is how the heck do we plug in all of these devices into one laptop? The easiest solution for this is something called a USB hub. It’s portable, and can hold anywhere from 4 to a hundred ports. The USB standard itself allows up to 127 devices to be connected through a single USB port, and all officially sanctioned USB hubs are part of that standard. The most common USB hub accepts 4 type A USB connections. You plug your USB hub into a USB port available on your computer, and then you plug your devices (or other hubs) into that hub. By chaining the hubs together, you could (potentially) build up dozens of available USB ports on a single computer system.
USB hubs can either be powered (by a power source independent of your host computer) or unpowered. The USB standard also allows for devices to draw their power from their USB connection. A high power device like a USB printer or scanner will typically have its own power supply, but low-power devices like mice, keyboards, digital cameras, and even smartphones will get their power from the bus in order to simplify them. The power (up to 500 milliamps at 5 volts for USB 2.0 and 900 milliamps for USB 3.0) comes from the computer. If you have lots of self-powered devices (like printers and scanners), then your hub doesn’t need to be powered.
None of the devices connecting to the USB hub need any additional power, so the computer can handle it. If you have lots of unpowered devices like mice and cameras, you probably need a powered hub. The hub has its own transformer and it supplies power to the bus so that the devices don’t overload the computer’s supply.
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 USB host will also send commands or query parameters alongside specific control packets. As the various USB devices are enumerated, the host is keeping track of the total bandwidth that all of the isochronous and interrupt devices are requesting. The can then consume up to 90% of the 480 Mbps of bandwidth that’s available (USB 3.0 increases that speed to 4.8 gigabits per second). After 90% of that 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.