English
Language : 

M32C8A Datasheet, PDF (292/372 Pages) Renesas Technology Corp – RENESAS MCU M16C FAMILY / M32C/80 Series
M32C/8A Group
20. CRC Calculation
CRC Calculation and Setup Procedure to Generate CRC Code for 80C4h
CRC Calculation for M32C
CRC code: a remainder of division,
value of the CRCIN register with inversed bit position
Generator polynomial
Generator polynomial: X16 + X12 + X5 + 1 (1 0001 0000 0010 0001b)
Setting Steps
(1) Invert a bit position of 80C4h per byte by program
80h 01h, C4h 23h
b15
(2) Set 0000h (default value)
b0
CRCD register
(3) Set 01h
b7
b15
1189h
b0
CRCIN register
Bit position of the CRC code for 80h (9188h)
is inverted to 1189h, which is stored into the
CRCD register in the 3rd cycle.
b0
CRCD register
(4) Set 23h
b7
b15
0A41h
b0
CRCIN register
Bit position of the CRC code for 80C4h
(8250h) is inverted to 0A41h, which is stored
into the CRCD register in the 3rd cycle.
b0
CRCD register
Details of CRC Calculation
As shown in (3) above, bit position of 01h (00000001b) written to the CRCIN register is inverted to 10000000b.
Add 1000 0000 0000 0000 0000 0000b, as 10000000b plus 16 digits, to 0000h as the default value of the
CRCD register to perform the modulo-2 division.
1000 1000
1 0001 0000 0010 0001 1000 0000 0000 0000 0000 0000
Generator
polynomial
1000 1000 0001 0000 1
1000 0001 0000 1000 0
1000 1000 0001 0000 1
1001 0001 1000 1000
CRC code
Data
Modulo-2 Arithmetic is
calculated on the law below
0+0=0
0+1=1
1+0=1
1+1=0
-1 = 1
0001 0001 1000 1001b (1189h), the remainder 1001 0001 1000 1000b (9188h) with inversed bit position, can be
read from the CRCD register.
When going on to (4) above, 23h (00100011b) written in the CRCIN register is inverted to 11000100b.
Add 1100 0100 0000 0000 0000 0000b plus 16 digits, to 1001 0001 1000 1000b as a remainder of (3) left in the
CRCD register to perform the modulo-2 division.
0000 1010 0100 0001b (0A41h), the remainder with inverted bit position, can be read from CRCD register.
Figure 20.3 CRC Calculation
Rev.1.00 Jul 15, 2007 Page 275 of 352
REJ09B0385-0100