To (US)B or not to (US)B, That Is the Question
(with apologies to the bard)
by Dunc Petrie

A query in a Windows' SIG about the vagaries of USB thumb drives - removing them without data loss - piqued my curiosity to learn more. Was it the peripheral, the USB port, the operating system, some of them, or all of them together?

Historically, serial connections appeared early in the game; by today's standards those early protocols were slow, cranky and demanded end-user knowledge of myriad settings. Parallel connections soon came to the fore and the serial interface was relegated to the bleachers, although modems remained a stubborn exception for some time.

Serial connections use a simple premise: send the data one bit at a time - head to tail - in a continuous stream. As originally implemented, this was slow and suited only for small data streams. In contrast, parallel connections sent at least one byte (8 bits) simultaneously along individual cables. For reliable parallel bus communications the trick is to make each bit march in step and arrive at the destination at the same instant in time. As bus speeds increase this electronic feat becomes increasingly difficult to maintain. Crosstalk was another problem; as rates (frequencies) increase, signals have a tendency to radiate from one wire to another with predictable havoc. This "law of the inevitable" was instrumental in introducing the 80 wire/40pin connector for ATA 66 and beyond. Hard drives have finally yielded with SATA replacing the long-enduring parallel EIDE/ATA/ATAPI 100/133.

Currently, high speed serial buses are increasingly the norm: nearly every computer and peripheral has a USB port. It was originally introduced, as Version 1.1, with a maximum transfer rate of 12.5 Mbps (Megabits per second). Version 2.0 (aka Hi-Speed) increased the raw transfer rate almost forty-fold to 480 Mbps. For comparison, a recent parallel port (EPP/ECP) would transfer data around 22 Mbps. In all cases, some of this bandwidth is devoted to management and control. For end-users with current hardware (USB 2.0 ports integrated on the motherboard) and operating systems (Windows 2000 or XP) in most cases Microsoft's Plug'n Play technology has finally achieved success. One thin, hot swappable, polarized connector does it all; many device drivers are already present in the operating system. Backward compatibility exists - up to a point - since pitfalls do remain.

