Crc Calculation Circuit; Crc Snoop - Renesas M16C/26A Series Hardware Manual

16-bit single-chip microcomputer m16c family / m16c/tiny series
Hide thumbs Also See for M16C/26A Series:
Table of Contents

Advertisement

M
1
6
C
2 /
6
A
G
o r
u
p
(
M
1
6

15. CRC Calculation Circuit

The Cyclic Redundancy Check (CRC) operation detects an error in data blocks. The microcomputer uses
a generator polynomial of CRC_CCITT (X
CRC code.
The CRC code is a 16-bit code generated for a block of a given data length in multiples of bytes. The code
is updated in the CRC data register everytime one byte of data is transferred to a CRC input register. The
data register needs to be initialized before use. Generation of CRC code for one byte of data is completed
in two machine cycles.
Figure 15.1 shows the block diagram of the CRC circuit. Figure 15.2 shows the CRC-related registers.
Figure 15.3 shows the calculation example using the CRC_CCITT operation.

15.1. CRC Snoop

The CRC circuit includes the ability to snoop reads and writes to certain SFR addresses. This can be
used to accumulate the CRC value on a stream of data without using extra bandwidth to explicitly write
data into the CRCIN register. All SFR addresses after 0020
snoop is useful to snoop the writes to a UART TX buffer, or the reads from a UART RX buffer.
To snoop an SFR address, the target address is written to the CRC snoop Address Register (bits 9 to
0 in the CRCSAR register). The two most significant bits in this register enable snooping on reads or
writes to the target address. If the target SFR is written to by the CPU or DMA, and the CRC snoop write
bit is set (the CRCSW bit is set to "1"), the CRC will latch the data into the CRCIN register. The new
CRC code will be set in the CRCD register.
Similarly, if the target SFR is read by the CRC or DMA, and the CRC snoop read bit is set (the CRCSR
bit is set to "1"), the CRC will latch the data from the target into the CRCIN register and calculate the
CRC.
The CRC circuit can only calculate CRC codes on data byte at a time. Therefore, if a target SFR is
accessed in a word (16 bit) bus cycle, only the byte of data going to or from the target snooped into
CRCIN, the other byte of the word access is ignored.
Figure 15.1 CRC circuit block diagram
R
e
. v
2
0 .
0
F
e
b
1 .
, 5
2
0
0
7
R
E
J
0
9
B
0
2
0
2
0 -
2
0
0
C
2 /
6
, A
M
1
6
C
2 /
6
, B
M
1
Data bus high-order
Data bus low-order
Eight low-order bits
CRCD register (16)
CRC code generating circuit
16
12
5
16
x
+ x
+ x
+ 1 OR x
+ x
CRC input register (8)
(Address 03BE
Address Bus
page 213
f o
3
2
9
6
C
2 /
6
) T
16
12
5
+ X
+ X
+ 1) or CRC-16 (X
are subject to the CRC snoop. The CRC
16
Eight high-order bits
(Address 03BD
15
2
+ x
+ 1
)
16
15. CRC Calculation Circuit
16
15
2
+ X
+ X
, 03BC
)
16
16
Snoop Address
Equal?
+ 1) to generate
SnoopB
lock
Snoop
enable

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/26aM16c/26bM16c/26t

Table of Contents