Specifications
9
9
Packets
Packets—block of information with a defined data structure. The packet is the
lowest level of the USB transfer hierarchy describing the physical layer of the
interface. If you were to monitor D+ and D- you would see the packet fields:
Packet identifier
Address
Endpoint
Data
Frame number
CRC
5478Bits
CRCEndpointAddressPIDField
Token Packet format:
5118Bits
CRCFrame NumberPIDField
SOF Packet format:
160-10238Bits
CRCDataPIDField
Data Packet format:
8Bits
PIDField
Handshake Packet format:
CRC covers everything in the packet with the exception of the PID which
has its own error checking mechanism
The Packet Identifiers we just reviewed are actually used to identify the packet type
being transmitted on the USB. We can see from the diagram above that the
packet format is defined by the PID we have outlined on the previous slide. For
example, if we see a PID of 0101b then we know to expect the data format of
the SOF packet. From that we know that the USB frame number will follow
the PID. The frame number is just a rolling count that will rollover on overflow.
If we were to see a PID of 1101b then we would expect a completely different
transfer type and there may be additional packets associated with the complete
data transfer. So we can see that the packet structure is a subset of the entire
transfer protocol defined by the USB. There are 4 packet types defined.
1) The token packet would be used to identify the transfer (setup, IN, OUT).
2) The SOF packet is sent on the frame boundaries to provide timing and frame
counts.
3) Data packet is the payload.
4) Handshake packets provide for comms robustness to verify that the data was
receive/transmitted properly.