USB OTG
   HOME

TheInfoList



OR:

USB On-The-Go (USB OTG or just OTG) is a specification first used in late 2001 that allows
USB device Universal Serial Bus (USB) is an technical standard, industry standard that establishes specifications for cables, connectors and communication protocol, protocols for connection, communication and power supply (Interface (computing), interfa ...
s, such as tablets or
smartphone A smartphone is a portable computer device that combines mobile telephone and computing functions into one unit. They are distinguished from feature phones by their stronger hardware capabilities and extensive mobile operating systems, whic ...
s, to act as a host, allowing other
USB Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
devices, such as
USB flash drive A USB flash drive (also called a thumb drive) is a data storage device that includes flash memory with an integrated USB interface. It is typically removable, rewritable and much smaller than an optical disc. Most weigh less than . Since firs ...
s,
digital camera A digital camera is a camera that captures photographs in digital memory. Most cameras produced today are digital, largely replacing those that capture images on photographic film. Digital cameras are now widely incorporated into mobile device ...
s,
mouse A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus' ...
or
keyboards Keyboard may refer to: Text input * Keyboard, part of a typewriter * Computer keyboard ** Keyboard layout, the software control of computer keyboards and their mapping ** Keyboard technology, computer keyboard hardware and firmware Music * Musi ...
, to be attached to them. Use of USB OTG allows those devices to switch back and forth between the roles of host and device. A mobile phone may read from removable media as the host device, but present itself as a USB Mass Storage Device when connected to a host computer. USB OTG introduces the concept of a device performing both Host and Peripheral roles whenever two USB devices are connected and one of them is a USB OTG device, they establish a
communication link A data link is the means of connecting one location to another for the purpose of transmitting and receiving digital information (data communication). It can also refer to a set of electronics assemblies, consisting of a transmitter and a recei ...
. The device controlling the link is called the Host, while the other is called the Peripheral. USB OTG defines two roles for devices: OTG A-device and OTG B-device, specifying which side supplies power to the link, and which initially is the host. The OTG A-device is a power supplier, and an OTG B-device is a power consumer. In the default link configuration, the A-device acts as a USB host with the B-device acting as a USB peripheral. The host and peripheral modes may be exchanged later by using Host Negotiation Protocol (HNP). The wiring for the ID pin defines the initial role of each device.


Overview

Standard USB uses a Master/Slave architecture; a ''host'' acts as the Host device for the entire bus, and a USB ''device'' acts as a Peripheral. If implementing standard USB, devices must assume one role or the other, with computers generally set up as hosts, while (for example) printers normally function as a Peripheral. In the absence of USB OTG, cell phones often implemented Peripheral functionality to allow easy transfer of data to and from computers. Such phones could not readily be connected to printers as they also implemented the peripheral role. USB OTG directly addresses this issue. When a device is plugged into the USB bus, the host device sets up communications with the device and handles
service provisioning In telecommunication, provisioning involves the process of preparing and equipping a network to allow it to provide new services to its users. In National Security/Emergency Preparedness telecommunications services, ''"provisioning"'' equates to ...
(the host's software enables or does the needed data-handling such as file managing or other desired kind of data communication or function). That allows the devices to be greatly simplified compared to the host; for example, a mouse contains very little logic and relies on the host to do almost all of the work. The host controls all
data transfer Data transmission and data reception or, more broadly, data communication or digital communications is the transfer and reception of data in the form of a digital bitstream or a digitized analog signal transmitted over a point-to-point or ...
s over the bus, with the devices capable only of signalling (when polled) that they require attention. To transfer data between two devices, for example from a phone to a printer, the host first reads the data from one device, then writes it to the other. While the master-slave arrangement works for some devices, many devices can act either as master or as slave depending on what else shares the bus. For instance, a computer printer is normally a slave device, but when a USB flash drive containing images is plugged into the printer's USB port with no computer present (or at least turned off), it would be useful for the printer to take on the role of host, allowing it to communicate with the flash drive directly and to print images from it. USB OTG recognizes that a device can perform both Host and Peripheral roles, and so subtly changes the terminology. With OTG, a device can be either a host when acting as a link master, or a link peripheral. The choice between host and peripheral roles is handled entirely by which end of the cable the device is connected to. The device connected to the "A" end of the cable at start-up, known as the "A-device", acts as the default host, while the "B" end acts as the default peripheral, known as the "B-device". After initial startup, setup for the bus operates as it does with the normal USB standard, with the A-device setting up the B-device and managing all communications. However, when the same A-device is plugged into another USB system or a dedicated host becomes available, it can become a slave. USB OTG does not preclude using a
USB hub Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
, but it describes host-peripheral role swapping only for the case of a one-to-one connection where two OTG devices are directly connected. Role swapping does ''not'' work through a standard hub, as one device will act as a host and the other as a peripheral until they are disconnected.


Specifications

USB OTG is a part of a supplement to the
Universal Serial Bus Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
(USB) 2.0 specification originally agreed upon in late 2001 and later revised. The latest version of the supplement also defines behavior for an Embedded Host which has targeted abilities and the same USB Standard-A port used by PCs. SuperSpeed OTG devices, Embedded Hosts and peripherals are supported through the USB OTG and Embedded Host Supplement to the
USB Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
3.0 specification.


Protocols

The USB OTG and Embedded Host Supplement to the USB 2.0 specification introduced three new
communication protocols A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchron ...
: * Attach Detection Protocol (ADP): Allows an OTG device, embedded host or USB device to determine attachment status in the absence of power on the USB bus, enabling both insertion-based behavior and the capability to display attachment status. It does so by periodically measuring the capacitance on the USB port to determine whether there is another device attached, a dangling cable, or no cable. When a large enough change in capacitance is detected to indicate device attachment, an A-device will provide power to the USB bus and look for device connection. At the same time, a B-device will generate SRP (see below) and wait for the USB bus to become powered. * Session Request Protocol (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 or embedded host can leave the USB link unpowered until the peripheral (which can be an OTG or standard USB device) requires power. OTG and embedded hosts typically have little battery power to spare, so leaving the USB link unpowered helps in extending the battery runtime. * Host Negotiation Protocol (HNP): Allows the two devices to exchange their host/peripheral roles, provided both are OTG dual-role devices. By using HNP for reversing host/peripheral roles, the USB OTG device is capable of acquiring control of data-transfer scheduling. Thus, any OTG device is capable of initiating data-transfer over USB OTG bus. The latest version of the supplement also introduced HNP polling, in which the host device periodically polls the peripheral during an active session to determine whether it wishes to become a host. * 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 the host for a particular camera, since it does not understand the camera's 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, with the camera becoming the host so pictures stored on the camera can be printed out without reconnecting the cables. The new OTG protocols cannot pass through a standard USB hub since they are based on electrical signaling via a dedicated wire. The USB OTG and Embedded Host Supplement to the USB 3.0 specification introduces an additional communication protocol: * Role Swap Protocol (RSP): RSP achieves the same purpose as HNP (i.e., role swapping) by extending standard mechanisms provided by the USB 3.0 specification. Products following the USB OTG and Embedded Host Supplement to the USB 3.0 specification are also required to follow the USB 2.0 supplement in order to maintain backwards compatibility. SuperSpeed OTG devices (SS-OTG) are required to support RSP. SuperSpeed Peripheral Capable OTG devices (SSPC-OTG) are not required to support RSP since they can only operate at SuperSpeed as a peripheral; they have no SuperSpeed host and so can only role swap using HNP at USB 2.0 data rates.


Device roles

USB OTG defines two roles for devices: OTG A-device and OTG B-device, specifying which side supplies power to the link, and which initially is the host. The OTG A-device is a power supplier, and an OTG B-device is a power consumer. In the default link configuration, the A-device acts as a
USB host Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
with the B-device acting as a USB peripheral. The host and peripheral modes may be exchanged later by using HNP or RSP. Because every OTG controller supports both roles, they are often called "Dual-Role" controllers rather than "OTG controllers". For
integrated circuit An integrated circuit or monolithic integrated circuit (also referred to as an IC, a chip, or a microchip) is a set of electronic circuits on one small flat piece (or "chip") of semiconductor material, usually silicon. Large numbers of tiny ...
(IC) designers, an attractive feature of USB OTG is the ability to achieve more USB capabilities with fewer gates. A "traditional" approach includes four controllers, resulting in more gates to test and debug: * USB high speed host controller based on EHCI (a register interface) * Full/low speed host controller based on
OHCI A host controller interface (HCI) is a register-level interface that enables a host controller for USB or IEEE 1394 hardware to communicate with a host controller driver in software. The driver software is typically provided with an operating sys ...
(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 Also, most gadgets must be either a host or a device. OTG hardware design merges all of the controllers into one dual-role controller that is somewhat more complex than an individual device controller.


Targeted peripheral list (TPL)

A manufacturer's targeted peripheral list (TPL) serves the aim of focusing a host device towards particular products or applications, rather than toward its functioning as a general-purpose host, as is the case for typical PCs. The TPL specifies products supported by the "targeting" host, defining what it needs to support, including the output power, transfer speeds, supported protocols, and device classes. It applies to all targeted hosts, including both OTG devices acting as a host and embedded hosts. ≠


Plug


OTG mini plugs

The original USB OTG standard introduced a plug receptacle called mini-AB that was replaced by micro-AB in later revisions (Revision 1.4 onwards). It can accept either a mini-A plug or a mini-B plug, while mini-A adapters allows connection to standard-A USB cables coming from peripherals. The standard OTG cable has a mini-A plug on one end and a mini-B plug on the other end (it can not have two plugs of the same type). The device with a mini-A plug inserted becomes an OTG A-device, and the device with a mini-B plug inserted becomes a B-device (see above). The type of plug inserted is detected by the state of the ID pin (the mini-A plug's ID pin is grounded, while the mini-B plug's is floating). Pure mini-A receptacles also exist, used where a compact host port is needed, but OTG is not supported.


OTG micro plugs

With the introduction of the USB micro plug, a new plug receptacle called micro-AB was also introduced. It can accept either a micro-A plug or a micro-B plug. Micro-A adapters allow for connection to standard-A plugs, as used on fixed or standard devices. An OTG product must have a single micro-AB receptacle and no other USB receptacles. An OTG cable has a micro-A plug on one end, and a micro-B plug on the other end (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. A device with a micro-A plug inserted becomes an OTG A-device, and a device with a micro-B plug inserted becomes a B-device. The type of plug inserted is detected by the state of the pin ID. Three additional ID pin states are defined at the nominal resistance values of , , and , with respect to the ground pin. These permit the device to work with
USB Accessory Charger Adapter The initial versions of the USB standard specified connectors that were easy to use and that would have acceptable life spans; revisions of the standard added smaller connectors useful for compact portable devices. Higher-speed development of ...
s that allows the OTG device to be attached to both a charger and another device simultaneously. These three states are used in the cases of: * A charger and either no device or an A-device that is not asserting V (not providing power) are attached. The OTG device is allowed to charge and initiate SRP but not connect. * A charger and an A-device that is asserting V (is providing power) are attached. The OTG device is allowed to charge and connect but not initiate SRP. * A charger and a B-device are attached. The OTG device is allowed to charge and enter host mode. USB 3.0 introduced a backwards compatible SuperSpeed extension of the micro-AB receptacle and micro-A and micro-B plugs. They contain all pins of the non-Superspeed micro connectors and use the ID pin to identify the A-device and B-device roles, also adding the SuperSpeed pins.


OTG micro cables

When an OTG-enabled device is connected to a PC, it uses its own USB-A or USB Type-C cable (typically ending in micro-B,
USB-C USB-C (properly known as USB Type-C) is a 24-pin USB connector system with a rotationally symmetrical connector. The designation C refers only to the connector's physical configuration or form factor and should not be confused with the conne ...
or
Lightning Lightning is a naturally occurring electrostatic discharge during which two electric charge, electrically charged regions, both in the atmosphere or with one on the land, ground, temporarily neutralize themselves, causing the instantaneous ...
plugs for modern devices). When an OTG-enabled device is attached to a USB slave device, such as a flash drive, the slave device must either end in the appropriate connection for the device, or the user must supply an appropriate adapter ending in USB-A. The adapter enables any standard USB peripheral to be attached to an OTG device. Attaching two OTG-enabled devices together requires either an adapter in conjunction with the slave device's USB-A cable, or an appropriate dual-sided cable and a software implementation to manage it. This is becoming commonplace with USB Type-C devices.


Smartphone and tablet implementation

BlackBerry 10 BlackBerry 10 is a discontinued proprietary mobile operating system for the BlackBerry line of smartphones, both developed by BlackBerry Limited (formerly Research In Motion). BlackBerry 10 is based on QNX, a Unix-like operating system that was o ...
.2 implements Host Mode (like in the
BlackBerry Z30 The BlackBerry Z30 is a high-end 4G touchscreen smartphone developed by BlackBerry. Announced on September 18, 2013, it succeeds the Z10 as the second totally touchscreen device to run the BlackBerry 10 operating system (and the first with vers ...
handset). Nokia has implemented USB OTG in many of their Symbian cellphones such as Nokia N8, C6-01, C7, Oro, E6, E7, X7, 603, 700, 701 and 808 Pureview. Some high-end Android phones produced by HTC, and Sony under
Xperia Xperia () is the brand name of smartphones and tablets from Sony. The name Xperia is derived from the word "experience", and was first used in the Xperia X1 tagline of "I Xperia the best". Sony Mobile was previously known globally as Sony Er ...
series also have it. Samsung Android version 3.1 or newer supports USB OTG, but not on all devices. * Host-powered: Sony Ericsson Xperia pro * Needs external USB-power: Motorola Droid 4 Specifications listed on technology web sites (such as GSMArena, PDAdb.net, PhoneScoop, and others) can help determine compatibility. Using GSMArena as an example, one would locate the page for a given device, and examine the verbiage under ''Specifications → Comms → USB''. If "USB Host" is shown, the device should be capable of supporting OTG-type external USB accessories. In many of the above implementations, the host device has only a micro-B receptacle rather than a micro-AB receptacle. Although non-standard, micro-B to micro-A receptacle adapters are widely available and used in place of the mandated micro-AB receptacle on these devices.


Backward compatibility

USB OTG devices are backward-compatible with USB 2.0 (USB 3.0 for SuperSpeed OTG devices) 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 enough power for the products listed on the TPL, which may or may not be enough to connect to a peripheral that is not listed. A powered
USB hub Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
may sidestep the issue, if supported, since it will then provide its own power according to either the USB 2.0 or USB 3.0 specifications. Some incompatibilities in both HNP and SRP were introduced between the 1.3 and 2.0 versions of the OTG supplement, which can lead to interoperability issues when using those protocol versions.


Charger compatibility

Some devices can use their USB ports to charge built-in batteries, while other devices can detect a dedicated charger and draw more than 500 mA (0.5 A), allowing them to charge more rapidly. OTG devices are allowed to use either option.


See also

*
Android Open Accessory Development Kit Android software development is the process by which applications are created for devices running the Android operating system. Google states that "Android apps can be written using Kotlin, Java, and C++ languages" using the Android software d ...
*
Mobile High-Definition Link Mobile High-Definition Link (MHL) is an industry standard for a mobile audio/video interface that allows the connection of smartphones, tablets, and other portable consumer electronics devices to high-definition televisions (HDTVs), audio receive ...
, which repurposes the USB on-the-go ID pin *
Mobile phone accessories Mobile accessories include any hardware that is not integral to the operation of a mobile smartphone as designed by the manufacturer. Cases Cases, which are designed to attach to, support, or otherwise hold a smartphone, are popular access ...
*
USB human interface device class In computing, the USB human interface device class (USB HID class) is a part of the USB specification for computer peripherals: it specifies a device class (a type of computer hardware) for human interface devices such as keyboards, mice, game ...


References


External links

* * * {{USB USB