
ML66525 Family User’s Manual
Chapter 17 USB Control Function
17 - 17
(2) 2-Layer transmission 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
transmit
PKT
RDY
1
Layer A and layer B are both empty.
x
2
The local MCU starts writing into layer A.
x
3
Writing of one packet is completed.
x
4
The data of layer A is transmitted and
the next packet is written in layer B.
x
5a
When layer A has become empty after
the writing in layer B is completed.
5b
When the writing in layer B has been
completed after layer A has become
empty.
x
6
From 5a: Layer A has become empty.
From 5b: Layer B has become full.
x
7
Transmission of layer B is also started.
x
If the EPn transmit packet ready interrupt enable bit of INTENBL1 has been asserted, the
transmit FIFO is empty, and EPn transmit packet ready bit is de-asserted, the EPn transmit
packet ready interrupt is asserted. This makes it possible to write the transmit data into the
EPn transmit FIFO.
When the data of one packet is written in layer A FIFO, make CPU set the transmit packet
ready bit (D1 of EPnSTAT) to “1”. By setting the transmit packet ready bit to “1”, it
becomes possible to transmit data to the host. At this time, since layer B is still empty, the
assert state of the interrupt is maintained (see Note below), thereby indicating that the next
packet data can be written. In this case, although bit D1 of EPnSTAT remains in the “0”
condition, USB controller recognizes that transmission is possible from layer A and starts
transmission when an IN token is received from the host.
It is possible for CPU to write the next packet of transmit data in the layer B FIFO while the
data in layer A is being transmitted over the USB bus.
When the writing of the data to be transmitted in layer B has been completed, CPU sets the
transmit packet ready bit to “1”. At this time, if the transmission of layer A data has not been
completed (that is, the ACK message is received from the host and the transmit packet ready
bit is reset), the interrupt is de-asserted. (The local MCU cannot yet write the subsequent
packet.)
If the layer A becomes empty before layer B goes into the transmit enable condition and
transmission is carried out normally, the ACK response is received from the host. The CPU
can write data into layer A FIFO after writing into layer B FIFO.
The transmission of data in layer A is continued from the state 5a, and when layer A becomes
empty and the transmission is completed normally, the ACK response is received from the
host, thereby prompting CPU to write data into layer A.
[Note]
If the transmit packet ready bit is set to “1”, the interrupt signal is de-asserted once, then it is
asserted again in a maximum 6 cycles (1 cycle = 1 CPUCLK).