216
XMEGA B [DATASHEET]
8291B–AVR–01/2013
18.7
Multipacket Transfers
Multipacket transfer enables a data payload exceeding the maximum data payload size of an endpoint to be transferred
as multiple packets without any software intervention. This reduces interrupts and software intervention to the higher
level USB transfer, and frees up significant CPU time. Multipacket transfer is identical to the IN and OUT transactions
described above, unless otherwise noted in this section.
The application software provides the size and address of the SRAM buffer to be processed by the USB module for a
specific endpoint, and the USB module will then split the buffer in the required USB data transfer.
Figure 18-9. Multipacket overview.
18.7.1 For Input Endpoints
The total number of data bytes to be sent is written to CNT, as for normal operation. The auxiliary data register
(AUXDATA) is used to store the number of bytes that will be sent, and must be written to zero for a new transfer.
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 incremented 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.
18.7.2 For Output Endpoints
The number of data bytes received is stored in the endpoint’s CNT register, as for normal operation. 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 AUXDATA. This value must be a multiple of SIZE, except for ISO 1023 bytes endpoints;
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 management 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 CNT is equal to AUXDATA, then
BUSNACK0/BUSNACK1, TRNIF, and 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.
Transfer Complete Interrupt and data processing
Without multipacket
With multipacket
Summary of Contents for XMEGA B
Page 320: ...320 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 12 7 segments Character Table...
Page 321: ...321 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 13 14 segments Character Table...
Page 322: ...322 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 14 16 segments Character Table...
Page 412: ...412 XMEGA B DATASHEET 8291B AVR 01 2013...
Page 413: ...413 XMEGA B DATASHEET 8291B AVR 01 2013...