« USB - Transfer Speeds | Home | USB - Signaling »

USB - Packet Format

By admin | April 29, 2007

USB packets have a format very similar to the packets used on the very early internet. It is nearly impossible to clearly understand USB connectivity without understanding the structure of the USB packet.

USB Packet Format:

OFFSET TYPE SIZE VALUE
0 HeaderChksum 1 Checksum of the header by adding the header bytes, excluding the header checksum.
1 HeaderSize 1 Size of the header, including strings if applicable.
2 Signature 2 Signature: 0×1234
4 VenderID 2 USB Vendor ID
6 ProductID 2 USB Vendor ID
8 ProductVersion 1 Product version
9 FirmwareVersion 1 Firmware version
10 UsbAttributes 1 USB attributes:
Bit 0: If set to 1, the header includes all three strings: language, manufacture, and product strings; if set to 0, the header does not include any strings.
Bit 2: If set to 1, the device can be self powered; if set to 0, it cannot be self powered.
Bit 3: If set to 1, the device can be bus powered; if set to 0, it cannot be bus powered.
Bits 1 and 4 … 7: Not used.
11 MaxPower 1 Maximum power the device needs in units of 2 mA.
12 Attribute 1 Device attributes:
Bit 0: If set to 1, the CPU speed runs at 24 MHz; if set to 0, the CPU speed runs at 12 MHz.
Bit 3: If set to 1, the device’s EEPROM can support 400 MHz; if set to 0, it can not support 400 MHz.
Bits 1, 2 and 4 … 7: Not used.
13 WPageSize 1 Maximum I2C write page size
14 DataType 1 This value defines if the device is application EEPROM or device EEPROM.
0×01: Application EEPROM
0×02: Device EEPROM
Other values are invalid.
15 RpageSize 1 Maximum I2C read page size. If the value is zero, the whole PayLoadSize is read in one I2C read setup.
16 PayLoadSize 2 Size of the application, if using EEPROM as an application EEPROM; otherwise the value is 0.

0xxx Language string 4 Language string in standard USB string format if applicable.
0xxx Manufacture string Manufacture string in standard USB string format if applicable.
0xxx Product string Product string in standard USB string format if applicable.
0xxx Application Code Application code if applicable.

Topics: Computers & Software |

Comments