4 packet formats, 1 token packet type, 2 start of frame packet type – Intel PXA255 User Manual

Page 405: 4 packet formats -5, In, out, and setup token packet format -5, Sof token packet format -5

Advertising
background image

Intel® PXA255 Processor Developer’s Manual

12-5

USB Device Controller

The Frame Number is an 11-bit field incremented by the host each time a frame is transmitted.
When it reaches its maximum value, 2047 (0x7FF), its value rolls over. Frame Number is
transmitted in the SOF packet, which the host outputs in 1 ms intervals. Device controllers use the
Frame Number field to control isochronous transfers. Data fields are used to transmit the packet
data between the host and the UDC. A data field consists of 0 to 1023 bytes. Each byte is
transmitted least significant bit first. The UDC generates an interrupt to indicate that a Start of
Frame event has occurred.

CRC fields are used to detect errors introduced during token and data packet transmission, and are
applied to all the fields in the packet except the PID field. The PID contains its own 4-bit ones
complement check field for error detection. Token packets use a 5-bit CRC (x

5

+x

2

+1) called CRC5

and Data packets use a 16-bit CRC (x

16

+x

15

+x

2

+1) called CRC16. For both CRCs, the checker

resets to all ones at the start of each packet.

12.3.4

Packet Formats

USB supports four packet types: Token, Data, Handshake, and Special. A PRE (Preamble) PID
precedes a low-speed (1.5 Mbps) USB transmission. The UDC supports high-speed (12 Mbps)
USB transfers only. PRE packets that signify low-speed devices and the low-speed data transfer
that follows such PRE packets are ignored.

12.3.4.1

Token Packet Type

A Token packet is placed at the beginning of a frame and is used to identify OUT, IN, SOF, and
SETUP transactions. OUT and IN frames are used to transfer data, SOF packets are used to time
isochronous transactions, and SETUP packets are used for control transfers to configure endpoints.
A Token packet consists of a sync, a PID, an address, an endpoint, and a CRC5 field (see

Table 12-3

). For OUT and SETUP transactions, the address and endpoint fields are used to select

the UDC endpoint that receives the data. For an IN transaction, the address and endpoint fields are
used to select the UDC endpoint that transmits data.

12.3.4.2

Start of Frame Packet Type

An SOF is a special type of Token packet that the host issues at a nominal interval of once every
1 ms +/- 0.0005 ms. SOF packets consist of a Sync, a PID, a Frame Number (incremented after
each frame is transmitted), and a CRC5 field (see

Table 12-4

).

The presence of SOF packets every

1 ms prevents the UDC from entering Suspend mode.

Table 12-3. IN, OUT, and SETUP Token Packet Format

8 bits

8 bits

7 bits

4 bits

5 bits

Sync

PID

Address

Endpoint

CRC5

Table 12-4. SOF Token Packet Format

8 bits

8 bits

11 bits

5 bits

Sync

PID

Frame Number

CRC5

Advertising