Free Print Subscription Printer-friendly version Email to a Friend

Embedded USB gains ground

( 01 Oct 2003 )
By Warren Webb, Technical Editor

Although USB technology is firmly entrenched in the desktop-computing world, it has been slow to catch hold in embedded devices because of its host-centric topology, software complexity, and relatively high power requirements. Many designers have chosen to retain the older serial or discrete I/O rather than deal with the complications of USB. However, industry working groups have recently developed updates to the USB specification to allow alternative connection strategies, lowered host-power requirements, and an optional 480Mbps data rate. These new updates, along with the availability of hundreds of low-cost, off-the-shelf peripheral devices have kindled a growing interest in USB for embedded devices.

In addition to the plethora of available peripherals, USB offers several other benefits to embedded-device designers. For example, USB devices are tested and certified before production to ensure that interface characteristics meet the specification and are consistent among manufacturers. USB supports plug-and-play operation, in which the host software automatically detects attached peripherals and loads the appropriate driver. You can also remotely power down USB devices and awaken them as needed to conserve system power. Likewise, to conserve real estate on small systems, one embedded connector can communicate with as many as 127 peripheral devices by using external USB hubs. USB may also simplify embedded design efforts, because off-the-shelf firm-ware or silicon includes the low-level parallel-to-serial conversion, error checking, and data-flow-control algorithms.

An industry consortium developed the original USB specification in 1996 and provides periodic improvements to keep up with current technology. You can download the current 650-pg Version 2.0 specification and supple-ments at the USB Implementers Forum Web site, www.usb.org. As the name indicates, USB is a serial bus with a single host controlling all transactions over a tiered star-type topology similar to Ethernet's. USB data travels at three rates, depending on the capabilities of the host and peripheral. The low-speed rate of 1.5Mbps is adequate for most cost-sensitive user-input devices, such as keyboards and mice. The full-speed, 12Mbps rate satisfies most other peripheral-data-transfer requirements, and the recently introduced 480Mbps, high-speed rate directly competes with IEEE 1394a for some high-bandwidth applications.

The USB developers tried to simplify cabling confusion by specifying different connectors on each cable end. This strategy eliminates the data-crossover problem and ensures that if the cable is connected, it is installed correctly. USB interconnecting cables contain four shielded wires consisting of power, ground, and two twisted differential data signals. The power signal is nominally 5V and must be supplied by the host or optionally by an intervening hub. USB transceivers transmit data using a bit-stuffed version of NRZI (non-return to zero, inverse) encoding. Bit-stuffing inserts extra zero bits into the data stream to guarantee that the transmitted signal stream periodically changes state to resynchronize the receiver's clock.

Three host types
Luckily, a dedicated USB controller handles all of the low-level bit manipulation, error checking, data framing, and handshaking flow control. In fact, there are three host-controller types, each with its own specification and software drivers. The host controller communicates with one or more endpoints within each connected device. Intel developed the UHCI (Universal Host Controller Interface) specification and partitions the hardware and software tasks to simplify the required silicon. Taking a different tack, a team led by Compaq (now HP), Microsoft, and National Semiconductor shifted more of the processing burden to hardware with the OHCI (Open Host Controller Interface) specification. With the introduction of the high-speed data rate of USB Version 2.0, all of the participants agreed to the EHCI (Enhanced Host Controller Interface) specification.

The USB specification defines several protocols for specific data-transfer requirements between the host controller and attached peripherals. Control transfers are the most basic, and you use them to set up and configure the remote device. Each device must have at least one control endpoint, and the host uses control transfers for enumeration, command, and status operations. Bulk transfers include error detection and retransmission but are asynchronous and do not guarantee delivery times. Interrupt transfers are similar to bulk transfers except that the remote device specifies the polling interval. The final transfer type, isochronous, delivers data at a specific rate without error checking; you use it mainly for streaming audio and video.

