
M451
May. 4, 2018
Page
846
of
1006
Rev.2.08
M4
51
S
E
RI
E
S
T
E
CH
NICA
L RE
F
E
R
E
NC
E
M
A
NU
A
L
6.19.3 Block Diagram
USB PHY
USB VBUS
Power
Switch
OTG Registers
Host_Device
Mux
Host 1.1
Controller
Device
2.0 FS
Controller
Enable
Status
OTG Controller
APB
USB_VDD33_CAP
USB_D+
USB_VBUS_EN
USB_VBUS_ST
USB_D-
USB_VBUS
USB_ID
USB 3.3V LDO
LDO33EN (SYS_USBPHY[8])
USBROLE (SYS_USBPHY[1:0])
OTG State
Machine
Figure 6.19-1 USB OTG Block Diagram
6.19.4 Basic Configuration
The OTG peripheral clock can be enabled by OTGCKEN (CLK_APBCLK0[26]). The role of USB frame
is determined by USBROLE (SYS_USBPHY[1:0]). The internal USB 3.3V LDO can be enabled by
LDO33EN (SYS_USBPHY[8]). These two configurations are write-protection bits. Before writing to
these bits, user must disable the register protection function. Refer to the description of
SYS_REGLCTL register for details. USB_VBUS_EN and USB_VBUS_ST pin functions are configured
in SYS_GPA_MFPL or SYS_GPC_MFPL registers.
6.19.5 Functional Description
The role of USB frame depends on the setting of USBROLE (SYS_USBPHY[1:0]) and USB_ID pin
status. The USBROLE configuration has precedence over USB_ID pin status. User can configure the
OTG controller to USB Host mode, USB Device mode, ID dependent mode or OTG Device mode. In
USB Host mode, the host controller will interact with USB PHY directly. In USB Device mode, the
device controller will interact with USB PHY directly. In these cases, the OTG controller is used simply
as a multiplexer. In ID dependent mode, USB_ID pin status will decide USB frame to act as USB host
or USB device. If the USB_ID pin is FALSE state (low level), USB frame will act as USB host. If the
USB_ID pin is TRUE state (high level), USB frame will act as USB device. In OTG Device mode, the
OTG controller will handle OTG HNP and SRP protocols. If the USB_ID pin is FALSE state (low level),
the OTG controller will act as an OTG A-device. If the USB_ID pin is TRUE state (high level), the OTG
controller will act as an OTG B-device.
The Role of USB Frame
6.19.5.1
USB Device Mode
When USBROLE (SYS_USBPHY[1:0]) is set to 0, USB frame acts as USB device. USB host function
is not available.