Recent from talks
Nothing was collected or created yet.
USB On-The-Go
View on Wikipedia


USB On-The-Go (USB OTG) is a specification that allows certain USB devices, such as tablets or smartphones, to function either as a host or a peripheral. This enables them to connect directly to other USB devices, such as flash drives, digital cameras, mice or keyboards. USB OTG was first introduced in late 2001.
Unlike standard USB connections, which involve a fixed host (such as a computer) and a peripheral (such as a keyboard), USB OTG allows a device to switch between these roles. For example, a smartphone can act as a host when reading files from a flash drive, but function as a peripheral when connected to a computer.
USB OTG defines two device roles: the A-device, which supplies power and initially acts as the host, and the B-device, which consumes power and begins as the peripheral. These roles can be reversed using the Host Negotiation Protocol (HNP). The initial role is determined by the wiring of a specific pin, known as the ID pin, in the USB connector.[1] The A/B naming convention reflects earlier USB connector types: Type-A connectors were used with host devices, while Type-B connectors were used with peripherals.
In September 2019 USB Implementers Forum has stopped certifying new USB OTG products because of Introduction of USB-C standard.[2]
Overview
[edit]Standard USB uses a host/device 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.[1]
When a device is plugged into the USB bus, the host device sets up communications with the device and handles service provisioning (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 transfers 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.[citation needed]
While the host-device arrangement works for some devices, many devices can act either as host or as device depending on what else shares the bus. For instance, a computer printer is normally a 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.[citation needed]
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 host, 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".[citation needed]
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 device.[citation needed]
USB OTG does not preclude using a USB 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. 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.[citation needed]
Specifications
[edit]USB OTG is a part of a supplement[3] to the Universal Serial Bus (USB) 2.0 specification originally agreed upon in late 2001 and later revised.[4] 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.[citation needed]
SuperSpeed OTG devices, Embedded Hosts and peripherals are supported through the USB OTG and Embedded Host Supplement[5] to the USB 3.0 specification.[citation needed]
Protocols
[edit]The USB OTG and Embedded Host Supplement to the USB 2.0 specification introduced three new communication protocols:
- 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 device 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 backward 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
[edit]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 HNP or RSP. Because every OTG controller supports both roles, they are often called "Dual-Role" controllers rather than "OTG controllers".
For integrated circuit (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 (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)
[edit]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
[edit]
OTG mini plugs
[edit]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
[edit]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.[6][7]
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[6] at the nominal resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect to the ground pin. These permit the device to work with USB Accessory Charger Adapters that allows the OTG device to be attached to both a charger and another device simultaneously.[8]
These three states are used in the cases of:
- A charger and either no device or an A-device that is not asserting VBUS (not providing power) are attached. The OTG device is allowed to charge and initiate SRP but not connect.[8]
- A charger and an A-device that is asserting VBUS (is providing power) are attached. The OTG device is allowed to charge and connect but not initiate SRP.[8]
- A charger and a B-device are attached. The OTG device is allowed to charge and enter host mode.[8]
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
[edit]
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 or Lightning plugs for modern devices). When an OTG-enabled device is attached to a USB device, such as a flash drive, the 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 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
[edit]BlackBerry 10.2 implements Host Mode (like in the BlackBerry Z30 handset).[9] 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 series also have it.[10] Samsung[11][12] Android version 3.1 or newer supports USB OTG, but not on all devices.[13][14]
- 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.[15][16]
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.[17]
Backward compatibility
[edit]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 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
[edit]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.[8]
See also
[edit]- Android Open Accessory Development Kit
- Mobile High-Definition Link, which repurposes the USB on-the-go ID pin
- Mobile phone accessories
- USB human interface device class
References
[edit]- ^ a b Koeman, Kosta (22 November 2001). "Understanding USB On-The-Go". edn.com. EDN. Retrieved 20 June 2017.
- ^ "USB-IF Compliance Updates". compliance.usb.org. USB-IF. Retrieved 18 August 2025.
- ^ "On-The-Go and Embedded Host Supplement to the USB 2.0 Specification, Revision 2.0 plus ECN and errata". USB.org. 14 July 2011. Archived from the original on 5 May 2012. Retrieved 18 July 2005.
- ^ Heise, Heinz. "USB-On-the-Go-Specification Settled". Heise.de.[dead link]
- ^ "On-The-Go and Embedded Host Supplement to the USB Revision 3.0 Specification, Revision 1.1". USB.org. May 10, 2012.
- ^ a b "Universal Serial Bus Revision 2.0 specification". On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification, Revision 2.0 version 1.1a. USB Implementers Forum, Inc. 27 July 2012. Retrieved 26 June 2017.
- ^ "Universal Serial Bus Revision 2.0 specification". Universal Serial Bus Micro-USB Cables and Connectors Specification, Revision 1.01. USB Implementers Forum, Inc. 4 April 2007. Retrieved 26 June 2017.
- ^ a b c d e "Battery Charging Specification". USB Implementers Forum, Inc. 15 April 2009. Archived from the original on 4 March 2016. Retrieved 23 September 2009.
- ^ "KB34983-Support for USB Embedded Host mode on BlackBerry 10 OS version 10.2". Archived from the original on 9 January 2020. Retrieved 12 November 2013.
- ^ "USB On the Go - HTC Blog". blog.htc.com. Archived from the original on 6 October 2014. Retrieved 30 September 2014.
- ^ "Samsung Galaxy S II Able To Use Standard USB OTG Cable For USB On-The-Go Access - TalkAndroid.com". www.talkandroid.com. 13 May 2011. Archived from the original on 10 September 2022. Retrieved 11 September 2013.
- ^ "Xperia S USB OTG demonstrated [Video] - Xperia Blog". www.xperiablog.net. 9 March 2012. Archived from the original on 5 September 2013. Retrieved 11 September 2013.
- ^ "Android Issue 738: I hope Android will implement and support the USB host feature". 30 May 2008. Archived from the original on 9 June 2013. Retrieved 30 May 2013.
- ^ "USB Host – Android Developers". developer.android.com. 30 May 2013. Archived from the original on 30 September 2011. Retrieved 30 May 2013.
- ^ http://www.gsmarena.com/ Archived 16 September 2017 at the Wayback Machine GSMArena
- ^ http://pdadb.net Archived 10 August 2006 at the Wayback Machine PDAdb.net
- ^ "Are Micro A USB plugs actually ever used?". Electrical Engineering Stack Exchange. Archived from the original on 10 September 2022. Retrieved 13 August 2020.
External links
[edit]- Official website
- "USB OTG Flash Drives". Kingston.
- Broida, Rick (5 February 2014). "How to tell if your Android phone or tablet supports USB On-The-Go". CNet.
Refers to two apps, to verify OTG compatibility, and to overcome (root) and enable OTG
USB On-The-Go
View on GrokipediaOverview and History
Definition and Purpose
USB On-The-Go (USB OTG) is a supplement to the USB 2.0 specification (and subsequent versions) that enables portable electronic devices to dynamically switch between host and peripheral roles in a USB connection.[1] Introduced in 2001 by the USB Implementers Forum (USB-IF), it extends the standard USB architecture to support flexible connectivity without relying on a traditional PC as the host.[3] This allows battery-powered devices, such as smartphones and tablets, to initiate and manage USB communications directly.[1] The primary purpose of USB OTG is to facilitate the connection and control of USB peripherals by mobile devices, eliminating the need for intermediary hardware like a computer.[1] For instance, a smartphone can function as a host to interface with devices like keyboards, flash drives, or digital cameras, enabling data transfer, input, or storage expansion on the go.[4] By supporting this host capability in compact, power-constrained devices, OTG reduces hardware requirements and enhances usability for users in mobile scenarios.[5] Key benefits of USB OTG include improved portability and convenience, as it allows seamless integration of peripherals into everyday mobile workflows without bulky adapters or dedicated hosts.[1] It also enables peer-to-peer connections between compatible devices, such as direct file sharing between two smartphones, fostering more versatile and efficient device ecosystems.[6] At its core, the operational principle involves a single USB port on each device that can handle both upstream (as a peripheral) and downstream (as a host) connections, with role detection managed through electrical signaling to determine the active host.[2]Development History
The development of USB On-The-Go (OTG) began in 2001 as a supplement to the USB 2.0 specification, aimed at overcoming limitations in mobile device connectivity by enabling direct peer-to-peer communication between portable devices without requiring a traditional PC host.[6] This initiative was driven by the USB Implementers Forum (USB-IF), which coordinated efforts among industry stakeholders to address the growing demand for flexible USB roles in emerging mobile electronics.[7] The USB OTG 1.0 specification was released in December 2001, marking the formal introduction of features like dual-role device capability, session request protocol, and host negotiation protocol to support on-the-go scenarios.[6] Key input came from device manufacturers such as Nokia and Palm, who contributed to the working group alongside other members including Intel, Microsoft, Motorola, and Texas Instruments, ensuring the standard met the needs of portable computing and communication devices.[7] Subsequent revisions refined these capabilities; for instance, version 1.3, released on December 5, 2006, incorporated errata and clarifications to improve interoperability and compatibility with USB 2.0 ecosystems.[8] As USB technology advanced toward higher speeds, OTG evolved to integrate with SuperSpeed capabilities. The On-The-Go and Embedded Host Supplement to the USB 3.0 specification, version 1.0, was issued on July 1, 2011, extending OTG functionality to support up to 5 Gbit/s data rates while maintaining backward compatibility with USB 2.0 OTG devices.[2] However, adoption of these higher-speed OTG implementations lagged due to hardware constraints in early mobile devices, such as limited pin support and power management challenges. Market dynamics played a pivotal role in OTG's trajectory, with the rise of smartphones in the mid-2000s—exemplified by devices offering internet browsing, email, and multimedia—creating a strong impetus for direct device interconnectivity.[9] By 2010, as smartphones became ubiquitous, OTG saw widespread implementation in mobile platforms, particularly Android ecosystems, facilitating features like peripheral attachments and file transfers on the go.[10]Technical Specifications
Standard Versions
The USB On-The-Go (OTG) specification originated as a supplement to the USB 2.0 standard, with its initial version, OTG 1.0, released on December 18, 2001, by the USB Implementers Forum (USB-IF).[6] This version introduced core features for enabling dual-role functionality in portable devices, including the use of an ID pin on Mini-B connectors to detect and switch between host and peripheral roles without requiring additional hardware. It supported low-speed, full-speed, and high-speed USB 2.0 operations at up to 480 Mbps, focusing on power-efficient session management for battery-powered gadgets. In 2006, OTG 1.3 was released on December 5, refining protocols from the prior version while remaining a supplement to USB 2.0.[8] Key additions included enhanced support for the Session Request Protocol (SRP), which allows a peripheral to request the host to initiate a session for power conservation, and improvements to the Host Negotiation Protocol (HNP) for smoother role switching between connected devices.[8] These refinements addressed interoperability issues and better managed power states, ensuring more reliable operation in embedded systems.[11] The specification advanced to OTG 2.0 in July 2011, as the On-The-Go and Embedded Host Supplement to the USB 2.0 Specification, maintaining backward compatibility with earlier OTG implementations. This version enhanced dual-role and embedded host features for USB 2.0, emphasizing dynamic role detection and power negotiation, though limited to 480 Mbps due to USB 2.0 constraints. In May 2012, the OTG and Embedded Host Supplement to the USB 3.0 Specification (Revision 1.1) was released, extending OTG capabilities to SuperSpeed rates up to 5 Gbit/s.[2] It introduced the Role Swap Protocol (RSP) for role negotiation at SuperSpeed and defined new classes such as SuperSpeed OTG (SS-OTG) and SuperSpeed Peripheral Capable OTG (SSPC-OTG), while supporting backward compatibility with USB 2.0 OTG. Subsequent developments integrated OTG principles into broader USB standards rather than standalone revisions. The USB 3.1 Gen 2 specification, released in July 2013, incorporated enhanced role-switching mechanisms compatible with OTG for SuperSpeed+ operations at 10 Gbps, leveraging USB Type-C connectors for improved flexibility. Similarly, the USB 3.2 specification, finalized in September 2017, extended multi-lane configurations to support OTG-like dual-role ports at up to 20 Gbps, focusing on cable assemblies and protocol efficiency. As of 2025, the USB-IF maintains the OTG specifications without issuing major new standalone revisions, having ceased certification for version 1.3 after December 31, 2011, and prioritizing OTG 2.0 compliance.[11] Development emphasis has shifted to embedded OTG features within the USB4 specification, released in August 2019 and updated to version 2.0 in October 2022, which natively supports asymmetric dual-role ports and tunneling protocols for up to 120 Gbps in USB Type-C ecosystems.Electrical and Power Specifications
USB On-The-Go (OTG) operates on a standard 5 V bus power supply, with specific voltage thresholds defined for session validity and device operation to ensure compatibility with portable, battery-powered implementations. The VBUS line, which carries the power, must be driven by the A-device (host) to a minimum of 4.4 V under loads up to 100 mA, rising to 4.75 V for higher loads, with an upper limit of 5.25 V; session validity for the A-device is maintained between 0.8 V and 2.0 V, while for the B-device (peripheral), it extends to 4.0 V, ending below 0.8 V.[12] These tolerances accommodate variations in portable devices, including a rise time of no more than 100 ms for VBUS when activating a session under a 10 µF load, and a minimum input impedance of 40 kΩ on unpowered A-devices to prevent excessive leakage.[12][5] Current limits in OTG prioritize low-power operation to extend battery life, with the A-device required to supply at least 8 mA at 4.4 V to support session detection via the Session Request Protocol (SRP), though full host operation aligns with USB 2.0 standards allowing up to 100 mA for unconfigured peripherals and 500 mA for configured ones. B-devices, when unconfigured, are restricted to drawing no more than 150 µA (averaged over 1 ms) if dual-role capable or 8 mA if peripheral-only, ensuring minimal drain during idle states.[12][5][13] Power budgeting occurs through protocol negotiations, where the B-device can initiate a session by pulsing VBUS or data lines to request power without constant supply, and the A-device may discharge VBUS through a minimum 656 Ω resistance to end sessions efficiently; dual-role devices maintain a VBUS decoupling capacitance between 1.0 µF and 6.5 µF to stabilize transients. Core OTG does not support advanced high-power delivery like USB Power Delivery, focusing instead on these constrained profiles.[12][5][14] The ID pin facilitates role detection and grounding, with a resistance of less than 10 Ω to ground on Mini-A plugs to signal host mode, and greater than 100 kΩ (typically floating) on Mini-B plugs for peripheral mode, enabling automatic switching without software intervention in many cases.[12][13] Signal integrity is maintained through requirements like data line pull-down resistors of 14.25 kΩ to 24.8 kΩ and leakage voltages below 0.342 V, with B-devices tolerating VBUS transients up to 400 mV at slew rates under 100 mA/µs to prevent disruption during connections. Battery charging in OTG builds on USB Battery Charging 1.2 support in revisions like OTG 2.0, permitting up to 1.5 A when the device acts as a peripheral (B-role), though operation emphasizes low-power modes—such as suspending VBUS after inactivity—to minimize thermal load and efficiency losses during role switches.[12][5][2]| Parameter | Symbol | Min | Max | Units | Notes |
|---|---|---|---|---|---|
| VBUS Output (A-Device, 0-100 mA) | V_A_VBUS_OUT | 4.4 | 5.25 | V | Standard bus power |
| VBUS Output (A-Device, >100 mA) | V_A_VBUS_OUT | 4.75 | 5.25 | V | Configured operation |
| A-Device Session Valid | V_A_SESS_VLD | 0.8 | 2.0 | V | For SRP detection |
| B-Device Session Valid | V_B_SESS_VLD | 0.8 | 4.0 | V | Full peripheral support |
| A-Device Output Current | I_A_VBUS_OUT | 8 | - | mA | Minimum for host mode |
| B-Device Unconfigured Current (Dual-Role) | I_B_SRP | - | 150 | µA | 1 ms average |
| ID Pin Resistance (Mini-A) | R_ID | - | 10 | Ω | Grounded for host |
| ID Pin Resistance (Mini-B) | R_ID | 100k | - | Ω | Floating for peripheral |
Protocols and Functionality
Communication Protocols
USB On-The-Go (OTG) introduces specific communication protocols that extend the standard USB framework to enable dual-role functionality, allowing devices to dynamically negotiate and switch between host and peripheral roles without requiring a dedicated PC host. These protocols build upon USB 2.0 packet structures while adding OTG-specific mechanisms for role management and session control, ensuring efficient connection establishment and maintenance in peer-to-peer scenarios.[2] The Host Negotiation Protocol (HNP) enables the transfer of the host role from the A-device (initial host) to the B-device (initial peripheral) during an active session, facilitating dynamic role switching without disconnecting the cable. To initiate HNP, the current host suspends the bus and sets the b_hnp_enable feature using a SET_FEATURE request; the peripheral then detects the suspend and signals a disconnect by driving SE0 (single-ended zero) for a short period, after which the former host enables its D+ pull-up within a maximum of 3 ms to assume the peripheral role. The new host must then assert a bus reset within 1 ms to complete the swap, ensuring seamless transition. HNP support is indicated in the OTG descriptor's bmAttributes field, where the hnp_support bit (bit 1) signals capability during enumeration. This protocol is limited to high-speed and full-speed operations and requires both devices to support it for successful negotiation.[12] Complementing HNP, the Session Request Protocol (SRP) allows a B-device to request the activation of VBUS power from the A-device, enabling a new communication session without constant power consumption by the peripheral. SRP operates when the bus is idle (SE0 state) and VBUS is below the session valid threshold; the B-device initiates by either pulsing the data line (enabling D+ pull-up for 5-10 ms) or pulsing VBUS (driving it to 2.1-5.25 V with up to 8 mA current). The A-device detects this signal and must respond by turning on VBUS within a maximum of 30 seconds; failure to respond prompts the B-device to retry after a 5-second minimum wait. SRP capability is flagged in the OTG descriptor via the srp_support bit (bit 0), and it supports both data-line and VBUS pulsing methods depending on device hardware. This protocol reduces power draw in battery-operated devices by keeping VBUS off during idle periods.[12] The default connection sequence in OTG relies on the ID pin in the Mini-AB or Micro-AB receptacle to initially assign roles upon cable insertion, providing a plug-and-play mechanism for role detection. When a Mini-A or Micro-A plug is inserted, the ID pin is grounded (resistance <10 Ω), signaling the device to become the A-device (host), which then enables VBUS and its D+ pull-up. Conversely, a Mini-B or Micro-B plug leaves the ID pin open (resistance >100 kΩ), designating the device as the B-device (peripheral), which enables its D- pull-up and waits for VBUS. This resistance-based detection triggers state machines in both devices to enter appropriate idle or peripheral/host modes, initiating enumeration once VBUS is valid. The sequence ensures automatic role assignment based on cable orientation, with no software intervention required at connection time.[12] OTG incorporates robust error handling within these protocols to manage timeouts, resets, and enumeration issues, maintaining link reliability in dynamic environments. For SRP, timeouts include a 30-second maximum response window (T_A_SRP_RSPNS) for the A-device and a 5-second failure retry interval (T_B_SRP_FAIL) for the B-device; exceeding these leads to session abandonment and state transitions to idle. HNP errors, such as failure to detect role swap signals, trigger bus resets or disconnects, with the B-device interpreting prolonged SE0 (>3.125 ms) as a reset signal. During enumeration, if an OTG device lacks required capabilities (e.g., no HNP support indicated in the descriptor), the host may STALL requests or display user prompts, transitioning to error states like a_wait_bcon_timeout after 100-200 ms without connection activity. These mechanisms use standard USB reset signaling (SE0 for at least 3 ms at full-speed) extended with OTG-specific timers to recover from failures without full reconnection.[12] At the packet level, OTG protocols extend standard USB 2.0 packets with dedicated descriptors and control requests to advertise and manage role support. The OTG descriptor, a 3-byte class-specific configuration descriptor (bDescriptorType=9), includes bmAttributes to denote SRP and HNP capabilities, placed after the interface descriptors during enumeration. Key requests include SET_FEATURE with b_hnp_enable (selector 3) to activate HNP on the peripheral and a_hnp_support (selector 4) on the host, both using standard USB control transfers over endpoint zero. These extensions ensure that OTG devices can query and enable dual-role features transparently, with failures handled via STALL responses on unsupported requests. In later revisions like USB 3.0 OTG, additional notifications such as Device Notification packets with Role Swap Protocol phases further refine these mechanisms, but the core packet structures remain backward-compatible with USB 2.0.[12][2]Role Switching and Device Classes
In USB On-The-Go (OTG), devices assume distinct roles to facilitate dynamic connectivity without dedicated hosts. The A-device serves as the initial host, supplying power to the VBUS line (typically up to 500 mA at 5 V) and managing bus operations, while the B-device operates as the peripheral, drawing power and responding to host commands. Dual-role devices (DRDs) incorporate capabilities for both roles, connecting via a Mini-AB or Micro-AB receptacle that determines the initial role based on the cable's ID pin orientation. Role switching occurs primarily through the Host Negotiation Protocol (HNP), initiated after the initial connection and enumeration. Once the A-device enables HNP via the SetFeature(b_hnp_enable) request and suspends the bus, the B-device can request the host role by disconnecting and reconnecting, prompting the original A-device to transition to peripheral mode within a defined timeout (e.g., 3 ms acknowledgment). This process allows peripherals to temporarily act as hosts for specific tasks, such as data transfer between peer devices, before reverting roles. The Session Request Protocol (SRP) complements HNP by enabling a powered-off B-device to signal the A-device to activate VBUS, using techniques like data-line or VBUS pulsing. OTG implementations support standard USB device classes through a vendor-defined Targeted Peripheral List (TPL), which specifies compatible peripherals to ensure reliable operation in resource-constrained embedded hosts. Common supported classes include Mass Storage Class (MSC) for USB drives, Human Interface Device (HID) for keyboards and mice, Printer Class for printing functions, and Audio Class for basic audio devices. High-bandwidth classes, such as Video Class, face limitations due to OTG's focus on low-power, full-speed operations and restricted host buffering, often requiring specialized implementations.[6] The Dual-Role Device (DRD) concept, refined in revisions beyond the initial OTG 1.0a (such as the OTG and Embedded Host Supplement to USB 2.0), enables symmetric peer-to-peer connections between similar devices by supporting bidirectional role negotiation without fixed host-peripheral asymmetry. During enumeration, OTG devices advertise capabilities via the OTG descriptor (a three-byte structure in the configuration descriptor), indicating support for HNP (bit 1) and SRP (bit 0), along with other features like power budgeting. The host then configures the connection based on these descriptors, ensuring compatibility before enabling role switching.Hardware Components
Connectors and Plugs
USB On-The-Go (OTG) initially utilized Mini-USB connectors to enable dual-role functionality in portable devices. Introduced with the OTG supplement to the USB 2.0 specification in late 2001, these connectors incorporated a 5-pin Mini-B design, extending the standard 4-pin USB configuration with an additional ID pin for role detection. The Mini-A plug, intended for host mode, featured the ID pin shorted to ground with a resistance of less than 10 Ω, while the Mini-B plug left the ID pin floating with a resistance greater than 100 kΩ to signal peripheral mode. Devices typically employed a Mini-AB receptacle to accept either plug type, allowing dynamic role switching based on the connected cable end.[13] In 2007, the USB Implementers Forum (USB-IF) introduced Micro-USB connectors for OTG applications, starting certification in December of that year to support more compact mobile devices. The Micro-AB receptacle became mandatory for consumer OTG products, capable of accepting both Micro-A and Micro-B plugs. Similar to the Mini design, the Micro-A plug shorted the ID pin to ground to indicate host mode, while the Micro-B plug kept it floating for peripheral operation. This evolution addressed the need for smaller form factors in smartphones and accessories, replacing the bulkier Mini connectors in new designs.[11] The pin assignments for both Mini and Micro OTG connectors follow a consistent layout to maintain compatibility with standard USB signaling while adding role detection. Pin 1 carries VBUS for power delivery, pins 2 and 3 handle differential data lines D- and D+ respectively, pin 5 provides ground (GND), and pin 4 serves as the ID pin for OTG-specific functionality. Role detection relies on resistance measurements at the ID pin: OTG devices incorporate a 200 kΩ pull-up resistor from ID to VBUS, resulting in a low voltage (near ground) when shorted (host mode) or a high voltage (near VBUS) when floating (peripheral mode). This simple resistive scheme enables the connected device to automatically assume the appropriate role without software intervention.[5]| Pin | Name | Function | Typical Wire Color |
|---|---|---|---|
| 1 | VBUS | +5V Power Supply | Red |
| 2 | D- | Data - (Negative) | White |
| 3 | D+ | Data + (Positive) | Green |
| 4 | ID | Identification/Role Detect | N/A (internal) |
| 5 | GND | Ground | Black |
