USB On-The-Go - Protocols

Protocols

The USB On-The-Go and Embedded Host Supplement to the USB 2.0 specification introduced three new protocols, Attach Detection Protocol (ADP), Session Request Protocol (SRP) and Host Negotiation Protocol (HNP).

  • ADP allows an OTG device, Embedded host or USB device to determine attachment status in the absence of power on the USB bus. This enables both insertion based behavior and the possibility for a device to display attachment status. It does this 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 change in capacitance, large enough to indicate device attachment is detected then an A-device will provide power to the USB bus and look for device connection. A B-device will generate SRP and wait for the USB bus to become powered.
  • 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) asks it to start delivering power. OTG and Embedded 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/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 the idea of HNP polling whereby the device in host role 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 a host for a particular camera, since it doesn't 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, making the camera the host to the printer so that the user's pictures will get printed without juggling cables. These new OTG protocols cannot pass through a standard USB hub since they are based on physical electrical-signaling.

The USB On-The-Go and Embedded Host Supplement to the USB 3.0 specification introduces an additional protocol, Role Swap Protocol (RSP). This 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 On-The-Go 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.

Read more about this topic:  USB On-The-Go