Atmel Xplained Pro Evaluation Kit for the ATSAMD21J18A Microcontroller ATSAMD21-XPRO ATSAMD21-XPRO Fiche De Données

Codes de produits
ATSAMD21-XPRO
Page de 1018
742
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181C–SAM-D21_Datasheet–07/2014
When an IN token is received, PCKSIZE.BYTE_COUNT and PCKSIZE.MULTI_PACKET_SIZE are fetched. If 
PCKSIZE.BYTE_COUNT minus PCKSIZE.MULTI_PACKET_SIZE is less than the endpoint PCKSIZE.SIZE, endpoint 
BYTE_COUNT minus endpoint PCKSIZE.MULTI_PACKET_SIZE bytes are transmitted, otherwise PCKSIZE.SIZE 
number of bytes are transmitted. If endpoint PCKSIZE.BYTE_COUNT is a multiple of PCKSIZE.SIZE, the last packet 
sent will be zero-length if the AUTOZLP bit is set.
If a maximum payload size packet was sent (i.e. not the last transaction), MULTI_PACKET_SIZE will be incremented by 
the PCKSIZE.SIZE. If the endpoint is not isochronous the EPSTATUS.DTLGIN bit will be toggled when the transaction 
has completed. If a short packet was sent (i.e. the last transaction), MULTI_PACKET_SIZE is incremented by the data 
payload. EPSTATUS.BK0/1RDY will be cleared and EPINTFLAG.TRCPT0/1 will be set.
31.6.2.11 Ping-Pong Operation
When an endpoint is configured for ping-pong operation, it uses both the input and output data buffers (banks) for a given 
endpoint in a single direction. The direction is selected by enabling one of the IN or OUT direction in EPCFG.EPTYPE0/1 
and configuring the opposite direction in EPCFG.EPTYPE1/0 as Dual Bank.
When ping-pong operation is enabled for an endpoint, the endpoint in the opposite direction must be configured as dual 
bank. The data buffer, data address pointer and byte counter from the enabled endpoint are used as Bank 0, while the 
matching registers from the disabled endpoint are used as Bank 1. 
Figure 31-7. Ping-Pong Overview
The Bank Select flag in EPSTATUS.CURBK indicates which bank data will be used in the next transaction, and is 
updated after each transaction. According to EPSTATUS.CURBK, EPINTFLAG.TRCPT0 or EPINTFLAG.TRFAIL0 or 
EPINTFLAG.TRCPT1 or EPINTFLAG.TRFAIL1 in EPINTFLAG and Data Buffer 0/1 ready (EPSTATUS.BK0RDY and 
EPSTATUS.BK1RDY) are set. The EPSTATUS.DTGLOUT and EPSTATUS.DTGLIN are updated for the enabled 
endpoint direction only.
31.6.2.12 Feedback Operation
Feedback endpoints are endpoints with same address but in different direction. This is usually used in explicit feedback 
mechanism in USB Audio, where a feedback endpoint is associated to one or more isochronous data endpoints to which 
it provides feedback service. The feedback endpoint always has the opposite direction from the data endpoint.
The feedback endpoint always has the opposite direction from the data endpoint(s). The feedback endpoint has the 
same endpoint number as the first (lower) data endpoint. A feedback endpoint can be created by configuring an endpoint 
with different endpoint size (PCKSIZE.SIZE) and different endpoint type (EPCFG.EPTYPE0/1) for the IN and OUT 
direction.
Example Configuration for Feedback Operation:
USB data packet
With Ping Pong
Without Ping Pong
Available time for data processing by CPU
to avoid NACK
t
t
Endpoint
single bank
Endpoint
dual bank
Bank0
Bank1