29.3.1 Polynomial Interface
The CRC module can be programmed for CRC polynomials of up to the thirty-second order using up to 32 bits. Polynomial length, which reflects the highest exponent in the equation, is selected by the PLEN[4:0] bits (CRCCON[20:16]). The CRCXOR registers control which exponent terms are included in the equation. Setting a particular bit includes that exponent term in the equation functionally; this includes an XOR operation on the corresponding bit in the CRC engine. Clearing the bit disables the XOR.
For example, consider two CRC polynomials, one a 16-bit equation and the other a 32-bit equation. To program these polynomials into the CRC generator, set the register bits as shown in Table 29-1.
and
CRC Control Bits | Bit Values | |
---|---|---|
16-Bit Polynomial | 32-Bit Polynomial | |
PLEN[4:0] | 01111 | 11111 |
X[31:16] | 0000 0000 0000
0000 | 0000 0100 1100
0001 |
X[15:1] | 0001 0000 0010 0001 | 0001 1101 1011 0111 |
Note that the appropriate positions are set to ‘1
’ to
indicate that they are used in the equation (e.g., X26 and X23). The MSb of the polynomial
does not affect the calculation and can be set to any value.