![GigaDevice Semiconductor GD32F20 Series User Manual Download Page 877](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801877.webp)
GD32F20x User Manual
877
they could be controlled by USBFS automatically according to the current mode (host, device
or OTG mode) and connection status. A typical connection is shown in
Connection with host or device mode.
Figure 28-2. Connection with host or device mode
VBUS
DM
DP
DP
DM
VBUS
5V Power
Supply
(needed in
host mode)
VDD
U
S
B
A
/B
c
o
n
n
ec
to
r
GPIO
USBFS
GND
When USBFS works in host mode (FHM bit is set and FDM bit is cleared), the VBUS is 5V
power supplied and detecting pin which is used for voltage detection is defined in USB
protocol. The internal PHY cannot supply 5V VBUS power and only has some voltage
comparers, charge and discharge circuits on VBUS line. Thus, if application needs VBUS
power, an external power supply IC is needed. The VBUS connection between USBFS and
the USB connector can be omitted in host mode, so USBFS doesn’t detect the voltage level
on VBUS pin and always assumes that the 5V power is present.
When USBFS works in device mode (FHM bit is cleared and FDM bit is set), the VBUS
detection circuit is configured by VBUSIG bit in USBFS_GCCFG register. So if the device
does not need to detect the voltage on VBUS pin, it could be configured by setting the
VBUSIG bit, then the VBUS pin can be freed for other uses. Otherwise, the VBUS connection
cannot be omitted, and USBFS continuously monitors the VBUS voltage. It will immediately
switch off the pull-up resistor on DP line once that the VBUS voltage falls below the needed
valid value, leading to a disconnection.
The OTG mode connection is described in the
Figure 28-3. Connection with OTG mode
When USBFS works in OTG mode, the FHM, FDM bits in USBFS_GUSBCS and VBUSIG bit
in USBFS_GCCFG should be cleared. In this mode, the USBFS needs all the four pins: DM,
DP, VBUS and ID, and needs to use several voltage comparers to monitor the voltage on
these pins. USBFS also contains VBUS charge and discharge circuits to perform SRP request
which is described in OTG protocol. The OTG A-Device or B-Device is decided by the level
of the ID pin. USBFS controls the pull-up or pull-down resistor during performing the HNP
protocol.
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...