Section 20 USB Function Module
Rev. 4.00 Sep. 14, 2005 Page 777 of 982
REJ09B0023-0400
USB function
Application
IN token reception
Data transmission to host
Clear EP2 transfer
request flag
(USBIFR0/EP2 TR = 0)
Enable EP2 FIFO
empty interrupt
(USBIER0/EP2 EMPTY = 1)
USBIER0/EP2 EMPTY
interrupt
Write one packet of data
to USBEP2 data register
(USBEPDR2)
Write 1 to EP2 packet
enable bit
(USBTRG/EP2 PKTE = 1)
Set EP2
empty status
(USBIFR0/EP2
EMPTY = 1)
Valid data
in EP2 FIFO?
NACK
ACK
Interrupt request
Yes
No
Clear EP2 empty status
(USBIFR0/EP2 EMPTY = 0)
Space
in EP2 FIFO?
No
Yes
Interrupt
request
Figure 20.11 EP2 Bulk-IN Transfer Operation