989
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
38.6.2.3
Data OUT Transaction
Data OUT transactions are used in control, isochronous, bulk and interrupt transfers and con-
duct the transfer of data from the host to the device. Data OUT transactions in isochronous
transfers must be done using endpoints with ping-pong attributes.
Data OUT Transaction Without Ping-pong Attributes
To perform a Data OUT transaction, using a non ping-pong endpoint:
1.
The host generates a Data OUT packet.
2.
This packet is received by the USB device endpoint. While the FIFO associated to this
endpoint is being used by the microcontroller, a NAK PID is returned to the host. Once
the FIFO is available, data are written to the FIFO by the USB device and an ACK is
automatically carried out to the host.
3.
The microcontroller is notified that the USB device has received a data payload polling
RX_DATA_BK0 in the endpoint’s UDP_CSRx register. An interrupt is pending for this
endpoint while RX_DATA_BK0 is set.
4.
The number of bytes available in the FIFO is made available by reading RXBYTECNT
in the endpoint’s UDP_CSRx register.
5.
The microcontroller carries out data received from the endpoint’s memory to its mem-
ory. Data received is available by reading the endpoint’s UDP_FDRx register.
6.
The microcontroller notifies the USB device that it has finished the transfer by clearing
RX_DATA_BK0 in the endpoint’s UDP_CSRx register.
7.
A new Data OUT packet can be accepted by the USB device.
Figure 38-10. Data OUT Transfer for Non Ping-pong Endpoints
An interrupt is pending while the flag RX_DATA_BK0 is set. Memory transfer between the USB
device, the FIFO and microcontroller memory can not be done after RX_DATA_BK0 has been
cleared. Otherwise, the USB device would accept the next Data OUT transfer and overwrite the
current Data OUT packet in the FIFO.
Using Endpoints With Ping-pong Attributes
During isochronous transfer, using an endpoint with ping-pong attributes is obligatory. To be
able to guarantee a constant bandwidth, the microcontroller must read the previous data pay-
load sent by the host, while the current data payload is received by the USB device. Thus two
ACK
PID
Data OUT
NAK
PID
PID
PID
PID
PID
Data OUT2
ACK
Data OUT
Data OUT 1
USB Bus
Packets
RX_DATA_BK0
Set by USB Device
Cleared by Firmware,
Data Payload Written in FIFO
FIFO (DPR)
Content
Written by USB Device
Microcontroller Read
Data OUT 1
Data OUT 1
Data OUT 2
Host Resends the Next Data Payload
Microcontroller Transfers Data
Host Sends Data Payload
Data OUT2
Data OUT2
Host Sends the Next Data Payload
Written by USB Device
(UDP_CSRx)
Interrupt Pending
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...