English
Language : 

SAM7X128_14 Datasheet, PDF (438/662 Pages) ATMEL Corporation – ARM-based Flash MCU
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 end-
point’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 memory. 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 end-
point’s UDP_ CSRx register.
7. A new Data OUT packet can be accepted by the USB device.
Figure 34-9. Data OUT Transfer for Non Ping-pong Endpoints
Host Sends Data Payload
Microcontroller Transfers Data
Host Sends the Next Data Payload
Host Resends the Next Data Payload
USB Bus
Packets
Data OUT
PID
Data OUT 1
ACK
PID
Data OUT2
PID
Data OUT2
NAK
PID
Data OUT
PID
Data OUT2
ACK
PID
RX_DATA_BK0
(UDP_CSRx)
FIFO (DPR)
Content
Interrupt Pending
Set by USB Device
Data OUT 1
Written by USB Device
Data OUT 1
Microcontroller Read
Cleared by Firmware,
Data Payload Written in FIFO
Data OUT 2
Written by USB Device
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 payload sent by the host, while the current data
payload is received by the USB device. Thus two banks of memory are used. While one is available for the
microcontroller, the other one is locked by the USB device.
SAM7X Series [DATASHEET]
6120K–ATARM–11-Feb-14
438