IX PERIPHERAL MODULES 7 (USB): USB FUNCTION CONTROLLER (USB)
IX-1-16
EPSON
S1C33E07 TECHNICAL MANUAL
(U1) Data transfer of the maximum packet size is performed in the first OUT transaction.
(U2) Data transfer of the maximum packet size is performed in the second OUT transaction.
(F1) The FIFO is blank. Although the Port interface is invoked, no transfer is performed since the FIFO is
blank. (The PDREQ signal is negated.)
(F2) An OUT transaction is developing, and data reception has started in the FIFO. At this point, the FIFO
data is not considered to be valid since the transaction is not closed.
(F3) Although data packet reception is completed from the OUT transaction, the FIFO data is not considered
to be valid since the transaction is not closed.
(F4) The OUT transaction is closed and the received data are considered to be valid.
(F5) The presence of valid data in the FIFO triggers data transfer via the Port interface. (The PDREQ signal is
asserted.)
(F6) As Port transfer develops, the amount of the remaining valid data in the FIFO is reduced.
(F7) Starting the next transaction starts writing data. Port transfer continues as long as any valid data remains.
(F8) Port transfer has stopped as there is no valid data left. The second OUT transaction is not closed yet.
(F9) The second OUT transaction is closed, causing the FIFO data to become valid.
(F10) The presence of valid data in the FIFO restarts Port transfer.
IN transfer
Place data transmitted thorough IN transfer on each endpoint's FIFO. The FIFO data can be written via either
the CPU interface (EP0, EPa, EPb, EPc, EPd) or the Port interface (EPa, EPb, EPc, EPd).
To write data into the FIFO via the CPU interface, select one and only one endpoint using the CPU_JoinWr
register. Data can be written in the selected endpoint's FIFO by using the EPnFIFOforCPU register, which
are transmitted in data packets in the order of writing. Also, you can refer to the EPnWrRemain_H and
EPnWrRemain_L registers to check the available space in the FIFO. An attempt to write in a full FIFO causes
dummy writing to be performed.
To write data into the FIFO via the Port interface, select one and only one IN endpoint using the DMA_Join
register. Perform the Port interface procedure to write data into the selected endpoint's FIFO. These data are
transmitted in data packets in the order of writing. After the FIFO becomes full, the Port interface automatically
pauses to perform flow control.
Do not set the CPU and Port interfaces with the CPU_JoinWr and DMA_Join registers for writing data into the
same endpoint. Additionally, be sure to start writing data after ensuring that no data are received from the OUT
transactions by setting the ForceNAK bit, for example, if you want to set an OUT endpoint for data writing
using the CPU_JoinWr register.
Data cannot be written into an OUT endpoint via the Port interface.
If the FIFO contains data exceeding the maximum packet size, the macro automatically responds to IN
transactions to perform data transmission. This enables the firmware to perform IN transfer without individual
transaction control. Note, however, that you should set the EnShortPkt bit if you need to transmit a short packet
at the end of the data transfer. Since this bit is cleared when the IN transaction which has transmitted the short
packet is closed, you can set it after data is completely written into the FIFO.
When the DMA_FIFO_Control.AutoEnShort bit is set, the EPx{x=a,b,c,d}Control.EnShortPkt bit of the
relevant endpoint is automatically set if the FIFO still contains any fractional amount of data under the
maximum packet size after writing via the Port interface is completed. Using this function provides automatic
control to the end that only a non-zero-length short packet is returned, eliminating return of a zero-length data
packet.