Product manual

Spinpoint M9TU-USB 3.0 Product Manual REV 1.0
42
USB INTERFACE AND USB COMMANDS
6.3.2.4 Endpoint Fields
An additional four-bit endpoint (ENDP) field, shown in Figure 6-16, permits more flexible addressing of
functions in which more than one endpoint is required. Except for endpoint address zero, endpoint numbers are
function-specific. The endpoint field is defined for IN, SETUP, and OUT tokens and the PING special token. All
functions must support a control pipe at endpoint number zero (the Default
Control Pipe). Low speed devices support a maximum of three pipes per function:
a control pipe at endpoint number zero plus two additional pipes (either two
control pipes, a control pipe and an interrupt endp
oint, or two interrupt
endpoints). Full-speed and high-speed functions may support up to a maximum of
16 IN and OUT endpoints.
6.3.2.5 Frame Number Fields
The frame number field is an 11-bit field that is incremented by the host on a per-frame basis. The frame number
field rolls over upon reaching its maximum value of 7FFH and is sent only in SOF tokens at the start of each
(micro) frame.
6.3.2.6 Data Fields
The data field may range from zero to 1,024 bytes and must be an integral number of bytes. Figure 6-17
shows the format for multiple bytes. Data bits within each byte are shifted out LSb first.
Figure 6-17: Data Field Format
6.3.2.7 Cyclic Redundancy Checks
Cyclic redundancy checks (CRCs) are used to protect all non-PID fields in token and data packets. In this
context, these fields are considered to be protected fields. The PID is not included in the CRC check of a packet
containing a CRC. All CRCs are generated over their respective fields in the transmitter before bit stuffing is
performed. Similarly, CRCs are decoded in the receiver after stuffed bits have been removed. Token and data
packet CRCs provide 100% coverage for all single- and double-bit errors. A failed CRC is considered to indicate
that one or more of the protected fields is corrupted and causes the receiver to
ignore those fields and, in most
cases, the entire packet.
For CRC generation and checking, the shift registers in the generator and checker are seeded with an all ones
pattern. For each data bit sent or received, the high order bit of the current remainder is XORed with the data bit
and then the remainder is shifted left one bit and the low-order bit set to zero. If the result of that XOR is one,
then the remainder is XORed with the generator polynomial.
When the last bit of the checked field is sent, the CRC in the generator is inverted and sent to the checker MSb
first. When the last bit of the CRC is received by the checker and no errors have occurred, the remainder will be
equal to the polynomial residual.
A CRC error exists if the computed checksum remainder at the end of a packet reception does not match the
residual.
Bit stuffing requirements must be met for the CRC, and this includes the need to insert a zero at the end of a
CRC if the preceding six bits were all ones.
Token CRCs
A five-bit CRC field is provided for tokens and covers the ADDR and ENDP fields of IN, SETUP, and
OUT tokens or the time stamp field of an SOF token. The PING and SPLIT special tokens also include a
five-bit CRC field. The generator polynomial is:
G(X) = X
5 + X2 + 1
The binary bit pattern that represents this polynomial is 00101B. If all token bits are received without error,
the five-bit residual at the receiver will be 01100B.
Data CRCs
The data CRC is a 16-bit polynomial applied over the data field of a data packet. The generating
polynomial is:
G(X) = X
16 + X15 + X2 + 1
The binary bit pattern that represents this polynomial is 1000000000000101B. If all data and CRC bits are
received without error, the 16-bit residual will be 1000000000001101B.
Figure 6-16 Endpoint Field