AN050
GD32 USBFS&USBHS Firmware Library User Guide
52
Figure 6-2. Control VBUS by Logic Chip Circuit
GND
1
GND
2
CPEN
3
VBUS
4
ID
5
VDD3.3
6
DP
7
DM
8
RESET
9
EXTVBUS
10
NXT
11
DIR
12
STP
13
CLKOUT
14
VDD1.8
15
VDD3.3
16
D7
17
D6
18
D5
19
D4
20
D3
21
D2
22
D1
23
D0
24
VDD3.3
25
VDD1.8
26
XO
27
XI
28
VDDA1.8
29
VDD3.3
30
REG_EN
31
RBIAS
32
GNDPAD
33
U13
USB3300-EZK
R98
10K
Ω
R111 12K
Ω
GND
VBUS
1
DM
2
DP
3
ID
4
GND
5
Shield
6
U
SB
_
Mi
ni
A
B
rec
ep
tac
le
CN3
Mini_USB
R114
1M
Ω
C70
50V/4.7nF
GND
GND
R112
820
Ω
+5V
GND
C64
50V/0.1uF
C65
50V/0.1uF
C66
50V/0.1uF
C67
50V/0.1uF
GND
+3V3
E13
16V/4.7uF,AVX
E12
16V/4.7uF,AVX
C71
50V/0.1uF
GND
C69
50V/0.1uF
GND
GND
R116
10K
Ω
GND
ENA
1
FLGA
2
FLGB
3
ENB
4
OUTB
5
GND
6
IN
7
OUTA
8
U12
SP2526A-1EN
+3V3
LED6
LED RED
R99
470
Ω
R100
10K
Ω
GND
C63
50V/0.1uF
E11
16V/10uF,AVX
VBUS_HS_5V
PD13
VBUS_FS_5V
R96
10K
Ω
GND
R97
10K
Ω
ENA an d ENB activ e HIGH
As shown in
Figure 6-2. Control VBUS by Logic Chip Circuit
, PD13 is configured to be
GPIO push pull output mode(PP).
Enable USB VBUS output 5V: PD13 output high voltage(1)
Disable USB VBUS output 5V: PD13 output low voltage(0)
6.3.
Interrupt handling
USBFS host interface global interrupt is shown in
Table 6-3. USBFS host interrupt
, every
interrupt flag corresponds to one interrupt handler item, such as RXFNEIF, NPTXFEIF and
PTXFEIF flag. In USBFS host interface, receiving data is based on RXFNEIF interrupt flag,
sending data is based on NPTXFEIF and PTXFEIF interrupt flag.
Table 6-3
. USBFS host interrupt
Interrupt Flag
Description
Operation Mode
WKUPIF
Wakeup interrupt
Host or device mode
SEIF
Session interrupt
Host or device mode
DISCIF
Disconnect interrupt flag
Host Mode
IDPSC
ID pin status change
Host or device mode
LPMIF
LPM interrupt flag
Host or device mode
PTXFEIF
Periodic Tx FIFO empty interrupt flag
Host Mode