28 USB FUNCTION CONTROLLER (USB)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
28-17
Using the descriptor area
The descriptor area provides high-speed, straightforward execution of part of operations for packets received/
transmitted via EP0, or a standard request. Among contents of standard requests, write those in this area that are
uniquely determined by the device during the initial setup stage following power-on to automatically execute
the data stage included in the request simply by setting the top address and the data size in response to a request
from the host. Accordingly, this technique eliminates the need of writing data in the EP0 area, enabling very
quick response to a request.
Writing data in the descriptor area
To write data in the descriptor area, first set the write start address in the DescAdrs_H and DescAdrs_L reg-
isters, and then write data in the DescDoor register (RegWindowSel == 0x2). After completing writing data,
the DescAdrs_H and DescAdrs_L registers are automatically incremented by one, enabling sequential writ-
ing in the DescDoor register (RegWindowSel == 0x2) when writing data at a series of adjacent addresses.
Note that this incrementing function does not mean that written data can be read when writing and reading
are executed sequentially; it only increments by one for both writing and reading.
Reading data from descriptor area
To read data from the descriptor area, first set the read start address in the DescAdrs_H and DescAdrs_L
registers, and then read data from the DescDoor register (RegWindowSel == 0x2). After completing reading
data, the DescAdrs_H and DescAdrs_L registers are automatically incremented by one, enabling sequential
reading in the DescDoor register (RegWindowSel == 0x2) when reading data from a series of adjacent ad-
dresses. Note that this incrementing function does not mean that written data can be read when writing and
reading are executed sequentially; it only increments by one for both writing and reading.
Executing data stage (IN) in the descriptor area
To use written data in response to a request from EP0, set the top address of the data to be transmitted to the
data stage, set the data size specified in the request in the DescSize_H and DescSize_L registers, and then
set the EP0Control.ReplyDescriptor bit to 1.
After receiving the IN token from the host, the macro start transmitting data to the host, automatically split-
ting them into the maximum packet size (set in the EP0MaxSize). In addition, if the value in the DescSize_
H or DescSize_L register is under the maximum packet size, or if the remaining number of data after split-
ting, the macro automatically transmits such data as short packets. When the specified number of data are
completely transmitted, the EP0Control.ReplyDescriptor is cleared and the FIFO_IntStat.DescriptorCmp is
set. At this stage, the FIFO_IntEnb.EnDescriptorCmp bit is set and the MainIntEnb.EnEPrIntStat bit is set
as well, the #INT signal is asserted at the same time.
If the process enters a status stage before the transmitted amount reaches the specified number of data (that
is, if an OUT token is received), the EP0Control.ReplyDescriptor is automatically cleared to suspend this
function. At the same time, the EP0IntStat.OUT_TranNAK status and the FIFO_IntStat.DescriptorCmp sta-
tus are set. If either of the following sets of bits are set, the #INT signal is asserted at the same time:
(1) The EP0IntEnb.EnOUT_TranNAK, MainIntEnb.EnEP0IntStat and MainIntEnb.EnEPrIntStat bits, or
(2) The FIFO_IntEnb.EnDescriptorCmp and MainIntEnb.EnEPrIntStat bits.
Accessing to FIFO by CPU
To enable the CPU to access the FIFO, set the bit of the relevant endpoint of the CPU_JoinRd and CPU_JoinWr
registers to 1 and execute reading and writing via the EPnFIFOforCPU register. For each of the CPU_JoinRd
and CPU_JoinWr registers, you can only set one bit out of the four bits. If you attempt to set more than one bit
at a time, only the highest bit is set.
The EPnRdRemain_H and EPnRdRemain_L registers indicate the remaining number of data that can be read at
the endpoint set in the CPU_JoinRd register. The EPnWrRemain_H and EPnWrRemain_L registers indicate the
remaining area space available for writing at the endpoint set in the CPU_JoinWr register.
Note that, if the CPU_JoinRd register is set when register dumping is planned for debugging of a CPU using
ICE, data will be read from the FIFO upon dumping the register.