244
8331B–AVR–03/12
Atmel AVR XMEGA AU
When an IN token is received, the endpoint’s CNT and AUXDATA are fetched. If CNT minus
AUXDATA is less than the endpoint SIZE, endpoint CNT minus endpoint AUXDATA number
bytes are transmitted; otherwise, SIZE number of bytes are transmitted. If endpoint CNT is a
multiple of SIZE and auto zero length packet (AZLP) is enabled, the last packet sent will be zero
length.
If a maximum payload size packet was sent (i.e., not the last transaction), AUXDATA is incre-
mented by SIZE. TOGGLE will be toggled after the transaction has completed if the endpoint is
not isochronous. If a short packet was sent (i.e., the last transaction), AUXDATA is incremented
by the data payload. TOGGLE will be toggled if the endpoint is not isochronous, and BUSNACK,
TRNIF, and TRNCOMPL0 will be set.
20.7.2
For Output Endpoints
The number of data bytes received is stored in the endpoint’s CNT register, as for normal opera-
tion. Since the endpoint’s CNT is updated after each transaction, it must be set to zero when
setting up a new transfer. The total number of bytes to be received must be written to AUX-
DATA. This value must be a multiple of SIZE; otherwise, excess data may be written to SRAM
locations used by other parts of the application.
TOGGLE management is as for non-isochronous packets, and BUSNACK0/BUSNACK1 man-
agement is as for normal operation.
If a maximum payload size packet is received, CNT is incremented by SIZE after the transaction
has completed, and TOGGLE toggles if the endpoint is not isochronous. If the updated endpoint
C N T i s e q u a l t o A U X D A T A , t h e n B U S N A C K 0 / B U S N A C K 1 , T R N I F , a n d
TRNCOMPL0/TRNCOMPL1 will be set.
If a short or oversized packet is received, the endpoint’s CNT register will be incremented by the
data payload after the transaction has completed. TOGGLE will be toggled if the endpoint is not
isochronous, and BUSNACK0/BUSNACK1, TRNIF, and TRNCOMPL0/TRNCOMPL1 will be set.
20.8
Auto Zero Length Packet
Some IN transfer requires a zero length packet to be generated in order to signal end of transfer
to the host. The auto zero length packet (AZLP) function can be enabled to perform this genera-
tion automatically, thus removing the need for application software or CPU intervention to
perform this task.
20.9
Transaction Complete FIFO
The transaction complete FIFO provides a convenient way to keep track of the endpoints that
have completed IN or OUT transactions and need firmware intervention. It creates a first-come,
first-served work queue for the application software.
The FIFO size is (MAXEP[3:0] + 1) × 4 bytes, and grows downward, starting from EPPTR - 1.
This SRAM memory is allocated only when the FIFO is enabled.