28 USB FUNCTION CONTROLLER (USB)
28-18
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
Limiting access to FIFO
The FIFO of this macro allows concurrent execution of data reception/transmission between the macro and the
USB and/or the Port and writing/reading to and from the CPU. Because of this, there are two limitations for ac-
cessing the FIFO (for writing and reading) from the CPU (the firmware):
(1) From the CPU, no writing is allowed to the same endpoint while the USB or the Port is writing data to the
FIFO.
(2) No reading from the CPU is allowed from the same endpoint while the USB or the Port is reading from the
FIFO.
Never execute these operations; they may destroy data continuity.
Port Interface
28.5.3
Functional description
The Port interface is a DMA interface designed for fast data transfer between this macro and the FIFO for its
built-in endpoints. It provides Asynchronous DMA Transfer mode for transfer triggered by the Read/Write-
strobe signal.
Basic operations
This section describes the basic operations of the Port interface. Note that “DMA” in the descriptions refers to
the DMA circuit in the USB macro and “DMAC” refers to the DMA controller module in the S1C33L26.
Register setting
Table 28.5.3.1 lists the registers used for setting basic items of the Port interface. Set desired values for the
respective registers. To enable the DMA to write, set the DMA_Join register to connect the Port interface to
the endpoint set to the IN direction of the USB. To enable the DMA to read, connect to the endpoint set to
the OUT direction.
Do not modify the basic setting registers while the DMA is transferring data (when DMA_Control.DMA_
Running is set to 1). We do not guarantee normal operations if the basic setting registers are modified while
the DMA in transferring data.
5.3.1 Port Interface’s Registers for Basic Setting Items
Table 28.
Item
Register/bit
Description
Endpoint connection
DMA_Join.JoinEPr{r=a,b,c,d}DMA
Connects the Port interface to the endpoint of the bit set to 1.
Writing/reading is enabled to/from the connected endpoint.
Counter setting
DMA_Count_r{r=HH,HL,LH,LL}
Sets the number of bytes to be down-counted in Countdown
mode.
Active port
DMA_Config_0.ActivePort
Enables the port for the Port interface.
Active level
DMA_Config_0.PDREQ_Level
DMA_Config_0.PDACK_Level
DMA_Config_0.PDRDWR_Level
Sets the active level of the Port interface signal.
0: High-active. 1: Low-active.
RcvLimit mode
DMA_Config_1.RcvLimitMode
Only enabled while writing in Asynchronous transfer mode.
If this bit is set to 1, up to 16 bytes of data can be received
even after negating PDREQ.
Single-/multi-word
DMA_Config_1.SingleWord
Sets the transfer mode for operation in Asynchronous trans-
fer mode.
0: Multi-word transfer. 1: Single-word transfer.
Count mode
DMA_Config_1.CountMode
Sets Countdown/Free-run mode.
0: Free-run mode. 1: Countdown mode.
DMA transfer
After setting the basic setting registers, write 1 to the DMA_Control.DMA_Go bit to cause the Port inter-
face to start running the DMA. After the DMA starts running, the DMA_Control.DMA_Running bit is set
to 1, indicating that the DMA is running.
If the DMA is set to the Countdown mode with DMA_Config_1.CountMode = 1, the DMA completes data
transfer when the DMA_Count_HH, HL, LH and LL registers reach 0x00000000. To cancel (negate) the
DMA request (PDREQ), provide 1 to the DMA_Control.DMA_Stop bit. After the DMA completes data
transfer, the DMA_Control.DMA_Running bit attains 0 and the DMA_IntStat.DMA_Cmp bit 1. At this
time, if the DMA_IntEnb.EnDMA_Cmp bit is set, the #INT signal is asserted to the CPU.