Renesas M16C/62P Series Hardware Manual page 269

6-bit single-chip microcomputer
Table of Contents

Advertisement

M16C/62P Group (M16C/62P, M16C/62PT)
Setup procedure and CRC operation when generating CRC code "80C4h"
• CRC operation performed by the M16C
CRC code: Remainder of a division in which the value written to the CRCIN register with its bit positions reversed is
divided by the generator polynomial
Generator polynomial: X
• Setting procedure
(1) Reverse the bit positions of the value "80C4h" by program in 1-byte units.
"80h"
(2) Write 0000h (initial value)
(3) Write 01h
(4) Write 23h
• Details of CRC operation
As shown in (3) above, bit position of "01h" (00000001b) written to the CRCIN register is inversed and becomes
"10000000b".
Add "1000 0000 0000 0000 0000 0000b", as "10000000b" plus 16 digits, to "0000 0000 0000 0000 0000 0000b",
as "0000 0000 0000 0000b" plus 8 digits as the default value of the CRCD register to perform the modulo-2 division.
1 0001 0000 0010 0001 1000 0000 0000 0000 0000 0000
Generator polynomial
"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 inversed and becomes
"11000100b".
Add "1100 0100 0000 0000 0000 0000b", as "11000100b" plus 16 digits, to "1001 0001 1000 1000 0000 0000b", as
"1001 0001 1000 1000b" plus 8 digits as a remainder of (3) left in the CRCD register to perform the modulo-2 division.
"0000 1010 0100 0001b (0A41h)", the remainder with inversed bit position, can be read from CRCD register.
Figure 20.3
CRC Calculation
Rev.2.41
Jan 10, 2006
REJ09B0185-0241
http://www.xinpian.net
16
12
5
+ X
+ X
+ 1 (1 0001 0000 0010 0001b)
"01h", "C4h"
"23h"
b15
b15
b15
1000 1000 0001 0000 1
1000 0001 0000 1000 0
1000 1000 0001 0000 1
CRC code
Page 254 of 390
提供单片机解密、IC解密、芯片解密业务
b0
CRCD register
b7
b0
CRCIN register
Two cycles later, the CRC code for "80h", i.e.,
9188h, has its bit positions reversed to become
"1189h" which is stored in the CRCD register.
b0
CRCD register
1189h
b7
b0
CRCIN register
Two cycles later, the CRC code for "80C4h", i.e.,
8250h, has its bit positions reversed to become
"0A41h" which is stored in the CRCD register.
b0
CRCD register
0A41h
1000 1000
Data
1001 0001 1000 1000
20. CRC Calculation
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
010-62245566 13810019655

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/62pM16c/62pt

Table of Contents