IX PERIPHERAL MODULES 7 (USB): USB FUNCTION CONTROLLER (USB)
S1C33E07 TECHNICAL MANUAL
EPSON
IX-1-15
IX
USB
Bulk transfer/interrupt transfer
Bulk and interrupt transfers at the general-purpose endpoints, EPa, EPb, EPc, and EPd, can be controlled either
as a data flow or as a series of discrete transactions (see the “Transaction” section).
Data flow control
This section describes controlling standard data flows in OUT and IN transfers.
OUT transfer
Data received from an OUT transfer are placed on the FIFO region at the respective endpoints. The FIFO data
can be read via either the CPU interface (EP0, EPa, EPb, EPc, EPd) or the Port interface (EPa, EPb, EPc, EPd).
To read the FIFO data via the CPU interface, select one and only one endpoint using the CPU_JoinRd register.
The FIFO data of the selected endpoint can be read sequentially with the EPnFIFOforCPU, according to the
order of reception. Also, you can refer to the EPnRdRemain_H and EPnRdRemain_L registers to check the
number of remaining data. Reading from an blank FIFO causes dummy reading to be performed.
To read the FIFO data via the Port interface, select one and only one OUT endpoint using the DMA_Join
register. Perform the Port interface procedure to read the FIFO data of the selected endpoint; they are read
sequentially in the order of reception. Also, you can refer to the DMA_Remain_H and DMA_Remain_L
registers to check the number of remaining data. After the FIFO is emptied, the Port interface automatically
pauses to perform flow control.
Do not set the CPU and Port interfaces with the CPU_JoinRd and DMA_Join registers for reading from the
same endpoint. Additionally, be sure to start reading data after ensuring that no data return responses are
returned to IN transactions by setting the ForceNAK bit, for example, if you want to set an IN endpoint for data
reading using the CPU_JoinRd register.
Data cannot be read from the IN endpoint via the Port interface.
If the FIFO has available space for receiving data packets, the macro automatically responds to OUT
transactions to receive data. This enables the firmware to perform OUT transfer without individual transaction
control. Note, however, that the EPx{x=a,b,c,d}Control.ForceNAK bit of the endpoint is set if short packets
are received (including zero-length data packet) when the EPx{x=a,b,c,d}Control.DisAF_NAK_Short bit is
cleared. Clear this bit when the next data transfer is ready.
Figure IX.1.4.1.6 illustrates the data flow in OUT transfer. The FIFO region for an OUT endpoint is connected
to the Port interface. Also, the FIFO region assigned to this endpoint is assumed to be twice as large as the
maximum packet size.
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
U2
U1
USB
Port reading
Port
FIFO
Figure IX.1.4.1.6 Example of Data Flow in OUT Transfer