Design Article

Linking Mobiles with USB: A Look at the OTG Supplement

David Luke, Cypress Semiconductor

1/9/2003 4:49 AM EST

Linking Mobiles with USB: A Look at the OTG Supplement
To date, the universal serial bus (USB) has been seen as a way to link peripheral components to personal computers. From printers to CD burners, USB has found a home in most PC peripherals.

With the adoption of the 2.0 spec in 2000, USB backers began to push the specification out into new domains, such as mass storage and video cameras. Now, USB backers are taking the next step to capture the mobile market.

In December 2001, the USB core companies released of the On-The-Go (OTG) supplement. Through this supplement, the USB spec defines the mechanical, electrical, and protocol definitions required to make USB a mobile-friendly technology. Here's a look at the technical details of the OTG supplement.

Laying the Groundwork
In order to understand the new advantages of the new OTG capabilities, we must first understand the philosophy behind USB and the unique requirements of portable devices, to see how the USB paradigm falls short of meeting those requirements.

USB was designed to be a master-slave protocol, for use with one host and potentially many peripherals. Consequently, the intelligence in the system is centered primarily in the host. PCs have large storage capacity for drivers and applications, and make it easy to install new software as needed. USB uses directed cables, with one type of connector for plugging into a host and another type for plugging into a device, for foolproof connectivity. The power distribution aspects of the specification were also designed with the assumption of a host with unlimited power running the system.

As microprocessor capability, memory storage densities, and battery technology continue to evolve, the marketplace is seeing an explosion in highly capable portable devices, such as cellular telephones, MP3 players, digital cameras, and PDAs. The increasing capability of such devices leads to an increasing need for these devices to share data with PCs, peripherals and other portable devices.

Many aspects of these new devices and their communication needs are beyond the scope of what was envisioned when the USB specification was defined. Connections between portable devices, or between a portable device and a peripheral, are more likely to be one-to-one, rather than the one-to-many paradigm seen in a PC with connected peripherals. Connections between devices with similar capabilities may imply more of a peer-to-peer paradigm than the master-slave relationship between a PC and a peripheral. Indeed, a portable device may need to act more like a peripheral at times, and more like a host at other times.

Clearly, there are areas where the assumptions made in the design of the USB specification and the divergent requirements of portable devices leave gaps that make classic USB less than idea for portable applications. At the same time, however, USB brings compelling advantages of familiarity, ease of use, low cost, and a huge installed base. The intent of the OTG supplement is to bridge the gaps and make the advantages of USB available to the rapidly growing portable devices market.

OTG Mechanical Specs
At the lowest level, the OTG Supplement addresses several specification performance gaps by adding new mechanical specifications to address issues of size, connectivity, and durability.

The standard USB connectors defined by the original 1996 specification are much smaller than standard connectors on parallel or serial ports, but they are still too large for use on tiny cell phones or MP3 players. The USB 2.0 specification release and the OTG supplement address this need by the Mini-A and Mini-B plugs and receptacles. These are considerably smaller than their original, full-sized counterparts (see Figure 1 and Figure 2 for comparisons between Standard and Mini connector cross-sections), making them much more suited to portable devices.


Figure 1: USB A vs. OTG Mini-A connectors


Figure 2: USB B vs. OTG Mini-B connectors.

Perhaps the biggest mechanical obstacle to the use of USB in portable devices is the paradigm of directed cables. The USB specification requires that all ports closer to the host ("upstream" ports) use A connectors, while ports closer to the peripheral ("downsteam" ports) use B connectors. This works well with PCs and peripherals, because it makes it impossible to get the connections wrong. However, this requirement is less than ideal for a portable device that sometimes may act as a host (a PDA connected to a printer, for example) and at other times as a peripheral (the same PDA connected to a PC for hot-synching).

The OTG Supplement solves this problem by defining a new breed of connector, the Mini-AB receptacle. This new receptacle is used on dual-role devices (devices which can function as either hosts or peripherals), and can accept either a Mini-A or a Mini-B plug.

The secret of the Mini-AB is an ID pin, not present in standard USB plugs. This pin is shorted to ground in the Mini-A plug and unconnected in the Mini-B plug. A dual-role device uses this ID pin to identify which type of plug is connected and thereby determine its default role. This allows a device with one connector to work with directed USB cables, and to function in either the host or the peripheral role.

Finally, the OTG Supplement adds a subtle but important durability enhancement to the original USB specification. The USB spec requires that plugs and receptacles be rated at 1500 insertion cycles. This is more than sufficient for most desktop applications; a keyboard for a desktop PC may only be plugged in three or four times in its entire lifetime. It may not be sufficient for some portable applications.

Imagine, for example, a road warrior who may need to connect his PDA to his cell phone a half-dozen times a day. The OTG Supplement raises the bar for connector durability to 5000 insertion cycles, enough to keep our hypothetical road warrior happily plugging and unplugging for at least three and a half years.

Shake Hands With Your Host
The new Mini-AB receptacle defined by the OTG Supplement makes it possible for a device with a single connector to be connected either as a host or as a peripheral. A device with such capability is known as a "dual-role device", or DRD. For example, a user could connect their dual-role digital camera to a PC. The cable's A plug would be connected to the PC, and the cable's Mini-B plug would be connected to the camera. The camera would use the ID pin on the connector to sense that it had been connected as a peripheral, and act as such.

The user could instead connect the camera to a printer, using a cable with a Mini-A plug on one end and a Standard-B plug on the other. The B plug would fit into the printer's B receptacle, while the Mini-A plug in the camera's Mini-AB receptacle would tell the camera to behave as a host, whereupon the user could send images directly to the printer for printing.

