1292 views|0 replies

323

Posts

0

Resources
The OP
 

USB2.0 Transactions [Copy link]

There are three major transactions, IN, OUT and SETUP. Each transaction consists of three stages: token packet, data packet and handshake packet. The term "stage" is used here because the sending of these packets has a certain time sequence. The three stages of a transaction are as follows:

1. Token packet stage: start an input, output or setup transaction.

2. Data packet stage: send the corresponding data according to input and output.

3. Handshake packet stage: return the data reception status. There is no such stage in the synchronous transmission IN and OUT transactions, which is quite special. The

three types of transactions are as follows (the following describes a transaction in three stages):

1. IN transaction:

token packet stage - the host sends an input packet with PID IN to the device, notifying the device to send data to the host;

data packet stage - the device will make three responses according to the situation (note: the data packet stage does not always transmit data, and the handshake packet stage will be entered in advance according to the transmission situation).

The device endpoint is normal: the device sends a data packet to the host (DATA0 and DATA1 alternately);

the device is busy: if it cannot send a data packet to the host, it sends a NAK invalid packet, the IN transaction ends prematurely, and it will continue until the next IN transaction;

the corresponding device endpoint is disabled: it sends an error packet STALL packet, the transaction ends prematurely, and the bus enters the idle state.

Handshake packet stage-after the host correctly receives the data, it will send an ACK packet to the device.

2. OUT transaction:

token packet stage-the host sends an output packet with PID OUT to the device to notify the device to receive data.

Data packet stage-relatively simple, that is, the host will send data to the device, DATA0 and DATA1 alternately.

Handshake packet stage-the device will make three responses according to the situation.

The device endpoint receives correctly, the device returns ACK to the host, notifying the host that it can send new data. If the data packet has a CRC check error, it will not return any handshake information;

the device is busy and cannot return ACK to the host, so it sends a NAK invalid packet to notify the host to send data again;

the corresponding device endpoint is disabled, and an error packet STALL packet is sent, the transaction ends prematurely, and the bus directly enters the idle state.

3. SETUT transaction:

Token packet stage - the host sends an output packet with PID SETUP to the device, notifying the device to receive data;

Data packet stage - relatively simple, the host sends data to the device. Note that there is only one DATA0 packet with a fixed length of 8 bytes. The content of these 8 bytes is the standard USB device request command, see 2.4 for details.

Handshake packet stage - after receiving the command information from the host, the device returns ACK, after which the bus enters the idle state and prepares for the next transmission (usually a transmission consisting of an IN or OUT transaction after the SETUP transaction).
This post is from FPGA/CPLD
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list