The Universal Serial Bus (USB) is a proven connectivity system. However, there are still design challenges in producing a USB hardware interface. Prime among these are face layout, power, and interference issues.
A USB comprises a host (traditionally the PC) and one or more devices, often called the slave or slaves. The physical USB interface is made up of four shielded wires. Pin 1, which is the VBUS, is used to power any connected peripheral by supplying a +5-V voltage from the USB host. Pin 2 is the negative data terminal denoted as D– (DM), while Pin 3 is the positive data terminal denoted as D+ (DP). These pins make up the differential pair that carries out data transfers. Finally, Pin 4 is the ground connection (GND).
To ensure signal integrity, both the DP and the DM signals should travel the same distance. If one trace is longer than the other, the timing of the signals could be affected with data errors resulting. It is therefore important to ensure that data trace lengths are matched. The recommended maximum allowed deviation between the DP and DM trace lengths is just 150 mil.
Impedance control of the DP and the DM is another major concern. The tracking for these two should be matched on the printed-circuit board (PCB) to minimize signal reflections. The DP and DM USB signals have a 90-Ω differential (45 Ω each to signal ground) impedance.
Most modern PCB layout software can be configured to route both signals together with these characteristics. The DP and DM signals should be made as short as possible. For very short runs, less than 1 cm, it may not be possible to observe the controlled impedance guidelines described here. But in practice, this is usually acceptable provided the other guidelines are followed.
Care should also be taken not to add any stubs when putting voltage protection diodes and capacitors into the design. This will minimize data signal reflections. Also, the DP and DM signals should consistently be routed over a USB signal ground plane. Ideally, there should not be any splits in the plane directly under either DP or DM.
Even though it’s called a bus, USB is a point-to-point interconnect. The connection of multiple devices to a USB host will require the use of a USB hub device. Up to 127 slave devices can be connected to a single host via one or more hubs.
Basic circuit layout principles should always be followed, such as routing USB lines away from noisy power signals and clock circuitry components. Designers should also avoid the use of right-angled turns on USB signal traces. Using two 45° turns will prove far more beneficial than a single 90° turn.
Selecting an appropriate power configuration is another important consideration for USB interface design. Designers should think about how their USB circuitry will be powered and, more importantly, how much current this circuitry will draw. USB peripherals can be USB bus-powered or can draw power from an external source in a self-power configuration.
Continue on next page
The USB 2.0 specification for bus-powered systems allows a device to draw up to 500 mA from the 5-V VBUS supply. USB bus power is often used to charge batteries or power low-power devices. With USB power, designers need to ensure that the device does not draw any more than 100 mA prior to enumeration.
The 5-V VBUS supply is not always practical for directly powering ICs and other devices, as not all ICs support 5-V tolerant inputs. A voltage regulator can be used to generate the required voltage levels. That’s why the FT232R USB UART interface IC from FTDI features an integrated 3.3-V regulator (Fig. 1).
This interface can be used to take power directly from the VBUS supply, reducing component costs and simplifying system design. The IC features a UART interface (Fig. 2) that can be used to provide a USB connection to a UART port on a microcontroller or other processing device.
It is important to note that the circuit design shown here recommends providing for a capacitor or resistor to remove noise from the shield. This is based on experience when submitting products for electromagnetic compatibility (EMC) and radio-frequency interference (RFI) testing, despite being contrary to circuit theory.
USB bus-powered peripherals also must support power-management features, such as the USB suspend state to save power on the USB host. For a quick restart from the suspend state, many slave devices have remote wakeup capabilities, allowing them to resume operation as soon as activity is detected.
For higher power applications, an external or self-powered configuration can be used. Self-powered configurations have fewer restrictions, but devices must protect against current draw down through the USB bus to the host when the host or the hub is unpowered since this can damage the upstream circuitry. To prevent this potential hazard, connect the VBUS signal (Fig. 3) to a reset pin, forcing the IC to wait in a reset state until the USB host is ready.
Particular effort should be put into addressing electromagnetic interference (EMI) and electrostatic discharge (ESD) noise suppression. Engineers designing a USB interface need to consider implementing power-filtering and protection schemes for these purposes.
For USB bus-powered configurations, a ferrite bead should be deployed on the VBUS supply to prevent EMI noise from being radiated down the USB cable to the host. Configurations typically consist of a capacitor and ferrite bead placed as close to the USB connector as possible. Ferrite beads should not be used on either of the USB data signals or the ground signal.
Other current-protection techniques include adding circuitry to protect against excessive inrush current and overcurrent. Inrush current is an issue in USB bus-powered configurations where excessive current can be drawn from the host during initial plug-in or enumeration or when restarting from a suspended state.
Continue on next page
The USB 2.0 specification recommends a maximum of 10-μF capacitance in parallel with an equivalent 44-Ω load to cope with common inrush current scenarios. A larger bulk capacitance alternatively may be used, provided that power is applied with a soft-start method. For applications that are hindered by EMI problems, common-mode chokes can also be employed, although their use should be minimized due to degradation on the USB data signal lines. Optocoupling methods can also be used to isolate USB peripheral circuitry from the USB interface.
ESD protection techniques for USB designs include the use of transient voltage suppression diodes on the data lines, on the VBUS supply pin, and on any other external interface components. These diodes should be placed as the first board-level device next to any external connection point. This will ensure the shortest current path to ground and minimize the possibility of damage elsewhere on the PCB.
Another noise suppression technique is the addition of PCB pads for the connection of a resistor or capacitor between the USB connector shield and the connector ground. The quality of the shielding on different types of USB cables can vary quite significantly. As a result, adding a passive device may help limit noise from being transferred to the system ground plane. This technique is also important if manufacturers are seeking to secure CE and Federal Communications Commission (FCC) compliance for their USB product.
Some manufacturers may choose to obtain full USB Implementers Forum (USB-IF) certification, allowing them to use USB compliance logos on their product. The certification process involves testing by the USB-IF to ensure that the interface conforms fully to the electrical and interoperability requirements outlined within USB specifications. During electrical compliance testing, USB signal rise and fall times may require adjustment through the use of capacitors and/or resistors on the DM and DP data lines to account for configuration-specific variations.
As part of the enumeration process, a USB host will request configuration and identification details (known as USB descriptors) from the peripheral slave device. The descriptors contain information such as vendor ID, product ID, USB revision, number of USB interfaces, and supported transfer types. The data can either be stored internally within a USB IC, as is the case in the FTDI FT232R, or on an external EEPROM.
Although these recommendations relate to directly designing a USB slave interface, many of these practices are also relevant to designing an embedded USB host interface. When designing a host interface, designers need to apply careful consideration to the power circuitry to ensure that sufficient current can be supplied, and overcurrent conditions detected, for the type of USB slave devices connected to the host.