Recognizing the limitations of the host-based topology for portable devices such as cell phones, PDAs, digital cameras, and other embedded devices, the USB specification-development community released the OTG (On-The-Go) supplement in late 2001. OTG allows a peripheral to temporarily act as a host and exchange data with another peripheral. OTC removes the often-cited limitation that USB requires a desktop computer or equivalent to act as a host. For example, a digital camera conforming to the OTC's dual-role peripheral specification could behave as a host to transfer photos directly to a printer. That same camera would also respond as a standard USB peripheral when connected to a PC. Although there are similarities, OTG USB is not a peer-to-peer network. Only one
of the connected peripherals can act as a host at any time; however, there are provisions for exchanging roles.
The OTG supplement adds some confusion to the cabling strategy for USB. The original specification defined a Type A connector to plug into the host computer and a Type B connector for the peripheral. Embedded-system developers complained that the Type B connector was too large for small portable devices, and so the Version 2.0 update introduced a mini-B-type connector. The OTG supplement defines a mini-A-type connector, because peripherals can act as the host. In addition, the supplement defines a mini-AB receptacle for dual-role peripherals that can accept either a mini-A or a mini-B plug. With these connector options, there are at least three cable configurations to keep track of: Type A to Type B, Type A to mini-B, and mini-A to mini-B. The OTG supplement also creates a host negotiation protocol that allows two dual-role devices to swap host roles during communi-cations without reversing the cable.

Cut the power
OTG also addresses the high bus-power requirements of the Version 2.0 specification, which state that a PC-based USB host must supply 5V at as much as 500mA to connected peripherals. This much current is obviously unacceptable for battery-powered devices, so the OTG supplement reduces the required bus current to 8mA for dual-role devices. Higher power peripherals must indicate their requirements during initial configuration and do not operate with dual-role hosts if they need more than the 8mA of bus power. When you connect two OTG dual-role peripherals with a USB cable, the device on the end with the mini-A connector must supply bus power.

The software to enable the plug-and-play capability for USB is complicated and requires peripheral drivers that mesh exactly with host software. USB divides hardware with similar functions into classes to standardize interface protocols across multiple manufacturers. If your peripheral device conforms to an existing class specification, it may work automatically with USB without a custom driver. The USB Implementer's Forum has approved class specifications for human-interface, printer, imaging, mass-storage, audio, and several other device categories. The forum also has a formal mechanism for developers to submit their device interfaces and eventually define new class specifications. Operating-system and host-software developers use the approved class specifications to implement their standard plug-and-play USB drivers. Unlike desktop computers, OTG dual-role embedded devices have limited resources to store many peripheral drivers. They handle this problem by defining a list of acceptable peripherals or dual-role devices and then rejecting other connection attempts.

You can take several tacks when integrating USB into an embedded design. If your product must host plug-and-play peripherals, you can purchase system computers or expansion modules with USB capability incorporated. For example, the PC104P-USB2V0 from Lippert Automation is a USB-expansion module for PC/104 systems (Figure 1). Powered by a Via VT6202 controller, the board features four USB 2.0 ports supporting the three transmission rates of 1.5, 12, and 480Mbps. The board requires only the 5V power supply that the PC/104-Plus bus connector provides. All ports have electronic-overload protection, and connected USB devices can sink as much as 500mA each. The PC104-USB20 operates under both Windows and Linux operating systems.


If you plan to design your own board, you can take advantage of the wide selection of low-cost silicon devices available for USB controllers. For example, Cypress Semiconductor produces the SL811HS, a single-chip, dual-speed USB embedded-host controller that can operate as either a host or a peripheral device. The SL8-11HS USB host/slave controller supports and operates in USB full-speed mode at 12Mbps or at low-speed, 1.5Mbps mode.

The SL811HS data port and microprocessor interface provide an 8bit datapath I/O or DMA bidirectional, with interrupt support to allow an easy interface to a variety of microcontrollers. Cypress also provides a Linux USB host driver for the SL811HS controller. This driver lets Linux developers add USB-host functions to a variety of embedded-system applications, such as cell phones, MP3 players, network appliances, and PDAs. On the peripheral side, NEC Electronics offers the µPD720122 general-purpose USB 2.0 interface and endpoint-controller (Figure 2). This device integrates a USB PHY, a serial-interface engine with endpoint-controller buffers, and a bus-interface unit. The controller supports and auto-matically switches both high- and full-speed transfers on the USB interface. The µPD720122 comes in a 100-pin plastic TQFP.


$142 starter kit
To support embedded-device development, Motorola has introduced a USB reference-design and starter kit (Figure 3). The USB08 evaluation board provides a starting point for USB development and includes both firmware for the microcontroller in the peripheral device and the application software for the PC side. The USB08 is powered by the HC908JB8 8bit microcontroller with an integrated USB-peripheral module that supports low-speed communication according to USB specification 1.1. The board includes 8kbytes of on-chip flash memory, three LEDs, three pushbuttons, three analog sensors, and a wire-wrap area for additional user components. Board power comes from the USB bus or an onboard fixed-voltage regulator, and device programming is self-contained. You get a set of manuals, cables, software CD-ROM, and C-source code for the USB firmware and demonstration application. The USB08 is available online for $142.

