CHAPTER 19: Programmable CRC
952 FM4 Peripheral Manual, Doc. No. 002-04856 Rev. *E
1. Set the value of generator polynomial for the PRGCRC_POLY register. Set 0x1021 0000 according
with generator polynomial. (value common to format A, B, C and D)
2. Set the CRC initial value for the PRGCRC_SEED register. Since the CRC initial value is 0xFFFF, set
0xFFFF 0000. (value common to format A, B, C and D)
3. Set the output inversion value for the PRGCRC_FXOR register. Perform settings according to the
computing output format (FO). (Values for format A and C are different from those of format B and
D.)
4. Set the computing input/output format for the PRGCRC_CFG register. The size of the first input data
is 32-bit. Select and set (SZ="11") and the computing input/output data format (FI, FO) respectively
according to the memory storage format of the input/output data.
5. Set the computing input data of the specified input format (FI) for the PRGCRC_WR register. Write
the head of the transmit data with 32-bit width at first. After writing, perform checking of computing
completion with LOCK.
6. Set the input data size of the PRGCRC_CFG register to 16-bit (SZ="01") since the second write data
is 16-bit.
7. Set the computing input data of the specified input format (FI) for the PRGCRC_WR register. Write
the second transmit data with 16-bit width. In all input data format, the bit position of writing is
PRGCRC_WR[15:0], even if input data format A,C and 16-bit width is selected. After writing,
perform checking of computing completion with LOCK.
8. Read the CRC computing results from the PRGCRC_RD register. The position where the computing
results can be read varies depending on the computing output format (FO). In case of format A and
C, the values read from PRGCRC_RD[31:16] are the CRC computing results. In case of format B
and D, the values read from PRGCRC_RD[15:0] are the CRC computing results.
Transmit the 64-bit sequence below by using the CRC computing results. The value indicated with bold
and italic shows the generated CRC value. The CRC computing results vary if the output format (FO) is
different, however, the same bit sequence will be transmitted regardless of the data format.
Memory storage format
(0x 12 35 9A BC), (0x 78 31 CD BA) ・・・format A
(0x BC 9A 35 12), (0x BA CD 31 78) ・・・format B
(0x 48 AC 59 3D), (0x 1E 8C B3 5D) ・・・format C
(0x 3D 59 AC 48), (0x 5D B3 8C 1E) ・・・format D
64-bit sequence with CRC (transmit from left to right)
00010010 00110101 10011010 10111100 01111000 00110001 11001101 10111010
(0x12) (0x35) (0x9A) (0xBC) (0x78) (0x31) (0xCD) (0xBA)
(0x48) (0xAC) (0x59) (0x3D) (0x1E) (0x8C) (0xB3) (0x5D)