EasyManua.ls Logo

Cypress FM4 Series - Example of Computing 2

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 953
5.2 Example of Computing 2
This example2 shows computing which checks the CRC code when data is received to the following
64-bit serial bit sequence. This was transmitted in the computing example 1. This example is explained
based on the following conditions.
The bit sequence is received from left to right. The values used for generator polynomial and initial values
are same as those used when the CRC code is generated. The CRC computing results are not inverted.
64-bit received data is stored as 2word-32bit values on the MCU memory.
64-bit sequence with CRC (receive from left to right)
00010010 00110101 10011010 10111100 01111000 00110001
11001101 10111010
Memory storage format
(0x 12 35 9A BC), (0x 78 31 CD BA) ・・・format A (MSB-first/Big Endian)
(0x BC 9A 35 12), (0x BA CD 31 78) ・・・format B (MSB-first/Little Endian)
(0x 48 AC 59 3D), (0x 1E 8C B3 5D) ・・・format C (LSB-first/Big Endian)
(0x 3D 59 AC 48), (0x 5D B3 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 64-bit received data shown above. Table 5-2 below shows examples of the
register setting value, computing input value and computing output value for each storage format
A/B/C/D.
Table 5-2 Example of Value for CRC Computing Example 2
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
0x0000 0000
0x0000 0000
0x0000 0000
0x0000 0000
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
(First time)
0x1235 9ABC
0xBC9A 3512
0x48AC 593D
0x3D59 AC48
6
PRGCRC_WR
(Second time)
0x7831 CDBA
0xBACD 3178
0x1E8C B35D
0x5DB3 8C1E
7
PRGCRC_RD
0x1D0F 0000
0x0000 0F1D
0xB8F0 0000
0x0000 F0B8
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, and same value when the CRC
code is generated)
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, and same value when the CRC code is
generated)
3. Set the PRGCRC_FXOR register. Set 0x0000 0000 without performing bit inversion. (value common
to format A, B, C and D, and is not same value when the CRC code is generated)

Table of Contents

Related product manuals