Electronic Design

USB On-The-Go Specification Adds Muscle To Portable Devices

Functioning as either a host or peripheral, dual-role portable devices can now directly communicate with each other.

Over the last few years, the number and variety of portable electronic devices have exploded. Cell phones, digital cameras, PDAs, and MP3 players are increasing in capability and in the amount of data they can store and process. These new, improved devices give users convenience and capabilities they could only dream about a few years ago. But protocol, system, and device designers must address new issues and problems that accompany these powerful, new devices. Their unique characteristics require different considerations than more conventional, wall-powered systems.

Naturally, as portable devices gain power and store more data, it becomes increasingly desirable for them to share information among one another and with nonportable devices. But handheld devices present problems in data entry and display that don't exist with other powerful electronic devices, like PCs. Portable devices are small, so they typically don't have a very useful general-purpose human interface. Usually, they have small display screens and a limited number of buttons.

This creates a serious problem in offering data entry and retrieval capability to match the device's power and storage capacity. For instance, it would be easy to build a cell phone that could store 10,000 phone numbers—but practically impossible to enter that many names and numbers by hand via the phone's tiny keypad.

Contributing to the problem is the possible size of data to be transferred. A digital camera can easily store hundreds of megabytes of data, which would take a long time to transfer over a slow connection. Various types of data transfers also might be necessary. Users may want to connect their cell phones to PCs to download stored messages; to other phones to share phone numbers; to cameras to upload photographs; or to PDAs to access a wireless network.

However, portable devices like cell phones are too small to have dedicated connectors for each of these diverse tasks. Further, the cost of so many connectors would be prohibitive in a cost-sensitive portable device. Also, many users of portable devices aren't technically inclined, so any means of transferring data has to be simple and intuitive. Required is an inexpensive, ubiquitous, user-friendly, high-speed means of connecting a diverse array of devices and transferring data among them.

USB To The Rescue? One candidate for such a connection is the Universal Serial Bus (USB). It's already an established mode of connecting PCs to peripherals, ranging from simple items like mice and keyboards to more complicated devices like printers and MP3 players. Nearly every PC sold over the last three years has USB capability, creating an installed base of over 1 billion PCs and peripherals. USB also is inexpensive, reliable, and easy to use. It delivers high performance, with data transfer speeds ranging from 1.5 to 480 Mbits/s.

But standard USB requires a host—typically a PC. Data can only be moved between two peripherals by passing through the host. So why not simply put host capability into a port-able device? Unfortunately, there are some problems associated with this solution.

USB is a master-slave protocol, designed for use with one host and many potential peripherals. As such, the intelligence is largely centered on the host side of the connection. The amount of intelligence required to implement the full USB specification on a host could burden simple, dedicated-purpose portable devices. Also, USB uses directed cables, with one type of connector for plugging into a host and another type for the peripheral end.

A portable device, though, may sometimes need to act as a host (a digital camera sending pictures to a printer), but as a peripheral at other times (a digital camera uploading pictures to a desktop PC). Even the relatively small USB connector can be too large for the tiny portable devices of today and tomorrow. Using separate connectors for host and peripheral operation is out of the question.

Finally, USB assumes that the host has plenty of power to supply to connected devices, which may take their power entirely from the bus. This could place an unmanageable strain on small portable devices with very limited stores of power. Because USB has so many advantages, there must be a way to get around its shortcomings and make it practical for use in portable devices.

USB OTG: The solution to the problem has arrived in a new supplement to the USB specification called "USB On-The-Go." Released on Dec. 18, 2001, the On-The-Go (OTG) supplement addresses the needs of portable devices. OTG defines smaller connectors that can be used in both host and peripheral roles; protocols for devices to negotiate the host or peripheral role; lower power requirements; enhanced power conservation modes; and restrictions designed to reduce the burden of software overhead.

