28 USB FUNCTION CONTROLLER (USB)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
28-5
SETUP transaction
The SETUP transaction addressed to the EP0 endpoint of the macro’s own node is automatically executed.
(The USB function must be enabled for this to happen.)
When a SETUP transaction is issued, all the contents of the data packet (8 bytes) are stored in the registers
EP0Setup_0 through EP0Setup_7, followed by an ACK response. Meanwhile, a RcvEP0SETUP status is
issued to the firmware.
If an error occurs during a SETUP transaction, no response or status is issued.
When the SETUP transaction is completed, the ForceNAK bit of the EP0ControlIN and EP0ControlOUT
registers are set and the ForceSTALL bit is cleared. The ToggleStat bit is also set. After the firmware com-
pletes setting the EP0 endpoint and becomes ready to proceed to the next stage, clear the ForceNAK bit of
the relevant direction in the EP0ControlIN or EP0ControlOUT register.
Figure 28.5.1.1 illustrates how the SETUP transaction is executed.
(a) The host issues a SETUP token addressed to the EP0 endpoint of this node.
(b) Next, the host sends an 8-byte long data packet. The macro writes these data in the EP0Setup_0 through
EP0Setup_7 registers.
(c) The macro automatically returns an ACK response. In addition, it sets registers to be automatically set
up and issues a status to the firmware.
SETUP
a
ACK
c
DATA
b
Host to Device
Device to Host
5.1.1 SETUP Transaction
Figure 28.
OUT transaction
In OUT transactions, data reception is started regardless of the available space in the FIFO. Thus, this
product provides satisfactory throughput by assigning a FIFO region about twice as large as the maximum
packet size since it can read the FIFO data via the Port interface, for example, and receive data while creat-
ing an available space concurrently.
After all data are successfully received in an OUT transaction, the transaction is closed and an ACK re-
sponse is returned. In addition, the firmware receives an OUT_TranACK status of the relevant endpoint
(EP
x
{
x
=0,a,b,c,d}IntStat.OUT_TranACK bit). Furthermore, the FIFO is updated to acknowledge the data
reception and to secure a space for the data.
In OUT transactions on the EPa, EPb, EPc, and EPd endpoints, reception of all short-packet data causes an
OUT_ShortACK status (EP
x
{
x
=a,b,c,d}IntStat.OUT_ShortACK bit) to be issued, in addition to executing
the above closing process. If the EP
x
{
x
=a,b,c,d}Control.DisAF_NAK_Short bit is cleared, the relevant end-
point’s EP
x
{
x
=a,b,c,d}ForceNAK bit is set.
If a toggle miss-match has occurred in an OUT transaction, an ACK response is returned to the transaction
but no status is issued. Accordingly, the FIFO is not updated.
In the event of an error in an OUT transaction, no response is returned to the transaction. And an OUT_Tra-
nErr status (EP
x
{
x
=0,a,b,c,d}IntStat.OUT_TranErr bit) is issued. Accordingly, the FIFO is not updated.
If not all data are received in an OUT transaction, a NAK response is returned to the transaction and the
OUT_TranNAK status (EP
x
{
x
=a,b,c,d}IntStat.OUT_TranNAK bit) is issued. Accordingly, the FIFO is not
updated.
Figure 28.5.1.2 illustrates how a successful OUT transaction is executed and closed.
(a) The host issues an OUT token addressed to an OUT endpoint present on this node.
(b) Next, the host sends a data packet under the maximum packet size. The macro writes these data in the
relevant endpoint’s FIFO.
(c) Upon data reception, the macro automatically returns an ACK response. In addition, it sets registers to
be automatically set up and issues a status to the firmware.