The average person on the street, computer literate since childhood, is familiar with the look and feel of a USB cable and is generally aware of the difference between types A and B plugs that go into host and peripheral ports respectively. It is also common knowledge that specialized cables with mini and micro plugs are needed for small equipment such as the now ubiquitous cell phone or digital camera.
That’s just about all that the casual user needs to know about USB. But actually there is quite a lot of technology that underlies this now fully duplex information channel. USB cords have similar appearances, but a closer look reveals differences. In addition to diverse and non-compatible connectors, there are five types of data transfer: low speed (in version 1.00), full speed (also 1.0), high speed (2.0), super speed (3.0) and super speed + (3.1). Each of these modes requires different cabling and hardware.
Like coaxial and Ethernet cable, USB protocols allow for providing electrical power along with data. The different ends, A and B, plug into corresponding receptacles in computers or other devices. The A end is standard, while the B end may be standard, mini or micro.
USB originated in 1994 as a joint effort of Compaq, DEC, IBM, Intel, Microsoft and Nortel. An early implementation was in Apple Inc.’s IMac, and its astounding success resulted in the widespread adoption of USB in many other products. In short order, Apple and the major PC makers eliminated older-style data/power ports, and soon USB became universal.
The USB 3.0 specification was promulgated in 2008. It resulted in the 2010 release of a generation of devices incorporating the new technology with increased data transfer speed, reduced power consumption, higher power output and backward compatibility. USB 3.1 (sometimes referred to as USB 3.1 Gen 2.) emerged in 2013. It doubles the speed of USB 3.0 to 10 Gbps (now called SuperSpeed+ or SuperSpeed USB 10 Gbps). USB 3.1 is backward-compatible with USB 3.0 and USB 2.0.
A USB distribution system is configured in a star as opposed to a daisy chain topology, and it is asymmetrical. This means the two ends of the cable are not the same, either in regard to termination type or data and power flow. There are a host of downstream ports permitting connection of peripheral devices, which can be simultaneously active. Unlike telephone wire, USB cable cannot be spliced. Branching lines must be tiered through USB hubs in the manner of Ethernet. A maximum of 127 devices including hubs may connect to a single host, which in the case of a computer may contain a root hub and a couple ports. An oscilloscope, in contrast, is typically equipped with a single port, which may be used to network the instrument or to accept a keyboard or a single flash drive for the purpose of saving waveforms and/or setups.
USB devices frequently include what is known as sub-devices, which operate in concert. For example a webcam, a composite device, contains a microphone, which is separate from the video section. There is also a compound device, which consists of two or more independent entities that are built into the same physical form factor.
The basic unit in USB connectivity is the pipe, a logic channel. A pipe goes from the host controller to an endpoint, which is a single logical input located within the device. Each and every pipe has a single endpoint. There can conceivably be as many as 32 endpoints on a device, with an equal number of pipes.
There can be stream pipes and message pipes. A principal difference between them is that a message pipe is two-way or bidirectional, and it has a control function. A stream pipe is one-way or unidirectional.
To initiate a data transfer session, which is half the purpose of USB (the other half being a source of power), the host transmits a token packet that specifies a pipe with endpoint. The host can send an Out packet that contains the destination device address and endpoint number. If the information flow is from the device to the host, on the other hand, an In packet is sent. If the token packet is not appropriate because it is moving the wrong way, it is ignored.
The USB enumeration process begins when the device is initially connected to the host. Then a reset signal is sent to the device. This determines the overall data rate. Subsequently, the device receives its address and it is sent to a state that is configured. Enumeration for all devices that are connected now takes place. Unlike some other bus types, the host alone directs the information flow. Without this complicity, data cannot be sent by a device.
Because power as well as data is conveyed by USB cabling, it is important that the two ends be equipped with different, non-compatible connectors. This is necessary so two power sources, as in opposite-polarized hosts, cannot connect to one another, which would make a direct short circuit with heavy fault current.
USB connectors were designed so the external sheath at the plug makes electrical contact before the four conductors within the cable make contact. The sheath is connected to the system ground. This mitigates electromagnetic interference from outside in the vicinity of the connector where a tight conductor twist rate in conjunction with differential signaling cannot be maintained. The power and ground connections are made before data connections, due to length of the pins, so hot swapping can be safely accomplished.
Oscilloscope tests of USB transmitter and receiver specs can get quite involved. There are standard waveforms used for characterizing the behavior of USB circuits. Suppliers of high-end scopes, such as Keysight and Tektronix, that find use in bit error rate tests (BERT) of USB typically make available special software packs specifically designed to automate the numerous USB tests.
For example, a Tektronix package used to automate BER contour tests for USB 3.1 Gen 2 at 10 Gbps runs transmitter and receiver tests. It runs automatic DUT control and pattern validation to capture required data patterns (CP0, CP1, CP9, CP10, etc.) as well as automated normative and informative transmitter tests. It also reports details of test margins, pass/fail results, and plots in PDF, MHT and CSV formats.
Software for USB receiver testing can run error analysis tools such as pattern sequencing and error location analysis to help find the causes of bit errors. It will also perform BERT-based jitter tolerance testing and emulate different combinations of channel lengths and cables.
Lower-end scopes can run USB tests as well but may not have the same level of automation available. Additionally, it should be noted that tests of the USB 3.1 spec demand a scope bandwidth of at least 16 GHz in order to accurately gauge the 10 Gb/sec data rates involved.
For manual tests of USB devices, perhaps the most basic advice might be to watch out for the accidental grounding of the data lines with a scope connection. To probe USB data pairs, you need to connect your scope between GND and USB D- and/or D+. A mistake novice users sometimes make is to assume the USB D- line is ground. It is not.
USB uses a differential transmission pair for data. A differential 1 is transmitted by pulling the D+ line over 2.8 V with a 15 kΩ resistor pulled to ground and the D- line to under 0.3 V with a 1.5 kΩ resistor pulled to 3.6 V. A differential 0 transmits as a D- greater than 2.8 V and a D+ less than 0.3 V using the same pull down/up resistors.
Note the scope-probe ground must be the USB ground. With scope connected to ground a single-channel scope can monitor either D+ or D-. A dual channel scope can monitor both, and the phase inversion should be visible when data transmits. One channel gets connected to D+ and the other one to D-. The ground clips of the two probes connect to each other. Then you display the signals such that they subtract (X-Y) because USB is a differential signal.