R01UH0823EJ0100 Rev.1.00
Page 1416 of 1823
Jul 31, 2019
RX23W Group
39. CRC Calculator (CRC)
39.3
Operation
The CRC calculator generates CRC codes for use in LSB first or MSB first transfer.
The following shows examples of generating the CRC code for input data (F0h) using the 16-bit CRC generating
polynomial (X
16
+ X
12
+ X
5
+ 1). In these examples, the value of the CRC data output register (CRCDOR) is cleared
before CRC calculation.
When an 8-bit CRC (with the polynomial X
8
+ X
2
+ X + 1) is in use, the valid bits of the CRC code are obtained in the
lower-order byte of the CRCDOR register.
Figure 39.2
LSB First Data Transmission
Figure 39.3
MSB First Data Transmission
CRCDOR
CRCCR
Clear CRCDOR
1
7
0
0
0
0
0
0
7
0
15
0
1
1
0
0
0
0
0
0
0
0
CRCDIR
CRC code generation
1
1
1
1
0
0
0
0
CRC code
Output
Data
7
7
7
F
F
F
0
8
0
0
1
1
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
2. Write F0h to the CRC data input register (CRCDIR)
3. Read the calculation result in the CRC data output register (CRCDOR)
CRC code = F78Fh
4. 8-bit serial transmission (LSB first)
1. Write 83h to the CRC control register (CRCCR)
0
0
0
0
0
0
0
0
CRCDOR
15
0
1
1
1
1
0
1
1
1
1
0
0
0
1
1
1
1
7
8
7
8
7
0
CRCDOR
CRCCR
Clear CRCDOR
1
7
0
0
0
0
1
0
7
0
15
0
1
1
0
0
0
0
0
0
0
0
CRCDIR
CRC code generation
1
1
1
1
0
0
0
0
CRC code
Output
Data
7
7
0
F
F
1
F
E
0
0
1
1
1
1
0
0
0
0
1
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
2. Write F0h to the CRC data input register (CRCDIR)
3. Read the calculation result in the CRC data output register (CRCDOR)
CRC code = EF1Fh
4. 8-bit serial transmission (MSB first)
1. Write 87h to the CRC control register (CRCCR)
0
0
0
0
0
0
0
0
CRCDOR
15
0
1
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
7
8
7
8
7
0