USB On-The-Go
USB On-The-Go (USB OTG) is a supplement to the Universal Serial Bus (USB) specification that enables portable devices and non-PC hosts to implement targeted host functionality, allowing direct connections to USB peripherals and other OTG devices without requiring a personal computer.[1] Introduced in 2001 as an extension to the USB 2.0 specification, OTG defines dual-role devices (DRDs) capable of operating as either a host or a peripheral, with role switching facilitated by the Host Negotiation Protocol (HNP) to support dynamic connections.[2] These devices typically use a Micro-AB receptacle connector, which allows automatic role detection based on the cable's orientation, and support low-speed, full-speed, and high-speed USB operations while incorporating power-saving features to extend battery life in mobile applications.[1][2] In 2012, the OTG and Embedded Host Supplement for USB 3.0 (Revision 1.1) extended these capabilities to SuperSpeed rates up to 5 Gbit/s, introducing the Role Swap Protocol (RSP) for seamless role negotiation at higher speeds and defining new device classes such as SuperSpeed OTG (SS-OTG) and SuperSpeed Peripheral Capable OTG (SSPC-OTG).[2] Key concepts include the A-device (default host) and B-device (default peripheral) roles, along with mechanisms like the Targeted Peripheral List (TPL) to specify supported peripherals, ensuring efficient and standardized interoperability in embedded and portable systems.[2]Overview 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 |