English
Language : 

PIC24FJ128GA010_09 Datasheet, PDF (169/240 Pages) Microchip Technology – 64/80/100-Pin General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA010 FAMILY
19.0 PROGRAMMABLE CYCLIC
REDUNDANCY CHECK (CRC)
GENERATOR
Note:
This data sheet summarizes the features
of this group of PIC24F devices. It is not
intended to be a comprehensive reference
source. Refer to Section 30. “Program-
mable Cyclic Redundancy Check
(CRC)” (DS39714) in the “PIC24F Family
Reference Manual” for more information.
The programmable CRC generator offers the following
features:
• User-programmable polynomial CRC equation
• Interrupt output
• Data FIFO
19.1 Registers
There are four registers used to control programmable
CRC operation:
• CRCCON
• CRCXOR
• CRCDAT
• CRCWDAT
FIGURE 19-1:
CRC SHIFTER DETAILS
19.2 Overview
The module implements a software configurable CRC
generator. The terms of the polynomial and its length
can be programmed using the CRCXOR (X<15:1>) bits
and the CRCCON (PLEN3:PLEN0) bits, respectively.
Consider the following equation:
EQUATION 19-1: CRC POLYNOMIAL
x16 + x12 + x5 + 1
To program this polynomial into the CRC generator,
the CRC register bits should be set as shown in
Table 19-1.
TABLE 19-1: EXAMPLE CRC SETUP
Bit Name
Bit Value
PLEN3:PLEN0
X<15:1>
1111
000100000010000
Note that for the value of X<15:1>, the 12th bit and the
5th bit are set to ‘1’, as required by the equation. The 0 bit
required by the equation is always XORed. For a 16-bit
polynomial, the 16th bit is also always assumed to be
XORed; therefore, the X<15:1> bits do not have the 0 bit
or the 16th bit.
The topology of a standard CRC generator is shown in
Figure 19-2.
PLEN<3:0>
0
Hold
XOR
DOUT
OUT
IN
BIT 0
p_clk
1
2
X1
Hold
CRC Shift Register
X2
Hold
0
OUT
IN
BIT 1
1
p_clk
0
OUT
IN
BIT 2
1
p_clk
15
X3 X15
Hold
0
0
OUT
IN
1
1
BIT 15
p_clk
CRC Read Bus
CRC Write Bus
© 2009 Microchip Technology Inc.
DS39747E-page 169