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, describes the type of transaction
  • Data - Depending on the transaction type this is optional. This is the data payload and is sent by the Host for OUT transactions 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 begining 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
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 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

OUT Transactions

IN Transactions

 Learn More

USB Speeds and Specifications
Learn more >
Implementing USB in a Design
Learn more >
Device Classes
Learn more >
USB Type-C
Learn more >
© 2020 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.