Download Print this page

Renesas M16C/50 Series User Manual page 684

Advertisement

M16C/5L Group, M16C/56 Group
CRC calculation and setting procedure to generate CRC, 80C4h
with CRC-16 (MSB first selected)
• CRC operation specification
CRC: remainder of a division,
Generator polynomial: X
• Setting procedures
(1) Write 0000h (initial value) to the CRCD register.
(2) Write 80h to the CRCIN register.
(3) Write C4h to the CRCIN register.
• Details on CRC calculation
As shown in (2) above, add 1000 0000 0000 0000 0000 0000b, as 80h (1000 0000b) written in the CRCIN register 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. Perform the modulo-2 division on the result. The remainder, 1000 0011 0000 0011b (8303h) can be
read from the CRCD register.
When going on to (3) above, add 1100 0100 0000 0000 0000 0000b, as C4h (1100 0100b) written in the CRCIN register
plus 16 digits, to 1000 0011 0000 0011 0000 0000b, as 8303h (1000 0011 0000 0011b) plus 8 digits as a remainder of
(2) left in the CRCD register to perform the modulo-2 division.
The remainder, 0000 0010 1001 0010b (0292h) can be read from the CRCD register.
Figure 25.3
CRC Calculation When Using CRC-16
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
the CRCIN register
generator polynomial
16
15
2
+ X
+X
+ 1 (1 1000 0000 0000 0101b)
b15
CRCD register
CRCIN register
b15
CRCD register
CRCIN register
b15
CRCD register
b0
0000h
b7
b0
80h
After two cycles, 8303h (CRC for 80h) is
stored in the CRCD register.
b0
8303h
b7
b0
C4h
After two cycles, 0292h (CRC for 80C4h)
is stored in the CRCD register.
b0
0292h
25. CRC Calculator
Page 647 of 803

Advertisement

loading