28 USB FUNCTION CONTROLLER (USB)
28-6
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
OUT
a
ACK
c
DATA
b
Host to Device
Device to Host
5.1.2 OUT Transaction
Figure 28.
IN transaction
On an IN endpoint, if maximum packet size data exist in the FIFO or if the firmware has granted permis-
sion for short-packet transmission, the macro responds to the IN transaction, returning the data packet.
A permission for short-packet data transmission (including zero-length packets) is granted by setting the
EP0ControlIN.EnShortPkt bit and the EP
x
{
x
=a,b,c,d}Control.EnShortPkt bit. When transmitting a short-
packet data, make sure that no attempt is made to write any new data into the endpoint’s FIFO after the
transmission permission is granted and until the transaction is closed.
On the EP0 endpoint, the EP0ControlIN.ForceNAK bit is set after the IN transaction that transmits the
short-packet data is closed.
After an ACK response is received in the IN transaction that has returned the data, the transaction is closed,
followed by issuance of an IN_TranACK status (EP
x
{
x
=0,a,b,c,d}IntStat.IN_TranACK bit). Also, the FIFO
is updated to acknowledge completion of the data transmission and to free the space.
If an ACK response is not received in the IN transaction that has returned the data, the transaction is consid-
ered as a failure, followed by issuance of an IN_TranErr status (EP
x
{
x
=0,a,b,c,d}IntStat.IN_TranErr bit).
Accordingly, the FIFO is not updated, or no space is freed.
In on an IN endpoint, if no maximum packet size data exist in the FIFO and no permission is granted
for short-packet transmission, the IN transaction receives a NAK response and an IN_TranNAK status
(EP
x
{
x
=0,a,b,c,d}IntStat.IN_TranNAK bit) is issued to the firmware. Accordingly, the FIFO is not updated,
or no space is freed.
Figure 28.5.1.3 illustrates how a successful IN transaction is executed and closed.
(a) The host issues an IN token addressed to an IN endpoint present on this node.
(b) If response is possible for this IN transaction, the macro transmits a data packet under the maximum
packet size.
(c) The host returns an ACK response. After receiving an ACK response, the macro sets registers to be au-
tomatically set up and issues a status to the firmware.
IN
a
ACK
c
DATA
b
Host to Device
Device to Host
5.1.3 IN Transaction
Figure 28.
Control transfer
Control transfer on the EP0 endpoint is controlled as a combination of a number of discrete transactions. Figure
28.5.1.4 illustrates how control transfer is executed for an OUT data stage.
(a) The host starts control transfer in a SETUP transaction. The device’s firmware analyzes the request contents
to prepare for responding to a data stage.
(b) The host issues an OUT transaction and executes a data stage, and the device receives data.
(c) The host issues an IN transaction and executes a status stage, and the device returns a zero-length data
packet.
Control transfer without a data stage is executed as in this example but without the data stage.