CHAPTER 19: Programmable CRC
FM4 Peripheral Manual, Doc. No. 002-04856 Rev. *E 951
5. Example of the Programmable CRC Computing
This section explains an example to perform CRC computing using CRC computing function of this
function block.
5.1 Computing Example 1
This example1 shows computing which generates CRC code when data is transferred to the following
48-bit serial bit sequence. This example is explained based on the following conditions.
Transmission of this bit sequence performed from left to right. 16-bit CRC code is generated by generator
polynomial, x
16
+x
12
+x
5
+1. The initial value of CRC computing is 0xFFFF. Generated CRC code will be
inverted. 48-bit transmit data values are divided and stored as 32-bit values and 16-bit values in the
memory of MCU.
48-bit sequence (transmit from left to right)
00010010 00110101 10011010 10111100 01111000 00110001 ・・・(binary)
(0x12) (0x35) (0x9A) (0xBC) (0x78) (0x31) ・・・(hexadecimal MSB-first)
(0x48) (0xAC) (0x59) (0x3D) (0x1E) (0x8C) ・・・(hexadecimal LSB-first)
Memory storage format
(0x 12 35 9A BC), (0x 78 31) ・・・format A (MSB-first/Big Endian)
(0x BC 9A 35 12), (0x 31 78) ・・・format B (MSB-first/Little Endian)
(0x 48 AC 59 3D), (0x 1E 8C) ・・・format C (LSB-first/Big Endian)
(0x 3D 59 AC 48), (0x 8C 1E) ・・・format D (LSB-first/Little Endian)
Select the computing data input format to CRC computing unit so that the format matches to the storage
format in the memory of 48-bit transmit data shown above. Table 5-1 below shows examples of the
register setting value, computing input value and computing output value for each memory storage format
A/B/C/D.
Table 5-1 Example of Value for CRC Computing Example 1