Datasheet

Section 22 USB Function Module (USB)
Rev. 2.00 Aug. 20, 2008 Page 876 of 1198
REJ09B0403-0200
22.5.5 EP1 Bulk-Out Transfer (Dual FIFOs)
Either of EP1
FIFOs empty?
Yes
No
FIFO FULL processing
Read EP1 receive
data size register (EPSZ1)
Read EP1 data
register (EPDR1)
USB function
NAK
ACK
OUT token reception
Data reception from host
Set EP1 FIFO full status
(IFR0.EP1 FULL = 1)
Interrupt request
Application
Set EP1 read complete bit
(TRG.EP1 RDFN = 1)
Clear EP1 FIFO full status
(IFR0.EP1 FULL = 0)
Resume
Figure 22.15 EP1 Bulk-Out Transfer Operation
EP1 has two 64-byte FIFOs, but the user can receive data and read receive data without being
aware of this dual-FIFO configuration.
When one FIFO is full after reception is completed, the EP1FULL bit in IFR0 is set. After the first
receive operation into one of the FIFOs when both FIFOs are empty, the other FIFO is empty, and
so the next packet can be received immediately. When both FIFOs are full, NAK is returned to the
host automatically. When reading of the receive data is completed following data reception, 1 is
written to the EP1RDFN bit in TRG and 0 is written to the EP1FULL bit in IFR0. This operation
empties the FIFO that has just been read, and makes it ready to receive the next packet.