Another approach to embedding USB is to select a microcontroller that includes a controller as part of its on-chip peripheral set. For example, Cygnal Integrated Products offers the C8051F321, a mixed-signal flash microcontroller with an integrated full-speed USB 2.0 function controller. The C8051F321 includes an integrated USB physical layer and requires no external components, not even resistors or a crystal, and is available in a 535mm, 28pin micro lead-frame package. The microcontroller has a 24MIPS 8051 CPU, 16kbytes of flash memory, 2304bytes of RAM, and 21 I/O pins. On-chip peripherals include a 1.5% internal oscillator with clock recovery for USB, a 10bit, 200k-sample/sec ADC, and a temperature sensor. Prices start at $4.64 (10,000). For system integration, the C8051F321 has on-chip-debug circuitry facilitating full-speed in-system features, such as single-stepping, breakpoints, and register or memory modifications. The C8051F320DK development kit (Figure 4) sells for $229 with features typical of in-circuit emulators costing much more.

High-volume-device designers prefer to include all functional modules, such as USB into a single SOC (system-on-chip) design. Although a complete design is possible, most engineers prefer to purchase semiconductor IP (intellectual property) for standardized functions, such as USB. For example, Faraday Technology recently introduced a USB 2.0 transceiver and device controller as new additions to its USB 1.1 IP product line (Figure 5). The new FZUS-B200-HA0A trans-ceiver supports USB protocols at high-, full-, and low-speed data rates. The operating current is less than 75mA, and the suspend-mode current is less than 200µA. The IP is silicon-proven in both 0.25- and 0.18µm process technologies. The FUSB200 USB 2.0 device controller is a certified, synthesizable core that supports bulk, interrupt, and control data-transfer types. The device controller is process-technology-independent. To ensure an easy start, Faraday offers test chips and a complete develop-ment environment, including evaluat-ion boards, data sheets, application notes, and other technical documentation.


Another major supplier of IP, ARC International, provides a range of USB products. ARC's USB Now combines a configurable 32bit RISC/DSP microprocessor with a high-speed USB 2.0 OTG controller plus an embedded RTOS with USB stack and software-development tools. The OTG controller can switch from 480Mbps, high-speed USB host to device operation in real time. It is also backward-compatible with full-speed and low-speed devices. The USB Now architecture allows system memory to store endpoints and reduces chip area by hundreds of thousands of gates. Development tools include the MetaDeveloper Software IDE, an embedded RTOS, a C/C++ compiler, and a stack-aware debugger.

With the abundance of low-cost hardware and software as well as new techniques for exchanging data between portable devices, USB will find its way into a growing number of new embedded designs. One of the bigger drawbacks for limited-resource host devices, storing drivers for all potential peripherals, should be the subject of future USB updates.

Author Information
You can reach Technical Editor Warren Webb at 1-858-513-3713, fax 1-858-486-3646,
e-mail wwebb@edn.com.

At A Glance

  • With data-transfer rates as high as 480Mbps, USB 2.0 offers embedded-system designers a full spectrum of connectivity through a single connector.

  • The USB On-The-Go supplement reduces bus-power requirements and lets peripheral devices exchange data without connecting to a desktop PC.

  • Device designers can integrate USB with off-the-shelf modules, ICs, microprocessors with integral controllers, or IP


  • For more information...
    For more information on products such as those discussed in this article, visit the Web sites of these companies. When you contact any of the following manufacturers directly, please let them know you read about their products in EDN Asia.

 
Free Print Subscription Printer-friendly version Email to a Friend
 
Article Rating 
Average Rate: No rating yet
 
Poor Quite Good Good Very Good Excellent
 
Related Content 
 
 
KNOWLEDGE CENTER
Panasonic Key Devices Guide 2008 :
 
Fairchild Semiconductor :
 
Texas Instruments: DaVinci™ Technology
 
Texas Instruments: Safe Bet Series
 
 
 
Highest Rated  
Feedback Loop  

ADS BY GOOGLE 
 
 
 
ADVERTISEMENT
Press Release 
 
TECHNOLOGY NEWS
 
RESOURCE CENTER

 
 
PRODUCT NEWS
 
FEATURED SPONSORS
 
 
DESIGN CENTERS
 
ADVERTISEMENT
     
Reference Designs 
   
     
 
 
 



RSS
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

POLL
What type of environmental regulation do you think will be most beneficial for the tech industry?
Proper recycling and disposal
Push for power efficiency and energy conservation
Chemical/lead regulation
View results