Even with the new features, OTG maintains full compatibility with the existing USB specification. One major mechanical enhancement is the addition of new types of connectors. Mini-A and Mini-B plugs and receptacles have been added to the original USB A and B connectors, along with a "Mini-AB" receptacle. These plugs and receptacles are considerably smaller than their original full-size counterparts (Fig. 1).

The Mini-AB receptacle is used on dual-role devices. An ID pin, not present in standard USB plugs, is shorted to ground in the Mini-A plug and unconnected in the Mini-B plug. With this ID pin, a dual-role device identifies which type of plug is connected, determining the device's default role.

New Protocol: The most significant changes introduced by the OTG supplement are extensions to the USB protocol to supply more aggressive power management and to let devices function as either hosts or peripherals. These dual-role devices have to comply with all requirements of the USB 2.0 specification. They also must provide limited host capability, support Session Request Protocol (SRP) and Host Negotiation Protocol (HNP), and have exactly one Mini-AB receptacle.

In addition, the device must communicate messages to the user. A dual-role device may supply as little as 8 mA on VBUS when operating as a host, rather than the 100 or 500 mA required of a standard host.

Session Request Protocol: In a "classic" USB system, the host provides power at a nominal 5 V, and at least 100 mA on the USB VBUS line, at all times while in operation. This is fine when the host is attached to a line power source, but it could be a crippling drain on a tiny device like a cell phone. To conserve power and extend battery life, USB 2.0 provides a way for an OTG host (the "A-device") to turn off VBUS when there's no activity on the bus. The SRP lets the peripheral device (the "B-device") request that the A-device re-enable VBUS and start a session.

The B-device can initiate the SRP any time at least 2 ms have elapsed since the previous session's end. To do so, the B-device performs both "data-line pulsing" and "VBUS pulsing." It accomplishes the former by enabling its data-line pull-up resistor (on D+ for full-speed devices, D− for low-speed devices) for 5 to 10 ms. The latter is performed by driving VBUS weakly (enough to pull a lightly loaded OTG line to at least 2.1 V, but not enough to pull a more heavily loaded "classic" line to 2.0 V).

The A-device detects either the data-line pulsing or VBUS pulsing and initiates a session by enabling VBUS. The session lasts until the A-device decides that no more traffic needs to occur on the bus, at which time it terminates the session by turning off VBUS. Figure 2 illustrates the SRP operation.

Host Negotiation Protocol: When a dual-role device is connected to a Mini-A plug, it defaults to the host role. When connected to a Mini-B plug, it defaults to a peripheral role. Yet the user doesn't need to disconnect the cable and reconnect it to change a dual-role device from host to peripheral mode. A dual-role device connected as a default peripheral can request that it become the host using HNP.

To perform the HNP, the A-device must first enable the B-device's ability to take control of the bus by using a Set_Feature request newly defined by the OTG supplement. Once enabled in this way, the B-device can take control of the bus whenever allowed to do so by the A-device. If the A-device wants to give the B-device a chance to take on the host role, it suspends the bus by stopping all traffic. Then the B-device can drop the D+ line low to signal a disconnect. Next, the A-device enables its data-line pull-up resistor, completing the switch. The B-device may now operate as host, and the A-device will respond as a peripheral.

The B-device can return control of the bus to the A-device by suspending the bus and enabling its D+ pull-up resistor. The A-device will detect this, deactivate its D+ pull-up resistor, and resume operation as a host. Figure 3 shows HNP operation.

Driver Support: The final piece of the puzzle is driver support. Unlike PC hosts, handheld devices don't have an easy method of installing new drivers—or much space in which to store them. Instead, the OTG supplement requires that each dual-role device have a Targeted Peripheral List of supported peripheral devices. This list specifies the type, manufacturer, and model of devices that a dual-role device supports. Operation with any device other than those on the Targeted Peripheral List is neither guaranteed nor required.

Future work will define "OTG Type" specifications that describe the characteristics of a class of devices. OTG Type specifications will let a host support a large class of peripherals without needing individual driver support.

