53
Ver 1.4
MITSUBISHI MICROCOMPUTERS
7640 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
The following outlines the operation sequence for an
IN endpoint used to communicate rate feedback infor-
mation:
1. Set MAXP > 1/2 of the endpoint’s FIFO size
2. Set the INTPT bit of the IN CSR
3. Flush the old data in the FIFO
4. Load interrupt status information and set the
IN_PKT_RDY bit in the IN CSR
5. Repeat steps 3 and 4 for all subsequent interrupt
status updates.
In real applications, if an interrupt endpoint is used for
rate feedback, the function always has data to send
back to the host, even if that data conveys that every-
thing is ‘fine’. Therefore the device never NAKs an IN
token from the host. The device always sends out the
data in the FIFO in response to an IN token irrespec-
tive of the IN_PKT_RDY bit.
1.21.3.2 OUT (Receive) FIFOs
The USB FCU writes data to the endpoint’s OUT
FIFO location specified by the FIFO write pointer,
which automatically increments by one after a write.
When the USB FCU has successfully received a data
packet, it sets the OUT_PKT_RDY bit to a “1” in the
OUT CSR. The CPU/DMAC should only read data
from the OUT FIFO if the OUT_PKT_RDY bit of the
OUT CSR is a “1”, with the exception of endpoint 1
(see detailed description below).
Endpoint 0 OUT FIFO Operation:
The USB FCU sets the OUT_PKT_RDY bit to a “1”
after it has successfully received a packet of data
from
the
host.
The
SERVICED_OUT_PKT_RDY to a “1” to clear the
OUT_PKT_RDY bit after the packet of data has been
unloaded from the OUT FIFO by the CPU.
Endpoint 1-4 OUT FIFO Operation when
AUTO_CLR (bit 7 of OUT CSR) = “0”:
MAXP > 1/2 of the OUT FIFO size:
The USB FCU
sets the OUT_PKT_RDY bit to a “1” after it has suc-
cessfully received a packet of data from the host.
The CPU writes a “0” to the OUT_PKT_RDY bit af-
ter the packet of data has been unloaded from the
OUT FIFO by the CPU/DMAC.
MAXP <= 1/2 of the OUT FIFO size:
The USB
FCU sets the OUT_PKT_RDY bit to a “1” after it
has successfully received a packet of data from the
host. The CPU writes a “0” to the OUT_PKT_RDY
bit after the packet of data has been unloaded from
CPU
sets
bit
the OUT FIFO by the CPU/DMAC. In this configura-
tion, the FIFO can hold up to two data packets at
the same time for back-to-back reception. There-
fore, the OUT_PKT_RDY bit will remain set after
the CPU writes a “0” to it if there is another packet
in the OUT FIFO.
Endpoint 1-4 OUT FIFO Operation when
AUTO_CLR (bit 7 of OUT CSR) = “1”:
MAXP > 1/2 of the OUT FIFO size:
The USB FCU
sets the OUT_PKT_RDY bit to a “1” after it has suc-
cessfully received a packet of data from the host.
The USB FCU clears the OUT_PKT_RDY bit to a
“0” automatically when the number of bytes of data
equal to the MAXP (maximum packet size) have
been unloaded from the OUT FIFO by the CPU/
DMAC.
MAXP <= 1/2 of the OUT FIFO size:
The USB
FCU sets the OUT_PKT_RDY bit to a “1” after it
has successfully received a packet of data from the
host. The USB FCU clears the OUT_PKT_RDY bit
to a “0” automatically when the number of bytes of
data equal to the MAXP (maximum packet size)
have been unloaded from the OUT FIFO by the
CPU/DMAC. In this configuration, the FIFO can
hold up to two data packets at the same time for
back-to-back
reception.
OUT_PKT_RDY bit will remain set after one packet
(size equal to MAXP) of data has been unloaded if
there is another packet in the OUT FIFO.
A software flush causes the USB FCU to act as if a
packet has been unloaded from the OUT FIFO. If
there is one packet in the OUT FIFO, a flush will
cause the OUT FIFO to be empty. If there are two
packets in the OUT FIFO, a flush will cause the older
packet to be flushed out from the OUT FIFO.
Special case for OUT Endpoint 1:
In addition to the OUT FIFO operations described
above, the DMAC can also start unloading the OUT
FIFO as soon as there is data in it (byte-by-byte
transfer). This feature should only be used with ISO
transfers. See DMAC section for details.
Therefore,
the