English
Language : 

LM3S5D91 Datasheet, PDF (930/1340 Pages) Texas Instruments – Stellaris® LM3S5D91 Microcontroller
Universal Serial Bus (USB) Controller
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 pull-up resistor on D+, signaling the A device to end the
session.
18.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.
18.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 pull-up resistor on the D+ line, causing the A device to switch to Device mode and
connect its own pull-up 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 pull-up resistor. The main processor should wait at least
20 ms, then clear the RESET bit and enumerate the A device.
When the USB OTG controller B device has finished using the bus, the USB controller goes into
SUSPEND mode by setting the SUSPEND bit in the USBPOWER register. The A device detects this
and either terminates the session or reverts to Host mode. If the A device is USB OTG controller,
it generates a Disconnect interrupt.
930
January 22, 2012
Texas Instruments-Production Data