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
741
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181C–SAM-D21_Datasheet–07/2014
31.6.2.9  Management of IN Transactions
Figure 31-5. IN Transfer: Data Packet USB Device to Host After Request from Host
When a IN token is detected and if the device address of the token packet does not match DADD.DADD, the packet is 
discarded and the USB module returns to idle and waits for the next token packet.
When the address matches, the USB module checks if the endpoint received is enabled in the EPCFG of the addressed 
endpoint and if not the packet is discarded and the USB module returns to idle and waits for the next token packet.
When the endpoint is enabled, the USB module then checks on the EPCFG of the addressed input endpoint. If the 
EPCFG.EPTYPE1 is not set to IN, the USB module returns to idle and waits for the next token packet.
If EPSTATUS.STALLRQ1 in EPSTATUS is set, and the endpoint is not isochronous, a STALL handshake is returned to 
the host and EPINTFLAG.STALL1 is set.
If EPSTATUS.BK1RDY is cleared, the flag EPINTFLAG.TRFAIL1 is set. If the endpoint is not isochronous, a NAK 
handshake is returned to the host. 
The USB module then fetches the Data Buffer Address (ADDR) from the addressed endpoint's descriptor. The data 
pointed to by the Data Buffer Address (ADDR) is sent to the host in a DATA0 packet if the endpoint is isochronous. For 
non-isochronous endpoints a DATA0 or DATA1 packet is sent depending on the state of EPSTATUS.DTGLIN. When the 
number of data bytes specified in endpoint PCKSIZE.BYTE_COUNT is sent, the CRC is appended and sent to the host.
For isochronous endpoints, EPSTATUS.BK1RDY is cleared and EPINTFLAG.TRCPT1 is set. 
For all non-isochronous endpoints the USB module waits for an ACK handshake from the host. If an ACK handshake is 
not received within 16 bit times, the USB module returns to idle and waits for the next token packet. If an ACK handshake 
is successfully received EPSTATUS.BK1RDY is cleared, EPINTFLAG.TRCPT1 is set and EPSTATUS.DTGLIN is 
toggled.
Figure 31-6.
31.6.2.10 Multi-Packet Transfers for IN Endpoint
The total number of data bytes to be sent is written to PCKSIZE.BYTE_COUNT as for normal operation. The Multi-
packet size register (PCKSIZE.MULTI_PACKET_SIZE) is used to store the number of bytes that are sent, and must be 
written to zero when setting up a new transfer.
Internal RAM
USB Module
USB Endpoints 
Descriptor Table
USB Buffers
ENDPOINT 1 DATA
ENDPOINT 2 DATA
ENDPOINT 3 DATA
D
A
T
A
0
D
A
T
A
0
D
A
T
A
0
D
A
T
A
1
D
A
T
A
0
D
A
T
A
1
D
A
T
A
0
D
A
T
A
1
D
A
T
A
0
D
A
T
A
1
D
A
T
A
0
EPT 2
EPT 3
EPT 1
DP
DM
HOST
CPU
I
T
O
K
E
N
I
T
O
K
E
N
I
T
O
K
E
N
EPT 2
EPT 3
EPT 1
time
USB I/O Registers
Memory Map
I/O Register
DESCADD