CHAPTER 19: Programmable CRC
FM4 Peripheral Manual, Doc. No. 002-04856 Rev. *E 935
performed at first, the value specified with the PRGCRC_FXOR register is operated with bitwise XOR,
and then the value is stored in the PRGCRC_RD register.
Table2-4 shows operation example of output format conversion of 16-bit data.
Table2-4 Operation Example of Output Data Format Conversion
Output Data from LFSR
(binary)
(Left value is output first)
Output Format Conversion Operation
PRGCRC_RD
Read Value
(Hexadecimal)
00
(MSB-first / Big endian)
Bit order: from left to right
Byte order: Byte-A, Byte-B
0x9A 0xBC
(Byte-A) (Byte-B)
01
(MSB-first / Little endian)
Bit order: from left to right
Byte order: Byte-B, Byte-A
0xBC 0x9A
(Byte-B) (Byte-A)
10
(LSB-first / Big endian)
Bit order: from right to left
Byte order: Byte-A, Byte-B
0x59 0x3D
(Byte-A) (Byte-B)
11
(LSB-first / Little endian)
Bit order: from right to left
Byte order: Byte-B, Byte-A
0x3D 0x59
(Byte-B) (Byte-A)
Table2-5 shows examples of relations among CRC values held in LFSR (*1), values converted with the
output format conversion (*2), PRGCRC_FXOR setting values (*3), and values stored in the
PRGCRC_RD register (*4).
Table2-5 Operation Example of Output Data Format Conversion
CRC Value of LFSR (*1)
(Left value is output first)
Output Format
Converted Value (*2)
PRGCRC_FXOR
Setting Value (*3)
PRGCRC_RD
Stored Value (*4)
Each time computing is completed, the computing result is stored in the PRGCRC_RD register. As shown
in the block diagram, the PRGCRC_FXOR register value only affects the value stored in the
PRGCRC_RD register, and it does not affect the computing result stored in LFSR. After writing all input
data required is completed and the last CRC computing is completed, the CRC computing result with
reflection of the PRGCRC_FXOR register value is acquired when the PRGCRC_RD register is read.
The latest CRC computing result is stored in LFSR. To start another CRC computing, be sure to write the
initial values to the PRGCRC_SEED register to reset the initial values of the LFSR.