![](http://datasheet.mmic.net.cn/90000/ML66Q525-NTB_datasheet_3507944/ML66Q525-NTB_373.png)
ML66525 Family User’s Manual
Chapter 17 USB Control Function
17 - 16
17.3.11 Operation of 2-Layer Structure FIFO During Bulk Transfer
The FIFOs of EP1 and EP2 have a 64 bytes x 2-layer structure. Also, when EP4 is assigned for
bulk transfer, its FIFO also has a 64-bytes x 2-layer structure. As a consequence, these FIFOs
can temporarily store a maximum of 128 bytes of bulk transfer data.
(1) 2-Layer reception operation (“O” indicates the assert condition and “x” indicates de-assert
condition)
In the case of 1
→2→3→4→5a→6
In the case of 1
→2→3→4→5b→6
Layer A
64 bytes
Layer B
64 bytes
Layer A
PKT
RDY
Layer B
PKT
RDY
EPn
receive
PKT
RDY
1
Start storing data in layer A of reception
x
2
Data of one packet has been stored.
x
3
Start reception and storing of data in
layer B.
x
4
Local MCU starts reading layer A.
x
5a
When the storing of packet in layer B is
completed following the completion of
reading layer A.
5b
When the reading of packet in layer A is
completed following the completion of
storing data in layer B.
x
6
From 5a: Layer A has become empty.
From 5b: Layer B has become full.
x
7
Starting reading layer B also.
x
When one packet of receive data is stored in layer A of the FIFO and EOP is received, USB
controller asserts the EPn packet ready bit and also the internal interrupt signal. This makes it
possible for CPU to read the receive data.
Subsequently, data can be received from the host, and USB controller switches the FIFO for
storing to layer B.
When one packet of data described above has been read from layer A of the FIFO, make CPU
reset the EPn receive packet ready bit (by writing a “1” into bit D0 of EPnSTAT).
At the time the EPn receive packet ready bit is reset, if the reception of layer B has not been
completed, USB controller resets the EPn receive packet ready bit.
However, if the reception of layer B has been completed at the time the EPn receive packet
ready bit is reset, USB controller rejects the request from CPU to reset the EPn receive packet
ready bit, and continues to maintain the assert state of the EPn receive packet ready bit. (See
Note below.)
[Note]
The interrupt signal is de-asserted once at the time the EPn receive ready bit is reset. Then a
switch will be made to layer B status in a maximum of 6 cycles (1 cycle = 1 CPUCLK) and, if
there is a receive packet in layer B, the EPn receive interrupt will be generated again.
If layer B FIFO is to be read more than once in succession, read it by interrupt detection after
the EPn receive packet ready bit is reset or read it after confirming that the EPn interrupt status
bit of the interrupt status register 1 (INTSTAT1) is “1”.