Atmel Evaluation Kit for the SAM4E Series of Flash Microcontrollers ATSAM4E-EK ATSAM4E-EK Data Sheet

Product codes
ATSAM4E-EK
Page of 1506
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
1156
Figure 42-7.
Bank Swapping Data IN Transfer for Ping-pong Endpoints 
When using a ping-pong endpoint, the following procedures are required to perform Data IN transactions:
1.
The microcontroller checks if it is possible to write in the FIFO by polling TXPKTRDY to be cleared in the end-
point’s UDP_CSRx.
2.
The microcontroller writes the first data payload to be sent in the FIFO (Bank 0), writing zero or more byte 
values in the endpoint’s UDP_FDRx.
3.
The microcontroller notifies the USB peripheral it has finished writing in Bank 0 of the FIFO by setting the 
TXPKTRDY in the endpoint’s UDP_CSRx.
4.
Without waiting for TXPKTRDY to be cleared, the microcontroller writes the second data payload to be sent 
in the FIFO (Bank 1), writing zero or more byte values in the endpoint’s UDP_FDRx.
5.
The microcontroller is notified that the first Bank has been released by the USB device when TXCOMP in the 
endpoint’s UDP_CSRx is set. An interrupt is pending while TXCOMP is being set.
6.
Once the microcontroller has received TXCOMP for the first Bank, it notifies the USB device that it has 
prepared the second Bank to be sent, raising TXPKTRDY in the endpoint’s UDP_CSRx.
7.
At this step, Bank 0 is available and the microcontroller can prepare a third data payload to be sent
.
USB  Device
USB Bus
Read
Write
Read and Write at the Same Time
1st Data Payload
2nd Data Payload
3rd Data Payload
3rd Data Payload
2nd Data Payload
1st Data Payload
Data IN Packet
Data IN Packet
Data IN Packet
Microcontroller
Endpoint 1
Bank 0
Endpoint 1
Bank 1
Endpoint 1
Bank 0
Endpoint 1
Bank 0
Endpoint 1
Bank 0
Endpoint 1
Bank 1