USB

Universal Serial Bus

*** see also www.usb.org  and  http://www.usb.org/developers/docs for specifications and white papers

USB has been a godsend to millions of computer users.  Not because it is a new and exciting technology - which it is.  It has literally saved people from having to buy two PC's -  as many have simply run out of ISA and PCI slots !!!

USB in a connection standard for computers that includes a description of a rectangular port that you can plug anywhere from 1 up to 127 devices into.  The port allows bidirectional data flow, and supplies power to the device/s

USB is a "polled bus" technology.  In other words, your system continually checks (polls) for the presence of data on the USB bus, and reacts accordingly.

The Specs

These are very long, complex documents - to download click the following links:

USB 1.1 Specs                    USB 2.0 Specs

USB Logo's 

Look for the following logo's when purchasing USB devices and USB hubs.  These logos and USB standards in general are approved by the USB-IF (USB Implementers Forum).

Certified USB 1.1 Logo - this logo indicates that the product has successfully completed the USB-IF Compliance Testing Program for products operating at original USB speeds (1.5 Mb/s or 12 Mb/s).  These speeds are fine for keyboards, joysticks, mice, etc.
Certified Hi-Speed USB 2.0 Logo  -  this logo indicates that a product has successfully completed the USB-IF Compliance Testing Program and supports the Hi-Speed USB data transfer rate of 480 Mb/s.  Products that can take advantage of the faster data transfer rates of Hi-Speed USB include products such as CD-RWs, DVD drives, flash card readers, digital cameras and scanners.

USB Connectors

 USB Physical Interfaces

There are two types of USB interfaces :

NOTE: there are also Series mini-B interfaces, which are 6.8 x 3 mm

USB Electrical Interfaces

Each connector has 4 electrical leads:  5v power, ground (0 v), and 2 wires for the signals.

USB "Tiers"

USB supports up to 7 tiers - which describes the way that ports, hubs and devices (also called "functions") can be daisy-chained.  The main USB port is always tier-1.  Both hubs and devices can occupy tiers 2 through 6.  Tier 7 can only be a device since it is the end of the daisy-chain.  So, using this structure you cannot connect up 127 devices in a row serially - instead you would have to use hubs and devices in combination.


In reality, rarely does anyone use more than one hub.  Most hubs are 4 ports but some offer up to 16 ports.  90% are 4-port hubs, and 99% are self-powered (active) hubs.

 

The Host Port

The host port is the USB port at the root of the tiered tree - it is the actual port on the back of your PC.  No matter how you connect up your hubs and devices - it has no idea about the structure.  It does not "see" the hubs, and views every device as if it were directly attached.  This view looks at each device as a "logical device", as follows.  Data flows through each connecting line between the host and the device, and each of these lines are called "pipes"

 

Hubs

There are several types of hubs - they are used to extend the number of ports, since the root has only one port.  We use the 4-port hub to describe these since it is so common :

Root Port Hubs - attached directly to the root

Bus-Powered Hubs (passive hubs) - they get all their power from the port the are connected to.  They come in two flavors - low power (rare) and high power.  The low power hub can only draw a max of one unit load from the source bus.  The high power hub can draw up to 500 mA of power.  However it has no flexibility in the way the allot power to their own ports . . . a max of 1 unit per port (100 mA per port), no matter what the devices request.  Actually 

Self-Powered Hubs (active hubs) - these use an AC/DC adapter that plugs into your AC wall outlet, so that they can supply power to their ports.  They still rely on 100 mA from the host port to power their controller - so that if the external power is lost the system can still communicate with the hub and correctly report a "power down" condition rather than incorrectly reporting a "disconnected condition".  The self-powered hub can supply up to 500 mA to each port, and therefore can supply up to a total of 2 amps for a 4-port hub.  

NOTE:  the self-powered hub has alleviated many problems that people have had with failed power budgets !!

 

Over-Current protection - if a device or hub draws more current than is allotted, the hub will "throttle down" the current being sent to that device and will report this condition to the USB system.

Enumeration

When the system boots up, the USB port communicates with all connected devices, assigns a USB address to each, and grants each one or more "loads" of current (each load is 100 mA).  This is called the enumeration phase.  The host negotiates to allow devices more than 1 load if they require it.  

The USB specs say that each host port, unless it is battery powered, must be able to supply 5 unit loads (ie 0.5Amps). 4 x 0.5Amps = 2Amps total for a 4-port card

For example, you may have a 4-port passive hub with a mouse and scanner attached.  The hub itself requests 1 load (100 mA), the mouse requests 1 load (100 mA) and the scanner requests 2 loads (200 mA) - for a total of 400 mA.  Since the main port is capable of 500 mA max, it approves all requests and has 100 mA to spare.

USB Current and Power

Virtually all of today's hubs are "self-powered", although there are some older "bus-powered" hubs that rely on the main port (the root) to supply power.

NOTE:  no matter what current rating a device has - when it is first connected, it will only be allotted 100 mA initially to protect against initial current spikes !!

You may have to calculate the power, or at least the current of the devices you connect, if you plan to have several hanging off of a USB 4-port hub.  The main port can supply up to 500mA (500 milli-amps = .5 = 1/2 Amp) of current at a constant 5 volts.  To calculate power :  

P = IE  (Power = Current x Voltage)

P = .5 x 5 = 2.5 watts

