USB Transactions
Universal Serial Bus (USB) transactions are initiated by the Host and intended to complete a communications event. In addition to a synchronizing preamble, transactions can have up to three packets:
- Token: Sent by the Host and describes the type of transaction
- Data: Depending on the transaction type, this is optional. This is the data payload that is sent by the Host for OUT transactions and by the Device for IN transactions
- Handshake: Status of the communications request
Token Packets | |||
---|---|---|---|
OUT | 0001b | Beginning of OUT transaction | |
IN | 1001b | Start of an IN transaction | |
SETUP | 0101b | Signals beginning of a Control Transaction | |
SOF | 1101b | Start of Frame packet | |
Data Packets | |||
DATA0 | 0010b | Clears the toggle bit in the data packet | |
DATA1 | 1011b | Sets the toggle bit in the data packet | |
Handshake | |||
ACK | 0110b | Transmission successfully completed | |
NACK | 1010b | Transmission unsuccessful | |
STALL | 1110b | Delayed response, retry needed |
If the Device responds to the Host request and the associated Cyclic Redundancy Check (CRC) is correct, the entire communications event is conducted within one transaction. If the Device responds with a NACK or a STALL, depending upon the application requirements, the Host will retry the transaction on the next scheduled frame. After several unsuccessful retries, the Host may suspend the Device with a control command.