English
Language : 

M32C80 Datasheet, PDF (259/352 Pages) Renesas Technology Corp – 16/32-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M32C/80 SERIES
M32C/80 Group
19. CRC Calculation
CRC Calculation and Setup Procedure to Generate CRC Code for "80C416"
CRC Calculation for M32C
value of the CRCIN register with inversed bit position
CRC Code : a remainder of a division,
generator polynomial
Generator Polynomial : X16 + X12 + X5 + 1 (1 0001 0000 0010 00012)
Setting Steps
(1) Inverse a bit position of "80C416" per byte by program
"8016" "0116", "C416" "2316"
b15
(2) Set "000016" (default value)
b7
(3) Set "0116"
b15
118916
b0
CRCD register
b0
CRCIN register
Bit position of the CRC code for "8016"
(918816) is inversed to "118916", which is
stored into the CRCD register in 3rd cycle.
b0
CRCD register
(4) Set "2316"
b7
b0
CRCIN register
Bit position of the CRC code for "80C416"
(825016) is inversed to "0A4116", which is
stored into the CRCD register in 3rd cycle.
b15
b0
0A4116
CRCD register
Details of CRC Calculation
As shown in (3) above, bit position of "0116" (000000012) written to the CRCIN register is inversed and becomes
"100000002".
Add "1000 0000 0000 0000 0000 00002", as "100000002" plus 16 digits, to "000016" 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
data
Generator Polynomial
1000 1000 0001 0000 1
1000 0001 0000 1000 0
1000 1000 0001 0000 1
1001 0001 1000 1000
Modulo-2 Arithmetic is
calculated on the law below.
0+0=0
0+1=1
1+0=1
1+1=0
-1=1
CRC Code
"0001 0001 1000 10012 (118916)", the remainder "1001 0001 1000 10002 (918816)" with inversed bit position, can
be read from the CRCD register.
When going on to (4) above, "2316 (001000112)" written in the CRCIN register is inversed and becomes
"110001002".
Add "1100 0100 0000 0000 0000 00002", as "110001002" plus 16 digits, to "1001 0001 1000 10002" as a
remainder of (3) left in the CRCD register to perform the modulo-2 division.
"0000 1010 0100 00012 (0A4116)", the remainder with inversed bit position, can be read from CRCD register.
Figure 19.3 CRC Calculation
Rev. 1.00 Nov. 01, 2005 Page 240 of 330
REJ09B0271-0100