Functional Description
1674
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Universal Serial Bus (USB) Controller
27.3 Functional Description
The USB controller provides full OTG negotiation by supporting both the Session Request Protocol (SRP)
and the Host Negotiation Protocol (HNP). The session request protocol allows devices on the B side of a
cable to request the A side device turn on VBUS. The host negotiation protocol is used after the initial
session request protocol has powered the bus and provides a method to determine which end of the cable
will act as the host controller. When the device is connected to non-OTG peripherals or devices, the
controller can detect which cable end was used and provides a register to indicate if the controller should
act as the host or the device controller. This indication and the mode of operation are handled
automatically by the USB controller. This auto-detection allows the system to use a single A/B connector
instead of having both A and B connectors in the system and supports full OTG negotiations with other
OTG devices.
In addition, the USB controller provides support for connecting to non-OTG peripherals or host controllers.
The USB controller can be configured to act as either a dedicated host or device, in which case, the
USB0VBUS and USB0ID signals can be used as GPIOs or any corresponding alternate functions.
However, when the USB controller is acting as a self-powered device, a GPIO input or analog comparator
input must be connected to VBUS and configured to generate an interrupt when the VBUS level drops.
This interrupt is used to disable the pullup resistor on the USB0DP signal.
NOTE:
When the USB module is in operation, MOSC must be the clock source, either with or
without using the PLL, and the system clock must be at least 30 MHz.
27.3.1 Operation as a Device
This section describes the USB controller when it is being used as a USB device. Before the USB
controller's operating mode is changed from device to host or host to device, software must reset the USB
controller by setting the USB0 bit in the USB Software Reset (SRUSB) register. IN endpoints, OUT
endpoints, entry into and exit from SUSPEND mode, and recognition of Start of Frame (SOF) are all
described.
When in device mode, IN transactions are controlled by an endpoint's transmit interface and use the
transmit endpoint registers for the given endpoint. OUT transactions are handled with an endpoint's
receive interface and use the receive endpoint registers for the given endpoint.
When configuring the size of the FIFOs for endpoints, take into account the maximum packet size for an
endpoint.
•
Bulk
Bulk endpoints should be the size of the maximum packet (up to 64 bytes) or twice the maximum
packet size if double buffering is used (described further in the following section).
•
Interrupt
Interrupt endpoints should be the size of the maximum packet (up to 64 bytes) or twice the maximum
packet size if double buffering is used.
•
Isochronous
Isochronous endpoints are more flexible and can be up to 1023 bytes.
•
Control
It is also possible to specify a separate control endpoint for a USB device. However, in most cases the
USB device should use the dedicated control endpoint on the USB controller's endpoint 0.
27.3.1.1 Endpoints
When operating as a device, the USB controller provides two dedicated control endpoints (IN and OUT)
and 14 configurable endpoints (seven IN and seven OUT) that can be used for communications with a
host controller. The endpoint number and direction associated with an endpoint is directly related to its
register designation. For example, when the host is transmitting to endpoint 1, all configuration and data is
in the endpoint 1 transmit register interface.