In the cases described above, the directed-cable paradigm of the original USB specification, in conjunction with the new Mini-AB connector, allows the camera to behave correctly in both situations. But, what happens if two dual-role devices are connected together?

The OTG supplement addresses this case by defining a new handshake called the host negotiation protocol (HNP). As previously mentioned, USB is inherently a master-slave protocol, where all transactions on the bus are initiated by the host. 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. However, the user does not need to disconnect the cable and reconnect it to change a dual-role device from host to peripheral mode. The devices can use HNP, by which a dual-role device connected as a default peripheral can request that it become the host. This allows the existing USB master-slave paradigm to provide a "peer-to-peer" user experience.

To perform the HNP, the A-device (the device connected to the Mini-A side of the cable) must first enable the B-device's ability to take control of the bus by using a new Set_Feature request defined by the OTG supplement. Once enabled, the B-device can take control of the bus whenever allowed to do so by the A-device. When 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 (1). The B-device can then drop the D+ line low to signal a disconnect (2). The A-device will then enable its data-line pull-up resistor (3), and the switch is complete. The B-device may now operate in the role of host, and the A-device will respond as a peripheral. The B-device resets the A-device (4) and communication proceeds (5). (Note: The numbers in parentheses refer to the illustration of HNP in Figure 3.)


Figure 3: Diagram of the OTG HNP.

The B-device can return control of the bus to the A-device by suspending the bus (6). The A-device will detect this and deactivate its D+ pull-up resistor (7). The B-device then re-enables its D+ pull-up resistor (8), and operation resumes with the devices back in their default roles (9,10).

Requesting Sessions
One final issue facing portable USB devices is that of power management. In a "classic" USB system, the host provides power at a nominal 5V and at least 100 mA on the USB VBUS line at all times when the host is operational. 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 cellular telephone.

To conserve power and extend battery life, the OTG supplement allows the A-device to turn off VBUS when there is no activity on the bus. If the B-device wants to communicate, it can use the session request protocol (SRP) to request that the A-device re-enable VBUS and start a session.

The B-device can initiate the SRP any time after at least 2 ms have elapsed since the previous session ended (Figure 4). The A-device suspends the bus at 1 and drops VBUS to end the session at 2. The B-device initiates by performing both "data-line pulsing" and "VBUS pulsing." The B-device does data-line pulsing by enabling its data line pull-up resistor (on D+ for full-speed devices, D- for low-speed devices) for between 5 and 10 ms (3). VBUS pulsing is performed by driving VBUS weakly (4). The weak drive is 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.


Figure 4: Diagram highlighting the OTG SRP.

The A-device detects either the data-line pulsing or VBUS pulsing and initiates a session by enabling VBUS (5), after which it can begin USB traffic again (6, 7). The session lasts until the A-device decides that there is no more traffic that needs to occur on the bus, at which time it terminates the session by turning off VBUS.

Design Considerations
The mechanical, electrical, and protocol capabilities defined by the OTG supplement augment the USB Specification and adapt its advantages to address the unique needs of portable devices. The key word for the designer to note here is "augment." The OTG supplement does not change or replace the requirements of the USB specification. It merely adds new capabilities that can be implemented in a device as needed.

In particular, the needs of PC hosts and standard peripherals are completely unchanged. The new OTG features are only needed for portable devices with host capability, and to a lesser degree for peripherals that may at some point be connected to dual-role devices.

Another way to look at the OTG supplement is that it provides protocols that may be "wrapped around" existing USB protocols. The new capabilities of the OTG supplement are addressed principally at the system level. The OTG supplement provides protocols for switching roles between host and device and for negotiating sessions. What happens during a session is completely unchanged from "classic" USB.

The design of an OTG peripheral-only device is only slightly more difficult than the design of a standard USB peripheral. The design of a dual-role device, however, is significantly more complex. In addition to meeting the USB specification, a dual-role device is required to have the following features:

  • Limited host capability
  • Full-speed operation as peripheral (high-speed optional)
  • Full-speed support as host (low-speed and high-speed optional)
  • Targeted peripheral list (a list of supported peripherals)
  • Session request protocol
  • Host negotiation protocol
  • Exactly one Mini-AB receptacle
  • Minimum 8 mA output on VBUS
  • Means for communicating messages to the user

This entails adding analog capabilities (VBUS drive and control capability, VBUS level sensing logic), digital logic capabilities (host capability, support for SRP and HNP protocols), software capabilities (driver support for items on the targeted peripheral list), and system capabilities (means for communication messages to the user).

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

As with any other USB subsystem, a designer has three main choices for implementing the USB portion of the design: using a turnkey 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 also apply. Early adopters need to shoulder more of the design burden as the price to pay for getting to market sooner. However, the difficulty and risk of designing an OTG dual-role device are decreasing, and will continue to decrease over the next year or two, as more OTG-enabled transceivers, microcontrollers, software, and other building blocks come to market.

Additional testing is the final component. OTG devices need to be tested well to insure conformance to the specification and flawless operation in order to provide 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 in your validation efforts.

Author's Note:
For more information on the OTG supplement, visit http://www.usb.org/developers/onthego/.

About the Author
David Luke is a principal electrical design engineer with Cypress Semiconductor in Boise, Idaho. He holds a Bachelor of Science degree in Electrical and Computer Engineering and Japanese, and a Master of Science degree in Electrical Engineering, from Brigham Young University. David can be reached at dvl@cypress.com.





Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)

Feedback Form