14.3 CRC Polynomial Implementation
Any polynomial can be used. The polynomial and accumulator sizes are
determined by the PLEN bits. For an n-bit accumulator, PLEN = n-1 and the corresponding
polynomial is n+1 bits. Therefore, the accumulator can be any size up to 16 bits with a
corresponding polynomial up to 17 bits. The MSb and LSb of the polynomial are always
‘1
’ which is forced by hardware. However, the
LSb of the CRCXORL register is unimplemented and always reads as ‘0
’.
All polynomial bits between the MSb and LSb are specified by the CRCXOR registers. For example, when using CRC16-ANSI, the
polynomial is defined as X16+X15+X2+1. The X16 and X0 = 1
terms are the MSb and LSb controlled by hardware. The X15 and X2 terms are
specified by setting the corresponding CRCXOR[15:0] bits with the value of 0x8004. The
actual value is 0x8005 because the hardware sets the LSb to 1
. Refer to Figure 14-1.