
M0A21/M0A23 Series
May 06, 2022
Page
668
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
–
Enable CRC peripheral clock in CRCCKEN (CLK_AHBCLK[7]).
Reset Configuration
–
Reset CRC controller in CRCRST (SYS_IPRST0[7]).
6.17.5 Functional Description
CRC generator can perform CRC calculation with four common polynomial settings. The operation
polynomial includes CRC-CCITT, CRC-8, CRC-16 and CRC-32; User can choose the CRC operation
polynomial mode by setting CRCMODE[1:0] (CRC_CTL[31:30] CRC Polynomial Mode).
The following is a program sequence example.
1. Enable CRC generator by setting CRCEN (CRC_CTL[0] CRC Channel Enable Bit).
2. Initial setting for CRC calculation.
1)
Configure 1’s complement for CRC checksum by setting CHKSFMT (CRC_CTL[27]
Checksum 1’s Complement).
2)
Configure bit order reverse for CRC checksum by setting CHKSREV (CRC_CTL[25]
Checksum Bit Order Reverse). The funcitonal block is also shown in Figure 6.17-2
CHECKSUM Bit Order Reverse Functional Block
3)
Configure 1’s complement for CRC write data by setting DATFMT (CRC_CTL[26] Write
Data 1’s Complement).
4)
Configure bit order reverse for CRC write data per byte by setting DATREV
(CRC_CTL[24] Write Data Bit Order Reverse). The functional block is also shown in
Figure 6.17-3.
3. Perform CHKSINIT (CRC_CTL[1] Checksum Initialization) to load the initial checksum value
from CRC_SEED register value.
4. Write data to CRC_DAT register to calculate CRC checksum.
5. Get the CRC checksum result by reading CRC_CHECKSUM register.
BIT31
BIT30
BIT2
BIT1
BIT0
…
…
…
BIT0
BIT31
BIT30
BIT29
BIT1
C
H
EC
K
SU
M
B
it
O
rd
er
R
ev
er
se
…
…
…
…
…
…
…
…
…
MSB
LSB
Figure 6.17-2 CHECKSUM Bit Order Reverse Functional Block