Functional Description
1683
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Universal Serial Bus (USB) Controller
If the USB OTG controller is the A device, then the USB OTG controller enters host mode (the A device is
always the default host), turns on VBUS, and waits for VBUS to go above the VBUS Valid threshold, as
indicated by the VBUS bit in the USBDEVCTL register going to 0x3. The USB OTG controller then waits
for a peripheral to be connected. When a peripheral is detected, a Connect interrupt is signaled and either
the FSDEV or LSDEV bit in the USBDEVCTL register is set, depending whether a full-speed or a low-
speed peripheral is detected. The USB controller then issues a RESET to the connected device. The
SESSION bit in the USBDEVCTL register can be cleared to end a session. The USB OTG controller also
automatically ends the session if babble is detected or if VBUS drops below session valid.
NOTE:
The USB OTG controller may not remain in host mode when connected to high-current
devices. Some devices draw enough current to momentarily drop VBUS below the VBUS-
valid level causing the controller to drop out of host mode. The only way to get back into host
mode is to allow VBUS to go below the Session End level. In this situation, the device is
causing VBUS to drop repeatedly and pull VBUS back low the next time VBUS is enabled.
In addition, the USB OTG controller may not remain in host mode when a device is told that
it can start using it's active configuration. At this point the device starts drawing more current
and can also drop VBUS below VBUS valid.
If the USB OTG controller is the B device, then the USB OTG controller requests a session using the
session request protocol defined in the USB On-The-Go supplement, that is, it first discharges VBUS.
Then when VBUS has gone below the Session End threshold (VBUS bit in the USBDEVCTL register goes
to 0x0) and the line state has been a single-ended zero for > 2 ms, the USB OTG controller pulses the
data line, then pulses VBUS. At the end of the session, the SESSION bit is cleared either by the USB
OTG controller or by the application software. The USB OTG controller then causes the PHY to switch out
the pullup resistor on D+, signaling the A device to end the session.
27.3.3.2 Detecting Activity
When the other device of the OTG setup wishes to start a session, it either raises VBUS above the
Session Valid threshold if it is the A device, or if it is the B device, it pulses the data line then pulses
VBUS. Depending on which of these actions happens, the USB controller can determine whether it is the
A device or the B device in the current setup and act accordingly. If VBUS is raised above the Session
Valid threshold, then the USB controller is the B device. The USB controller sets the SESSION bit in the
USBDEVCTL register. When RESET signaling is detected on the bus, a RESET interrupt is signaled,
which is interpreted as the start of a session.
The USB controller is in device mode as the B device is the default mode. At the end of the session, the A
device turns off the power to VBUS. When VBUS drops below the Session Valid threshold, the USB
controller detects this drop and clears the SESSION bit to indicate that the session has ended, causing a
disconnect interrupt to be signaled. If data line and VBUS pulsing is detected, then the USB controller is
the A device. The controller generates a SESSION REQUEST interrupt to indicate that the B device is
requesting a session. The SESSION bit in the USBDEVCTL register must be set to start a session.
27.3.3.3 Host Negotiation
When the USB controller is the A device, ID is Low, and the controller automatically enters host mode
when a session starts. When the USB controller is the B device, ID is High, and the controller
automatically enters device mode when a session starts. However, software can request that the USB
controller become the host by setting the HOSTREQ bit in the USBDEVCTL register. This bit can be set
either at the same time as requesting a Session Start by setting the SESSION bit in the USBDEVCTL
register or at any time after a session has started. When the USB controller next enters SUSPEND mode
and if the HOSTREQ bit remains set, the controller enters host mode and begins host negotiation (as
specified in the USB On-The-Go supplement) by causing the PHY to disconnect the pullup resistor on the
D+ line, causing the A device to switch to device mode and connect its own pullup resistor. When the USB
controller detects this, a Connect interrupt is generated and the RESET bit in the USBPOWER register is
set to begin resetting the A device. The USB controller begins this reset sequence automatically to ensure
that RESET is started as required within 1 ms of the A device connecting its pullup resistor. The main
processor should wait at least 20 ms, then clear the RESET bit and enumerate the A device.