Rainbow Electronics AT91CAP9S250A User Manual

Page 856

Advertising
background image

856

6264A–CAP–21-May-07

AT91CAP9S500A/AT91CAP9S250A

Thus, firmware must detect RX_SETUP polling UDPHS_EPTSTAx or catching an interrupt, read
the setup packet in the FIFO, then clear the RX_SETUP bit in the UDPHS_EPTCLRSTA register
to acknowledge the setup stage.

If STALL_SNT was set to 1, then this bit is automatically reset when a setup token is detected by
the device. Then, the device still accepts the setup stage. (See

Section 44.4.8.15 ”STALL” on

page 867

).

44.4.8.2

NYET

NYET is a High Speed only handshake. It is returned by a High Speed endpoint as part of the
PING protocol.

High Speed devices must support an improved NAK mechanism for Bulk OUT and control end-
points (except setup stage). This mechanism allows the device to tell the host whether it has
sufficient endpoint space for the next OUT transfer (see USB 2.0 spec 8.5.1 NAK Limiting via
Ping Flow Control).

The NYET/ACK response to a High Speed Bulk OUT transfer and the PING response are auto-
matically handled by hardware in the UDPHS_EPTCTLx register (except when the user wants to
force a NAK response by using the NYET_DIS bit).

If the endpoint responds instead to the OUT/DATA transaction with an NYET handshake, this
means that the endpoint accepted the data but does not have room for another data payload.
The host controller must return to using a PING token until the endpoint indicates it has space
available.

Figure 44-6. NYET Example with Two Endpoint Banks

44.4.8.3

Data IN

44.4.8.4

Bulk IN or Interrupt IN

Data IN packets are sent by the device during the data or the status stage of a control transfer or
during an (interrupt/bulk/isochronous) IN transfer. Data buffers are sent packet by packet under
the control of the application or under the control of the DMA channel.

There are three ways for an application to transfer a buffer in several packets over the USB:

• packet by packet (see

44.4.8.5

below)

64

KB (see

44.4.8.5

below)

• DMA (see

44.4.8.6

below)

44.4.8.5

Bulk IN or Interrupt IN: Sending a Packet Under Application Control (Device to Host)

The application can write one or several banks.

t = 0

t = 125 µs

t = 250 µs

t = 375 µs

t = 500 µs

t = 625 µs

data 0 ACK

data 1 NYET

PING

ACK

data 0 NYET

PING

NACK

PING

ACK

Bank 1

Bank 0

Bank 0

Bank 1

Bank 0

Bank 1

Bank 0

Bank 1

Bank 0

Bank 1

Bank 0

Bank 1

Bank 0

Bank 1

E

F

F

E

F

E'

F

E

F

F

E'

F

E

F

E: empty
E': begin to empty
F: full

Advertising