USB Transactions

Last modified by Microchip on 2023/11/10 11:19

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.

USB transaction process

Token Packets

  
OUT0001bBeginning of OUT transaction
IN1001bStart of an IN transaction
SETUP0101bSignals beginning of a Control Transaction
SOF1101bStart of Frame packet

Data Packets

  
DATA00010bClears the toggle bit in the data packet
DATA11011bSets the toggle bit in the data packet

Handshake

  
ACK0110bTransmission successfully completed
NACK1010bTransmission unsuccessful
STALL1110bDelayed 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.

Sample USB Transactions

USB Out transaction process

USB in transaction process

Back to top

Learn More

Back to top