![Texas Instruments AM1808 Technical Reference Manual Download Page 1612](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581612.webp)
Architecture
1612
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Serial Bus 2.0 (USB) Controller
34.2.7 USB Controller Host and Peripheral Modes Operation
The USB controller can be used in a range of different environments. It can be used as either a high-
speed or a full-speed USB peripheral device attached to a conventional USB host (such as a PC). It can
be used as either a host or a peripheral device in a point-to-point type of setup/arrangement or it can be
used as a host connecting to a range of peripheral devices in a multi-point setup (that is, using a hub).
The USB2.0 controller role adaptation of a host or peripheral (device) is dependent upon the state of the
USB0_ID pin on its mini-AB receptacle. If the USB0_ID pin state is not driven by the connector or is left
floating, the USB2.0 controller would assume the role of a peripheral; if the USB0_ID pin state is driven
low or is grounded, the USB2.0 controller would assume the role of a host. The state of the USB ID pin is
controlled by the type of USB plug attached to the mini-AB connector. A mini/micro-B plug (peripheral)
would leave the USB0_ID pin floating and a mini/micro-A plug (host) grounds the USB0_ID pin low. The
procedure for the USB2.0 controller determining its operating modes (role of a host or a peripheral) starts
when the USB 2.0 controller is in session. The USB 2.0 controller is in session when either it senses a
voltage on the USB0_VBUS pin or when the firmware sets the DEVCTL[SESSION] bit.
Usually, the firmware sets the SESSION bit, when it assumes that it will be operating as a host. When the
SESSION bit is set, the controller will start sensing the state of the USB0_ID pin. If the USB0_ID pin has
been grounded low, then the USB2.0 controller will assume the role of a host; however, if the USB0_ID
pin is left floating, then the USB2.0 controller will assume the role of a device. Upon determining its role as
a host, it will drive the USB0_DRVVBUS pin high to enable the external power logic so that it start
sourcing the required 5V power (must be
≥
4.75V). The USB2.0 controller will then wait to for the voltage
of the USB0_VBUS goes high. If it does not see the power on the USB0_VBUS pin greater than Vbus
Valid (4.4V), it will generate an interrupt to the user indicating the existence of a problem. Assuming that
the voltage level of the USB0_VBUS is found to be above Vbus Valid, then the USB 2.0 controller will wait
for a device to connect, that is, for it to see one of its data lines USB0_DP/DM to be pulled high.
When assuming the role of a peripheral, assuming that the firmware has set the POWER[SOFTCONN] bit
and has enabled the data lines and there is an external host sourcing power on the USB0_VBUS line, the
USB2.0 controller will transition to session when it sees power (must be greater or equal to 4.01V) on the
USB0_VBUS pin. The USB 2.0 controller will then set the SESSION bit upon detecting the power on the
USB0_VBUS line. This will force the USB2.0 controller to sense the state of the USB0_ID pin. If the
USB0_ID pin has been left floating, it will know that it has to assume the role of a device and will enable
its 1.5 kohm pull-up resistor to signify to the attached external host that it is a Full-Speed device. Note that
even when operating as a High-Speed; it has to first come up as Full-Speed. The USB2.0 controller will
then await for a reset signal from the host.
The USB controller interrupts the CPU on completion of the data transfer on any of the endpoints or on
detecting reset, resume, suspend, connect, disconnect, or SOF on the bus.
When the CPU is interrupted with a USB interrupt, it needs to read the interrupt status register to
determine the endpoints that have caused the interrupt and jump to the appropriate routine. If multiple
endpoints have caused the interrupt, endpoint 0 should be serviced first, followed by the other endpoints.
The suspend interrupt should be serviced last.
The flowchart in
describes the interrupt service routine for the USB module.
The following sections describe the programming of USB controller in Peripheral mode and Host mode.
DMA operations and interrupt handler mechanisms are common to both peripheral and host mode
operations and are discussed after the programming in peripheral and Host mode.