Design Considerations: The OTG specification is a supplement to the core USB specification, not a replacement. PC hosts and standard peripherals are completely unchanged. The new OTG features are only necessary for portable devices with host capability, and to a lesser degree for peripherals for use with dual-role devices.

The vast majority of the core USB specification applies unchanged to both standard and OTG devices. That core is 622 pages long. In comparison, the OTG supplement is only 74 pages long, with mechanical drawings making up nearly a third of that. The supplement merely provides protocols for switching roles between host and device and for negotiating sessions. But what happens between the host and device during a session remains completely unchanged.

Furthermore, the OTG supplement defines a range of capabilities. A device doesn't need to implement all capabilities to be OTG compliant. For example, a peripheral-only device must support just SRP and have a current consumption of 8 mA or less in its default configuration. The changes to a peripheral to add SRP are fairly simple—the ability to perform VBUS pulsing (a driver tied to VBUS through a resistor), and some trivial logic to implement the protocol. Designing a dual-role device is harder. Such a device must feature:

  • Limited host capability
  • Full-speed operation as a peripheral (high-speed optional)
  • Full-speed support as a host (low- and high-speeds optional)
  • Targeted Peripheral List
  • SRP
  • HNP
  • Exactly one Mini-AB receptacle
  • Minimum of 8-mA output on VBUS
  • Means to communicate messages to users

Compared to a standard USB peripheral, this entails adding analog capabilities (VBUS drive and control features, VBUS level-sensing logic), digital logic (host capability, support for SRP and HNP protocols), software (driver support for items on the Targeted Peripheral List), and system functions (a way to communicate messages to the user). So, designing an OTG peripheral-only device takes just a little more effort than a standard USB peripheral, while the design of a dual-role device is significantly more complex.

The degree to which this increase in complexity impacts the product design effort and schedule depends greatly on the type of product, the starting point of the effort (modifying an existing design versus beginning a new design from scratch), the available components, and the chosen design method.

As with a standard USB system, a designer can choose to implement the USB portion of the design in one of three ways: purchasing a full solution, using a USB microcontroller, or designing a custom IC. Obviously, the design effort involved in the USB interface itself decreases with the completeness of the chosen solution. Of course, the usual tradeoffs between flexibility, cost, suitability, and design time and effort apply.

The difficulty and risk of designing an OTG dual-role device will decrease significantly over the next few years as greater numbers of robust, complete building blocks come on the market. With any choice, there are overall system considerations that apply to any OTG device. An example is the need to communicate messages to users.

Additional testing is the final component. OTG devices need to be well tested for conformance to the specification and flawless operation to create a good user experience. A validation plan should include careful consideration and testing of all parameters specified by both the USB specification and OTG supplement. The OTG Compliance Plan is a good place to start validation.

Current Status: Developed by a committee of representatives from a cross-section of the industry, the OTG supplement already has broad support from connector makers, IP vendors, silicon providers, software houses, and equipment manufacturers. Based on this support and committed involvement, it's anticipated that OTG devices will appear on the market soon. Now that the specification has been released, a major focus of the committee is education and evangelization. Recently, the committee sponsored several industry training sessions in the U.S., Asia, and Europe. Such activities will continue in the future.

Moreover, several areas for future work and companion specifications are still in development. The OTG Committee is finalizing the OTG Compliance Plan, a specification that defines the compliance tests to ensure OTG devices meet the specification requirements. There also is considerable work under way to define OTG Types.

There's no better way to understand the new features and correctly implement them in your own products than by directly working with the specifications—and with the experts who designed them. To further explore USB, or to download the USB specification and ECN, visit www.usb.org/. To learn more about OTG, download the OTG supplement, read explanatory articles, learn about OTG events, and join the OTG Committee mailing list, see www.usb.org/developers/onthego/. Any company that wishes to access this information must be a registered member of the USB Implementers Forum (USB-IF).

Along with the proliferation of powerful portable devices come new problems in communications protocols. USB OTG addresses these problems. The specification is available now and ready to help enable the next generation of mobile computing.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish