Datasheet

2. Optional to enable reverse and complement function. Please see Bit reverse and
Result complement for details.
3. Write 32-bit polynomial to CRC_P0:CRC_P3.
4. Set CRC_CTRL[WAS] bit to allow CRC_D0:CRC_D3 written by seed.
5. Write 32-bit seed to CRC_D0:CRC_D3.
6. Clear CRC_CTRL[WAS] bit to start 32-bit CRC calculation.
7. Dummy CRC_D3 with 8-bit CRC raw data.
8. Get the checksum from CRC_D0:CRC_D3 when all CRC raw data dummied.
21.6.3 Bit reverse
The bit reverse function allows the input and output data reversed by bit for different
CRC standard and endian systems. The CRC_CTRL[TOT] bits control the reverse of
input data and the CRC_CTRL[TOTR] bits control the reverse of output data. The
following table shows how the CRC_CTRL[TOT] and CRC_CTRL[TOTR] bits work.
Table 21-11. TOT and TOTR bit and byte reverse function
TOT ROW D0 D1 D2 D3
00 b31b30b29b28b27b26b
25b24
b23b22b21b20b19b18b
17b16
b15b14b13b12b11b10b
9b8
b7b6b5b4b3b2b1b0
01 b24b25b26b27b28b29b
30b31
b16b17b18b19b20b21b
22b23
b8b9b10b11b12b13b14
b15
b0b1b2b3b4b5b6b7
NOTE
00 is the default case that no bit is reversed.
21.6.4 Result complement
The result complement function allows to output the complement of the checksum in
CRC data registers. When CRC_CTRL[FXOR] bit is set, the checksum is read by its
complement. Otherwise, the raw checksum is accessed.
21.6.5 CCITT compliant CRC example
The following code segment shows CCITT CRC-16 compliant example.
Example: 21.6.5.1 CCITT CRC-16 compliant example
Chapter 21 Cyclic redundancy check (CRC)
MC9S08PA60 Reference Manual, Rev. 1, 9/2012
Freescale Semiconductor, Inc. 573