EasyManua.ls Logo

Cypress FM4 Series - Example of the Programmable CRC Computing; Computing Example 1

Cypress FM4 Series
1102 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
No.
Target Register
Register Write Value or Read Value
Format A
Format B
Format C
Format D
1
PRGCRC_POLY
0x1021 0000
0x1021 0000
0x1021 0000
0x1021 0000
2
PRGCRC_SEED
0xFFFF 0000
0xFFFF 0000
0xFFFF 0000
0xFFFF 0000
3
PRGCRC_FXOR
0xFFFF 0000
0x0000 FFFF
0xFFFF 0000
0x0000 FFFF
4
PRGCRC_CFG
0x00E0 0000
SZ=11
FI=00
FO=00
0x00E0 0500
SZ=11
FI=01
FO=01
0x00E0 0A00
SZ=11
FI=10
FO=10
0x00E0 0F00
SZ=11
FI=11
FO=11
5
PRGCRC_WR
0x1235 9ABC
0xBC9A 3512
0x48AC 593D
0x3D59 AC48
6
PRGCRC_CFG
0x0060 0000
SZ=01
FI=00
FO=00
0x0060 0500
SZ=01
FI=01
FO=01
0x0060 0A00
SZ=01
FI=10
FO=10
0x0060 0F00
SZ=01
FI=11
FO=11
7
PRGCRC_WR
0x0000 7831
0x0000 3178
0x0000 1E8C
0x0000 8C1E
8
PRGCRC_RD
0xCDBA 0000
0x0000 BACD
0xB35D 0000
0x0000 5DB3

Table of Contents

Related product manuals