You probably will not need to know the power, though, since most small devices include their peak current in the specs.  Now - the 500 mA has to be divided among the connected devices.  

The USB port supplies power, if needed, by the device.  Many devices, such as printers and scanners, supply their own power.  Devices such as mice and keybboards rely on the USB port for power.  One would think then, that if they daisy chain multiple devices that they will run out of power - but actually, each hub along the chain supplies it's own power to each of it's own ports - not relying on the main port for power.  You could possibly find a "passive" USB hub somewhere, but all the ones I have seen come with a power supply.

Maximum Cabling Distances

USB allows a cable length of no more than 5 meters for any directly attached device !!  Low-speed devices (1.5 Mbps and below) are limited to 3 meters.

However - that is 5 meters "per cable".  You can extend this with self-powered hubs, since they regenerate the signal and are repeaters.  So, with the maximum of 5 hubs connected with 5m cables and a 5m cable going to your full speed device, this will give you 30m of cable (5 meters between hubs, and 5 meters for the device).

With a low speed device, you will be able to get a range up to 27m (5 meters between hubs, and 3 meters for the device).

NOTE:  if you need a long distance - the only option is to put a cheap PC or laptop out where you need the device to be and network to it with the first PC via Ethernet (which allows 500 meters).

 

USB 1.1  vs  USB 2.0

USB 1.1 supports speeds up to 12 Mbps (Mega-bits per sec).  Also referred to as Hi-Speed USB, USB 2.0 is an external bus that supports data rates up to 480Mbps. USB 2.0 is an extension of USB 1.1. USB 2.0 is fully compatible with USB 1.1 and uses the same cables and connectors. Hewlett-Packard, Intel, Lucent, Microsoft, NEC and Philips jointly led the initiative to develop a higher data transfer rate than the 1.1 specification to meet the bandwidth demands of developing technologies. The USB 2.0 specification was released in April 2000.

Version Data Rate Max Cable Length ** Max # of Devices Comments
USB 1.0 1.5 Mbps 3 meters 127  
USB 1.1 12* Mbps 5 meters 127  
USB 2.0 1.5, 12*, and 480 Mbps 5 meters 127 Backwards compatible with USB 1.0 and 1.1
Hi-Speed USB 480 MBps 5 meters 127 Same as USB 2.0 but only specifies the top speed

* for the 12 Mbps data rate limit - manufacturers quote only 11 Mbps - apparently the data is not reliable at 12 Mbps

** low speed devices have a max cable distance of 3 meters

NOTE: Hi-Speed USB is basically the same as USB 2.0  -  but it defines only the top speed of 480 MBps.

USB 1.1 to USB 2.0 Upgrade Issues

Assuming you have a PC that has USB 1.1 (which is most likely), if you plug your Hi-Speed USB 2.0 peripheral into the USB 1.1 system, your system will perform at the USB 1.1 speed. You will need to update your PC either by adding in a PCI add-in card or purchasing a new MB with a discrete host controller that supports Hi-Speed USB 2.0 and installing Hi-Speed USB 2.0 drivers.

USB OTG (USB On-The-Go)

This is a new standard being developed so that devices themselves can be used to connect directly to other USB devices.  It allows them to communicate, whereas with standard USB they can onlt communicate with the Host USB port and the hubs.  

USB OTG devices still require a connection the the Host Port !!!

History of USB

The Slots Fiasco

In the late 90's, many of the power PC's came with 6 slots for cards:  1 ISA slots, 1 shared IS/PCI slot (cane be used for either), 3 PCI slots, and 1 AGP slot for the Video card.  Even this was not enough, as more and more peripherals came to market.  Then, stupidly, the manufacturers figures that only power users needed that many slots, and they began making PC's for the "masses", with just 3 or 4 PCI slots. 

For example, a common setup includes the following cards :

The older "power PC's" can support this, just barely.  But what if you want a second printer?  There is only one printer port, so you need a card.  What if you want to add a CF (Compact Flash) card reader to import your digital images?  You need a card to connect the reader.  What if you want one of the many fancy add-on peripherals, such as the KDS CD tower (allows you to select from 72 CD's in the software, and then the CD pop's out to be used).  In all cases you were simply out of luck.

Even worse, if you trashed the old PC for a nice, new 3 Gbps screamer, you now have only 3 or 4 PCI slots and one AGP slot.  Now you have to decide what card to remove !!

USB to the Rescue

USB is a rectangular port on the back of your PC that can support virtually any type of device !!  A single USB port can be used to connect up to 127 peripheral devices, such as mice, modems, sound cards, hard drives, printers, keyboards, etc. USB also supports Plug-and-Play installation and hot plugging - you simply plug the device into the USB port while your PC is running, and a message will pop up saying "New Hardware Found".  In addition, only the USB port requires an interrupt  .  .  .  you could connect 127 devices to your USB port, but you'd still use one IRQ, for the controller. The USB devices themselves don't take up system IRQ's.  So no more juggling IRQ's, which has always been a major headache.

Overall, there just isn't anything bad to say about USB.  It was the "Mother of all Inventions".

Starting in 1996, a few computer manufacturers started including USB support in their new machines. It wasn't until the release of the best-selling iMac in 1998 that USB became widespread. It is expected to completely replace serial and parallel ports.

One or two USB 1.1 ports can be found on the back of most computers from 1997 through 2001 - right next to the Mouse and Keyboard ports.  PC's manufactured after that will have two USB 2.0 ports.