Operation Of Crc Calculation Circuit - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group

2.11.2 Operation of CRC Calculation Circuit

The following describes the operation of the CRC calculation. Figure 2.11.3 shows an example of calcu-
lation using the CRC-CCITT.
Operation (1) Select CRC-CCITT or CRC-16, and LSB first or MSB first by bit 0 and bit 5 of CRC mode
www.DataSheet4U.com
(1) Setting 0000
(2) Setting 01
(3) Setting 23
Figure 2.11.3. Calculation example using the CRC calculation circuit (when using CRC-CCITT)
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
register.
(2) The CRC calculation circuit sets an initial value in the CRC data register.
(3) 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.
(4) When several bytes of CRC calculation is performed in succession, write the following data in
the CRC input register continuously.
(5) The content of CRC data register after all data is written becomes CRC code.
b15
16
16
b15
1189
The code resulting from sending 01
16
12
5
(X
+ X
+ X
+ 1), becomes the remainder resulting from dividing (1000 0000) X
conformity with the modulo-2 operation.
LSB
1 0001 0000 0010 0001 1000 0000 0000 0000 0000 0000
1000 1000 0001 0000 1
9
Thus the CRC code becomes (1001 0001 1000 1000). Since the operation is in LSB first mode, the (1001 0001 1000 1000)
corresponds to 1189
in hexadecimal notation. If the CRC operation in MSB first mode is necessary in the CRC operation
16
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.
16
b15
0A41
page 251 of 354
b0
CRC data register CRCD
b7
b0
CRC input register
2 cycles
After CRC calculation is complete
b0
CRC data register
16
Stores CRC code
in LSB first mode is (1000 0000). Thus the CRC code in the generating polynomial,
16
1000 1000
1000 0001 0000 1000 0
1000 1000 0001 0000 1
1001 0001 1000 1000
LSB
8
1
1
b7
b0
CRC input register
After CRC calculation is complete
b0
CRC data register
16
Stores CRC code
2. CRC Calculation Circuit
[03BD
, 03BC
]
16
16
CRCIN
[03BE
]
16
CRCD
[03BD
, 03BC
]
16
16
16
by (1 0001 0000 0010 0001) in
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
MSB
CRCIN
[03BE
]
16
CRCD
[03BD
, 03BC
]
16
16

Advertisement

Table of Contents
loading

Table of Contents