USB On-The-Go

From Wikipedia, the free encyclopedia

Jump to: navigation, search
USB OTG Logo

USB On-The-Go, normally abbreviated USB OTG, is a supplement [1] to the USB 2.0 specification.

The standard USB uses a master/slave architecture; a USB 'Host' acts as the protocol master, and a USB 'Device' acts as the slave. Only the Host can schedule the configuration and data transfers over the link. The Devices cannot initiate data transfers, they only respond to requests given by a host.

OTG introduces the concept that a 'Device' can perform both the master and slave roles, and so subtly changes the terminology. Now a 'Device' can be either a 'Host' (acting as the link master) or a 'Peripheral' (acting as the link slave).

The Device connected to the 'A' end of the cable at startup acts as the Default Host, while the 'B' end acts as the Default Peripheral.

A key usage case is a mobile phone that can be a Default Host to a Mass Storage memory stick or a Default Peripheral to a PC (for data synchronisation) Other examples might be connecting a USB keyboard or printer to a handheld wireless computer or cell phone; or a USB printer that knows how to grab files from cameras or USB key drives and print them.

Compatible Devices are able to swap Host/Peripheral roles with each other thereby allowing either Device to initiate a data-transfer.

The key use case here is a Back-to-Back connection between two mobile phones, where either can assume the Host role independent from the orientation of the cable link.

The OTG supplement does not preclude using a hub, but it describes Host/Peripheral role swapping only for the case of a one-to-one connection where two OTG devices are directly connected. If a standard hub is used, the supplement notes that using it will lead to losing USB OTG role-swap capabilities, locking one device as the Host and the other as the Peripheral until the hub is disconnected.

Contents

[edit] Protocols

USB On-The-Go introduced two new protocols, Session Request Protocol (SRP) and Host Negotiation Protocol (HNP).

  • SRP allows both communicating devices to control when the link's power session is active; in standard USB, only the host is capable of doing so. That allows fine control over the power consumption, which is very important for battery operated devices such as cameras and mobile phones. The OTG host can leave the USB link unpowered until the peripheral asks it to start delivering power. OTG hosts may not have much power to spare from their batteries, and leaving the USB link unpowered helps stretch battery life.
  • HNP allows the two devices to exchange their Host/Device roles, provided both are OTG dual-role devices. By using HNP for reversing Host/Device roles, the USB OTG gadget is capable of acquiring control of data-transfer scheduling. Thus, any OTG device is capable of initiating data-transfer over USB OTG bus.

The main purpose of HNP is to accommodate users who have connected the A and B devices (see below) in the wrong direction for the task they want to perform. For example, a printer is connected as the A-device (host), but cannot function as a host for a particular camera, since it doesn't understand the cameras representation of print jobs. When that camera knows how to talk to the printer, the printer will use HNP to switch to the slave role, making the camera the host to the printer so that the user's pictures will get printed without juggling cables.

It must be noted that these new OTG protocols cannot pass through a standard USB hub since they are based on physical electrical-signalling.

[edit] Device roles

USB OTG defines two roles of devices: OTG A-device and OTG B-device. This terminology defines which side supplies power to the link, and which is initially the host. The OTG A-device is a power supplier, and an OTG B-device is a power consumer. The default link configuration is that A-device act as USB Host and B-device is a USB Device. The host and device modes may be exchanged later by using HNP. Because every OTG controller supports both roles, they are often called "Dual-Role" controllers rather than "OTG controllers".

For IC designers, an attraction of USB OTG is the ability to get more USB capabilities with fewer gates. A "traditional" approach includes four controllers:

  • USB High Speed host controller based on EHCI (a register interface)
  • Full/low Speed host controller based on OHCI (another register interface)
  • USB Device controller, supporting both high and full speeds
  • Fourth controller to switch the OTG root port between host and device controllers.

That's a lot of gates to test and debug. Plus, most gadgets need to be just a Host, or just a Device. OTG hardware design merges all of these controllers into one Dual-Role controller, somewhat more complex than the device controller alone.

[edit] OTG Micro Plugs

The USB On-The-Go standard introduces a new plug receptacle called micro-AB. It can accept either a micro-A plug or a micro-B plug. Micro-A Adapters allow for connection to standard-A plug type USB cables, as used on standard USB 2.0 Devices.

The OTG cable has a micro-A plug on one side, and a micro-B plug on the other (it cannot have two plugs of the same type). OTG adds a fifth pin to the standard USB connector, called the ID-pin; the micro-A plug has the ID pin grounded, while the ID in the micro-B plug is floating. The device that has a micro-A plugged in becomes an OTG A-device, and the one that has micro-B plugged becomes a B-device (see above). The type of the plug inserted is detected by the state of the pin ID . There are also pure Micro-A sockets, used where a compact host connector is needed, but OTG (dual-role and role swapping) is not supported. In this case, the socket will only accept a Micro-A plug based on the A and B connectors being mechanically slightly different.

[edit] Backward compatibility

USB OTG devices are backward compliant with USB 2.0 and will behave as standard USB Hosts or Devices when connected to standard (non-OTG) USB devices. The main exception is that OTG hosts are only required to provide a small amount of power, which may not be enough to connect to a non-OTG peripheral. This can sometimes be worked around by connecting the non-OTG peripheral through an externally powered hub if that OTG host supports hubs. (Such support is not required.)

[edit] References

  1. ^ On-The-Go Supplement to the USB 2.0 Specification Revision 1.3, December 5, 2006

[edit] External links

Personal tools