Universal Serial Bus OTG Controller
UG0331 User Guide Revision 15.0
292
Figure 142 •
Basic USB Flow Diagram when USB Controller is in Host Mode
10.2.3.1.2 USB Device/Peripheral Mode
In this mode, the USB OTG controller acts as a USB device, and device functionality are defined by the
standard- class- specific or vendor- specific- class firmware and application implementations. In this
mode, the USB controller; along with associated firmware, class drivers, and application code, responds
to the USB commands sent by the USB host that is connected.
The USB controller allows its connection to the USB bus to be controlled by the software. When the USB
controller operates in Peripheral mode, the UTMI+-compliant PHY that is used alongside the USB
controller, can be switched between normal mode and non-driving mode by setting/clearing the Soft
Conn bit in
START
STOP
Initialization
1. Disable/initialize the Watchdog Timer
2. Configure the GPIO for keeping the PHY out of reset
3. Register the callback functions and ISRs
4. Clear and enable the interrupts
5. In this mode USB OTG microA receptacle on board
is connected to PHY. With this the USB controller
will be working as USB Host
.
Wait for the device connection
interrupt
Enumerates the connected device
Device
Connected ?
ON
Host supports the
device class?
ON
Class specific and application
code execution
START
ISR to handle the USB interrupts in
Host mode
1. Connect/disconnect interrupt
2. Endpoint 0 interrupt
3. TX Endpoint interrupt
4. RX Endpoint interrupt
STOP
YES
YES