FireWire 400 (originally introduced by Apple) or IEEE 1394a is USB's competitor. While both technologies display many parallels - including powered connectors and hot swapping - important differences exist. Due to early licensing and royalty issues, FireWire has not achieved the market penetration on Windows hardware that it enjoys on MacIntosh machines. FireWire was originally intended for high bandwidth devices; initially, USB was intended as a bus for low bandwidth devices (evidenced by its 12.5 Mbps maximum throughput versus FireWire's original 400 Mbps). The burgeoning market for external peripherals must have caused the USB camp to rethink their strategy. Recently, FireWire 800/IEEE 1394b has appeared; it doubles the rate to 800 Mbps (more information at http://www.quepublishing.com/articles/article.asp?p=339061) but backward compatibility will be restricted since some circumstances require different cables and connectors. Future plans include quadrupling the speed to 3.2 Gbps although this has not been finalized. Further discussions in this article, unless stated otherwise, refer solely to the FireWire 400/IEEE 1394a (400 Mbps) variant. [Author's aside: Sony markets a very similar proprietary product called i.LINK for interconnecting its video hardware. While the technical specifications comply with FireWire 400, Sony has developed its own cables: an adapter may be necessary to use i.LINK with a standard FireWire connector.]

Many computer cases sport USB and FireWire ports on the front panel - a superb convenience; however, only a few higher-end motherboards implement FireWire to make these ports useful and not mere warts. Other possibilities to incorporate FireWire include video capture cards, sound cards (some SoundBlaster Audigy and Audigy 2 cards) and, of course, dedicated, PCI-bus, expansion cards (some are available with both USB 2.0 and FireWire on a single card). Until recently, FireWire's forte was video activities but it has started to appear as an alternate for some external hard drives. Most FireWire-equipped cases offer duality - both USB and FireWire uplinks. Important aside: never attempt to mount an external device using both ports simultaneously!

Recently, a third external serial protocol has appeared. Manufacturers have started to offer SATA as an option on external cases: not only the inside-the-box connector but also the external box-to-computer interface. Adapters are available to provide SATA-to-EIDE and EIDE-to-SATA translations to permit mating any combination of hardware and interface. SATA optical drives are starting to appear. Ultimately, it's reasonable to assume that the available parallel ATA connectors on motherboards will decrease and ultimately disappear as these hard and optical drive connectors lose significance.

SCSI is a well-known parallel alternate to all these serial protocols. SCSI offers internal and external connections, hot swapping (conditions apply), high data bandwidth and fast transfer rates (up to 640 MBps - yes, that's Megabytes). The downside: since it requires a controller card, is viewed as expensive and is more complicated to configure, it never made significant inroads on non-enterprise systems. Even SCSI has admitted defeat with parallel architectures since future high-speed iterations will utilize a serial interface called serial attached SCSI.

With the arrival of USB (particularly, the much faster Version 2.0 or Hi-Speed) integrated onto the motherboard, the external option became increasingly relevant. External connections serve to hookup more than traditional mass storage devices: for example, thumb drives or USB flash memory storage devices (for both data and digital camera images), digital camera interfaces, web cameras, scanners, digital tablets, sound cards, wireless and Bluetooth adapters, and printers. Even the keyboard and mouse have joined the conversion. For portable users you can find miniature keyboard lights and personal fans. For those with too much time on their hands, here is a USB toothbrush: http://www.watch.impress.co.jp/akiba/hotline/20030222/image/tooth1.jpg. 

Of course, there are always horror stories: "I lost all my data/pictures!" seems to be a common refrain. Is this completely preventable? While nothing remains foolproof (backup, backup,...) let's have a look at these high-speed serial buses, their problems and some solutions.

USB Architecture 
USB was designed as a master-slave topology and the interconnecting cables are polarized to reflect this relationship. While ATA/EIDE also used this terminology to describe the relationship of two more-or-less equal devices on the same bus, for USB the relationship is between defined unequals: the "boss" or master - usually the computer - and its peripherals (printer, mass storage, etc). USB originally did not envision direct peripheral-to-peripheral talk: unlike FireWire which allows devices this capability without an intervening computer. USB has recently introduced a peer-to-peer protocol (USB On-the-Go) to compete but, to date, few commercial products have implemented it and I won't discuss it further.

While USB is capable of providing electric power (500 milliamps or 0.5 amps) to peripherals, this often becomes a source of grief. This is the maximum available to all the devices on that port. For some devices it is clearly inadequate and manufacturers of those power-hungry peripherals supply "bricks" to convert household power. Powered hubs are also available: in part to offset the added electrical burden of the hub itself. Hubs will be examined later in more detail. While unpowered hubs are available they should generally be avoided.

The total cable length, for technical reasons (that need not be explored), should not exceed five metres/16 feet from hub to 12 Mbps full speed device: practically, the shorter the better. Connectors are polarized to prevent improper connections and to assure the correct master-slave relationship. Some hardware manufacturers supply a dedicated cable to address specific technical requirements; in that case, use it. Cables for USB 2.0, while outwardly identical to their earlier cousins, are different: they incorporate shielding to minimize interference from signal radiation. While USB Version 2.0 cables on Version 1.1 installations are acceptable, the reverse is untrue. Store these cables (and FireWire cables, for that matter) loosely coiled and avoid sharp bends to prevent kinking, straining or breaking the wires. Once kinked internally, data errors are guaranteed.

USB hubs allow you to expand a root hub (on the motherboard or expansion card) up to five levels of depth to accept many peripherals. The specification states a maximum of 127 devices using a tiered-star topology but that is remote from a more practical maximum of eight devices per hub. Although this number of devices is generous it does not magically increase the bandwidth: in other words, the more devices installed per hub, the less bandwidth per device. One heavy user can disrupt the whole port. Some devices refuse to work with an interposed hub and demand a root connection (in my experience, scanners, cameras and all-in-ones head the list).

USB offers a good selection of adapters that allow flexibility for peripheral hardware connections. As an example, some parallel port printers can be connected to USB. Never use these adapters to convert other parallel port hang-ons like scanners and Zip drives.

USB was incorporated into Windows machines as Version 1.1. Technically, there were two flavors: 1.5 Mbps (megabits per second - divide by eight for Megabytes) Low Speed and 12 Mbps Full Speed. Mice and keyboards were the main users of low speed USB; the full speed was essential for the proper operation of scanners and printers.

USB 1.1 support is flaky (particularly hot plugging) with all Windows releases before Windows 2000 Professional. Yes, the drivers are available for some earlier versions of Windows (Windows 95b onwards) but the service provided was often cranky. USB 2.0 support was available for Windows 98 onward: however, other factors - inadequate system Bios support, for example - often conspired to thwart implementation until Windows 2000 Professional and its contemporary hardware systems. Although not the sole consideration, a useful rule-of-thumb requires the computer's system speed (in MHz) be double the bit rate of a port; therefore, USB 2.0 or FireWire equipped systems require approximately a one GHz system clock speed.

FireWire Architecture 
FireWire was developed as a peer-to-peer, daisy chained architecture that allowed devices to talk directly among themselves. Bandwidth and power are shared among all the devices on the node ("1394ese" for a port or each connector on the expansion card). FireWire offers considerably more electrical power - up to 1.5 amps (three times that available from USB); again, provisions exist for self-powered devices (usually a camcorder or external hard drive/optical drive). Hubs are available although they are rarities on most systems.

Cables are polarized to prevent improper connections. Without hubs, a daisy chain arrangement can connect 16 devices per node to a theoretical maximum of 63 devices for all nodes. Maximum individual cable length is 4.5 metres although the maxim - the shorter the better - prevails.

Despite the difference in announced raw data transfer rates for USB Hi-Speed (Version 2.0) and FireWire 1394a, the combatants are likely fairly evenly matched. While USB (480 Mbps) is the raw bandwidth winner, FireWire (400 Mbps) profits from less main processor involvement (recall that FireWire devices can exchange data without requiring a computer to mediate) and faster, more efficient transfer algorithms. I have seen FireWire perform very ably on MacIntosh equipment where it seems problems are practically non-existent. My system (Windows XP with SP2) has both USB 2.0 and FireWire. My personal assessment (not a controlled test by any means) would give a slight preference to FireWire as it has, to date, generated slightly fewer irritants (mainly devices not recognized). On the other hand, these glitches have not resulted in any data losses (Right... so far!). Speed for both is quite satisfactory although FireWire might edge slightly ahead. On a strictly economic basis, USB leads since expansion cards and peripherals tend to be slightly cheaper. Since I have not personally performed any controlled environment testing, I'm inclined to call it a draw.

I expect for some readers these discussions appear on their radar somewhere between indifference and boredom. Specifications and statistics accomplish nothing. How do you get recalcitrant hardware to work?

Problems and Solutions - USB 
A useful site for USB problem-solving assistance is http://www.pcbuyerbeware.co.uk/USBProblems.htm#firewire (scroll down). Many problems have a reference to the corresponding Microsoft Knowledge Base article as well as some general technical information. Another worthwhile site discusses not only the rationale - why the problem is occurring - but also the fix or options. Visit http://www.guidenet.net/resources/usb.html. You can certainly overwhelm your curiosity with suitable queries on the Internet (for example, Google "USB problems" or "FireWire problems").

First, you should determine the present status of your ports. Navigate to Control Panel | System | Hardware tab | Device Manager and scroll down to Universal Serial Bus controllers. Click once on the "+" in the box at the left. Right-click on any device of interest and select Properties. Note the tabs for Power and Power Management. A look at the former will inform you if the USB peripheral requires more power than the hub can provide.

Installation instructions 
Most USB devices require software installation before the hardware is attached and powered. Windows prefers to know for certain what the hardware will be and not have to guess - perhaps incorrectly. While this is the most frequent approach, it is not the only one. When all else fails...first, read the manual.

Diagnostics 
Various products help to make the task easier. Have a look at http://lpt.usbfireinfo.com/ for USBInfo. This commercial product (trial available) provides every conceivable detail in a graphical tree. Hardware testers (called loopback plugs/cables) are an alternate for large-scale managers but the price is high ($50 US) for a single end user (http://www.passmark.com). 

Rules of speed
1. Low speed devices should work properly when attached to a Hi-Speed (Version 2.0) port.
2. A Hi-Speed device attached to a Version 1.1 (Full Speed) port may work (but at 12 Mbps maximum, not its full rated speed) or it may not. If working, the speed may be very slow and impractical; in other cases, it will malfunction. Moral: don't mix them.3. Running USB Hi-Speed (Version 2.0) hardware on Windows 9x or Me may be disaster-in-the-making. Recall the need for Bios support and the minimum system clock frequency. Using an add-in board and suitable drivers might improve your chances but nothing is guaranteed.

Root hubs (on the motherboard or an expansion card)
1. Depending on your motherboard you may need to implement in the Bios some or all of: USB ports, Hi-Speed, and the total number of active ports.
2. These ports, while physically separate, usually exist in electrical pairs on the backplane. Each pair - not each one - constitutes the root hub. Splitting hairs, you say. Well, if this is a Version 2.0 hub, that pair of connectors - together - has a combined 480 Mbps and not 480 Mbps for each one. Heavy hitters on each one will quickly overload the port and the fun will begin. I suspect that this might cause problems with many external mass storage devices.
3. As well as data bandwidth, each root hub has power limitations. For example, for their size, some makes/models of flash (thumb) drives demand a lot of power. I don't want to suggest that inadequate power is the sole cause of all data losses or corruption, however.
4. Some motherboards offer additional root hubs as multi-pin connectors on the motherboard. A header cable set directs these ports onto the computer backplane or to those convenient connectors on the case front. Make absolutely certain that the pinout connections are correct. Cross data and power... well, you absolutely do not want to do it. Another hidden danger: some headers include a shield connection that may or may not be on the motherboard pins. Never connect this shield as a ground pin.

Hubs
1. Avoid external hubs if possible. If you must, a powered hub (using an external "brick" power supply) is preferable to a self-powered (no external power supply). If you only have a self-powered hub (I believe that this is the norm for compact, portable computer hubs) resist using it with a power-hogging peripheral. Some devices will absolutely refuse to work if a hub is present in the data path. For powered hubs, check that the power supply is capable of providing sufficient power (that is, a minimum of 500 milliamps per port x number of ports). While uncommon, a few manufacturers forgot to do the math.
2. Some keyboards or monitors offer built-in hubs. Invariably, they are self-powered and are probably low speed/full speed: intended for a USB mouse and not a digital camera! The trend towards optical mice diminishes the convenience of the keyboard hub since many optical mice draw more power than a self-powered hub can sustain.
3. USB Version 1.1 and Version 2.0 hubs have important internal differences. Unless you are using only Version 1.1 devices make certain that you obtain a USB 2.0 hub (should state on the package). Be willing to spend a bit more to purchase a Version 2.0 hub that uses a chip called a transaction translator for each port. To avoid the inevitable, long-winded, technical discussion suffice to say that these little goodies smooth out the data transfers; unfortunately, the USB technical specification dictates minimally a total of one per hub, not the ideal one per port (costs extra: read the package).
4. USB Version 2.0 Hi-Speed hubs and USB Version 1.1 Full Speed ports do not work well together. The technical discussion will be avoided. Keep a chain from the root hub to the final peripheral "pure"; that is, all the same speed. Instead, given the bandwidth foibles of hubs, an expansion card is probably money better spent.

Isochronous hardware 
These devices ignore system pleas to divide bandwidth equitably; instead, they demand a constant, dedicated block that does not fluctuate. Webcams or video cameras are the traditional examples; the recent arrival of sound cards and digital sound as USB come-latelies makes the future interesting. Each one of these devices will most likely require its own root hub. That means the other port of the root hub pair must remain idle.

Thumb drives 
Despite their diminutive size some are real power hogs: a situation unlikely to improve as capacity increases. Power consumption can be determined from Device Manager. Lack of adequate power might be one explanation (but not the sole one) for data corruption or loss. Thumb drives usually trigger the "Safely Remove Hardware" icon in the System Tray (beside the clock). Looking around the Internet I have found many posts stating that failure to use this icon did result in data loss or corruption. Conversely, other posts claim that clicking on the icon to obtain consent can be ignored. I believe that it depends on personal practices. As a minimum, I would recommend that the device never be removed if its indicator lamp indicates activity. A further possible explanation: drive caching is usually implemented at the system level by default.
Faithfully using this icon would prevent removal of the thumb drive before the cache was emptied and written to flash memory. To turn off drive caching (trust the indicator light exclusively) you should "Optimize for Quick Removal", as follows:
* Connect the USB flash drive to the computer's USB port
* Go to My Computer and Right-click on the drive
* Select Properties, then Hardware
* Select the USB drive in the list and click on Properties button below
* Click on the Policies tab and select "Optimize for Quick Removal"
* Click OK, and from now on all data will be written to the flash drive immediately (and not cached). Now all you need to remember is to wait until the LED on the drive goes out each time before removing it! Personally, I stick with the tried and true but now you have a choice.

Disconnecting USB devices results in a system reboot I saw this one posted on the Internet and swallowed hard - say what? The first and simplest cure posted by Microsoft was to always use the safe removal icon. If the problem persists Microsoft suggests http://support.microsoft.com/kb/883517/ and http://support.microsoft.com/kb/884868/. 

Problems with device recognition
1. Intermittent recognition of USB-attached devices can often be traced to the devices requiring too much start-up current at system boot. Try distributing the heavy hitters across different root hubs. Replace a self-powered hub with a powered one (has a transformer brick) or add an expansion card.
2. Windows power management may shut down unused root hubs to conserve power. Sometimes, Windows does not wake up the ports correctly. To disable this "feature", go to Control Panel | System | Hardware tab | Device Manager. Scroll down to the Universal Serial Bus controllers and click the "+" sign immediately to the left. Scroll down to a USB Root Hub entry (may be several) and double-click on it. Go to the Power Management tab and uncheck the box beside "Allow the computer to turn off this device to save power." Repeat as required. For portable users this will increase battery power consumption.
3. Plugging and unplugging the same device can confuse Windows and the device may not be recognized immediately. Have patience: Windows, in a worst-case scenario, could require several minutes to straighten itself out.

Chipset conflicts 
Conflicts exist in some cases between the embedded USB chipset (integrated onto the motherboard) and the operating system. This occurred frequently with earlier chipsets but is uncommon now. Still, if you have one of these motherboards then upgraded drivers are the most likely cure. You should also visit http://www.guidenet.net/resources/usb.html. 

Several motherboard chipsets (particularly non-Intel) and the USB chipset (for example, one is VIA VT6212L) on the USB expansion cards do not peacefully co-exist. In some cases updated chipset drivers will resolve this; however, this depends upon the motherboard-chipset combination. Unfortunately, many of these cases are mired in the all-too-frequent scenario: "The other party is at fault and bears the responsibility for crafting a solution." Consequently, no solution is apparent for the harried end user. There are many expansion chipset manufacturers (for example, VIA, NEC, Adaptec); you should be able to find a compatible card. Obtain compatibility assurances - or money back - before you purchase.

Problems and Solutions - FireWire 
Despite its more recent appearance on the Windows scene, FireWire has managed to create its own impressive list of problems. Personally, I have experienced only one (see below) on my Windows XP SP2 system. I suspect that older Windows versions and systems/motherboards/ chipsets may experience more problems due to inadequate drivers. Visit http://www.pcbuyerbeware.co.uk/USBProblems.htm#firewire to find ready access to solutions from Microsoft's Knowledge Base.

Chipset conflicts (experienced this one myself) 
Several ASUS boards (other makes /models I don't know) and the VIA chipset (VIA VT6306) used on many FireWire expansion cards do not peacefully co-exist. There are many expansion chipset manufacturers (for example, VIA, Texas Instruments, Adaptec); you should be able to find a compatible card. Specifically, for my Asus board, I found that the Texas Instruments chipset worked perfectly.

Conclusions
1. The more recent your hardware/operating system is the less likely you will experience problems.
2. Try to avoid using hubs for USB. An expansion card will likely be close in cost and will probably result in fewer hassles.
3. Distribute the "heavy hitters" - either power or bandwidth - across all the ports.
4. While disabling write caching is an option, I recommend that you always click the icon and await the safety message.

Additional websites:

http://www.quepublishing.com/articles/article.asp?p=339086  
(Retrofitting USB 2.0 to your system)

http://www.quepublishing.com/articles/article.asp?p=339069  
(Configuring your system to use USB and IEEE 1394 peripherals)

http://www.tech-pro.net/intro_usb.html  
(How USB works)