English
Language : 

M16C62_M Datasheet, PDF (470/615 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/60 SERIES
CRC Calculation Circuit
Mitsubishi microcomputers
M16C / 62A Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.10.2 Operation of CRC Calculation Circuit
The following describes the operation of the CRC calculation. Figure 2.10.3 shows an example of calcu-
lation data 012316 using the CRC calculation circuit.
Operation (1) The CRC calculation circuit sets an initial value in the CRC data register.
(2) Writing 1 byte data to the CRC input register generates CRC code based on the data register.
CRC code generation for 1 byte data finishes in two machine cycles.
(3) The CRC calculation circuit detects an error by means of comparing the CRC-checking data
with the content of the CRC data register, after the next data is written to the CRC input
register.
(4) The content of CRC data register after all data is written becomes CRC code.
b15
(1) Setting 000016
b0
CRC data register CRCD
[03BD16, 03BC16]
(2) Setting 0116
b15
b7
118916
b0
CRC input register
CRCIN
[03BE16]
2 cycles
After CRC calculation is complete
b0
CRC data register
CRCD
[03BD16, 03BC16]
Stores CRC code
The code resulting from sending 0116 in LSB first mode is (1000 0000). Thus the CRC code in the generating polynomial,
(X16 + X12 + X5 + 1), becomes the remainder resulting from dividing (1000 0000) X16 by (1 0001 0000 0010 0001) in
conformity with the modulo-2 operation.
LSB
1 0001 0000 0010 0001
1000 1000
1000 0000 0000 0000 0000 0000
1000 1000 0001 0000 1
1000 0001 0000 1000 0
1000 1000 0001 0000 1
1001 0001 1000 1000
LSB
98
11
MSB
MSB
Modulo-2 operation is
operation that complies
with the law given below.
0+0=0
0+1=1
1+0=1
1+1=0
-1 = 1
Thus the CRC code becomes (1001 0001 1000 1000). Since the operation is in LSB first mode, the (1001 0001 1000 1000)
corresponds to 118916 in hexadecimal notation. If the CRC operation in MSB first mode is necessary in the CRC operation
circuit built in the M16C, switch between the LSB side and the MSB side of the input-holding bits, and carry out the CRC
operation. Also switch between the MSB and LSB of the result as stored in CRC data.
(3) Setting 2316
b7
b0
CRC input register CRCIN
[03BE16]
b15
0A4116
After CRC calculation is complete
b0
CRC data register
CRCD
[03BD16, 03BC16]
Stores CRC code
Figure 2.10.3. Calculation example using the CRC calculation circuit
2-153