
USB DEVICE CONTROLLER
M66290AGP/FP
MITSUBISHI <DIGITAL ASSP>
30
FIFO control
Access to endpoint buffer of EP0 to EP5 is done by
three FIFO data registers. One is only for EP0 and
Others are common to EP1 to EP5. Common data
registers are divided into two, because accessing
is different, that is for CPU access and for DMA
transfer. Which endpoint of EP1 to EP5 to be
accessed can be selected to set each FIFO
selection register.
Endpoint
EP0
EP1 to EP5
Accessing
CPU access
CPU access
DMA transfer
Register name
EP0_FIFO
data register
CPU_FIFO
data register
DMA_FIFO
data register
Each of three FIFO registers has functions as
follows. And these functions can be used to set
"Each FIFO Selection/Control Register".
Short packet transmission function
(IVAL : IN buffer status bit)
Transmit/receive buffer clear function
(BCLR : Buffer clear bit)
Null data (data length 0) transmit function
(IVAL & BCLR)
Data length (8/16 bit) set function
(Octl : Register 8bit mode bit)
Received data length count down function
(RCNT : Read count mode bit)
*: There is none for DMA transfer
Access to CPU_FIFO data register when interrupt
occurred, to know the endpoint which requested
access, access the "Interrupt Status Register 0/1"
and by checking the interrupt status flag and know
the endpoint which requested access, and then set
endpoint to be accessed by "CPU_FIFO Selection
Register".
If there is no change of endpoint setting, it is not
needed to set again the CPU access endpoint
appointment bit.
Data transfer procedure
Data which is set to endpoint FIFO, is sent to USB
bus by LSB first. When store the received data
from USB bus to endpoint FIFO, it is as the same
as above.
Time scale
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11D12 D13 D14D15
(Data send procedure to USB bus)
1
16
DMA transfer
To endpoint of EP1 to EP5, 16bits width or 8bit width of
DMA
transfer is available.
Each endpoint of EP1 to EP5 can be set to CPU access
mode or DMA access mode by set of "EPx Configuration
Register 1" mentioned later.
DMA transfer is realized to hand shake with external DMAC
and Dreq, Dack signal. Dreq is asserted when endpoint
buffer, which is set to DMA transfer mode, became ready.
The means of Buffer ready state is, if the endpoint
transfer
direction is set to Out (recive data from host) buffer ready
means that in read enable state, if the endpoint transfer
direction is set to IN(transmit data to host) buffer ready
means that in write enable state. Setting the transfer
direction can be done by "EPi Configuration Register 0" to
each endpoint.
When Dack comes from external DMAC after asserted
Dreq, Dreq is negated.
In DMA transfer, Dack is dealt equivalently with CS signal
and DMA_FIFO address appointment.
Appoint read or write operation by RD or WR signal.
This DMA transfer can be used only for single transfer,
which
transfers one word (16bit or 8bit) by one time Dreq start.
In DMA transfer, as same as the CPU access, occurs
endpoint buffer not ready interrupt and endpoint buffer
empty interrupt according to endpoint buffer state. But as
to endpoint buffer ready interrupt, it is not same as the
CPU access as follows.
In DMA transfer, endpoint buffer ready interrupt is not
occurred if the transfer direction is IN.
If the transfer direction is OUT, interrupt is occurred when
received short data packet and ended data transfer of all
data which received in DMA transfer.
Occurring of endpoint buffer ready interrupt and to refer
DMA_DTLN, it can be known that short data packet was
received.
DMA_DTLN shows the number of byte of short data
packet,
or in the continuous receive mode it shows the number of
byte
of received data before short data packet receive.