
Rev.2.10 Apr 14, 2006 page 221 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 18. CRC Calculation
18. CRC Calculation
The Cyclic Redundancy Check (CRC) operation detects an error in data blocks. The MCU uses a generator
polynomial of CRC-CCITT (X
16
+ X
12
+ X
5
+ 1) to generate CRC code.
The CRC code consists of 16 bits which are generated for each data block in given length, separated in 8-bit
unit. After the initial value is set in the CRCD register, the CRC code is set in that register each time one byte
of data is written to the CRCIN register. CRC code generation for one-byte data is finished in two cycles.
Figure 18.1 shows the CRC Circuit Block Diagram. Figure 18.2 shows the CRC-related registers. Figure
18.3 shows the calculation example using the CRC operation.
Figure 18.2 Registers CRCD and CRCIN
Figure 18.1 CRC Circuit Block Diagram
When data is written to the CRCIN register after setting
the initial value in the CRCD register, the CRC code can
be read out from the CRCD register.
0000h to FFFFh
Function Setting Range
RW
RW
CRCD
Symbol After Reset
Undefined
03BDh to 03BCh
Address
b7 b0 b7 b0
(b15) (b8)
CRC Data Register
Data input
00h to FFh
Function Setting Range
RW
RW
CRCIN
Symbol After Reset
Undefined
03BEh
Address
b7 b0
CRC Input Register
High-order 8 bitsLow-order 8 bits
CRCIN register
x
16
+x
12
+x
5
+1
Data bus high-order
Data bus low-order
CRCD register
CRC code generation circuit
Comentários a estes Manuais