
NUC126
Aug. 08, 2018
Page
290
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
6.7.4
Basic Configuration
Clock Source Configuration
–
Enable CRC peripheral clock in CRCCKEN (CLK_AHBCLK[7]).
Reset Configuration
–
Reset CRC in CRCRST (SYS_IPRST0[7]).
User can start to program DATA (CRC_DAT[31:0]) to calculate CRC checksum result in CHECKSUM
(CRC_CHECKSUM[31:0]).
6.7.5
Functional Description
The CRC generator can perform CRC calculation with four common polynomial settings which
includes CRC-CCITT, CRC-8, CRC-16 and CRC-32. User can choose the CRC operation polynomial
mode by setting CRCMODE (CRC_CTL[31:30]).
The following is an example for program sequence of CRC calculation.
1. Enable CRC generator by setting CRCEN (CRC_CTL[0]).
2. Initial setting for CRC calculation.
Configure 1’s complement for CRC checksum by setting CHKSFMT (CRC_CTL[27]).
Configure bit order reverse for CRC checksum by setting CHKSREV (CRC_CTL[25]). The
funcitonal block is also shown in Figure 6.7-2.
Configure 1’s complement for CRC write data by setting DATFMT (CRC_CTL[26]).
Configure bit order reverse for CRC write data by setting DATREV (CRC_CTL[24]). The
functional block is also shown in Figure 6.7-3.
3. Perform CHKSINIT (CRC_CTL[1]) to load the initial checksum value CHECKSUM
(CRC_CHECKSUM[31:0]) from SEED (CRC_SEED[31:0]).
4. Write data to DATA (CRC_DAT[31:0]) to calculate CRC checksum.
5. Get the CRC checksum result by reading CHECKSUM (CRC_CHECKSUM[31:0]).
C
H
E
C
K
S
U
M
B
it
O
rd
e
r
R
e
v
e
rs
e
MSB
LSB
BIT31
BIT30
BIT2
BIT1
BIT0
…
…
…
BIT0
BIT31
BIT30
BIT29
BIT1
…
…
…
…
…
…
…
…
…
Figure 6.7-2 CHECKSUM Bit Order Reverse Functional Block