English
Language : 

PIC24EP256GU810-I Datasheet, PDF (462/622 Pages) Electronic Film Capacitors, Inc. – 16-Bit Microcontrollers and Digital Signal Controllers with High-Speed PWM, USB and Advanced Analog
dsPIC33EPXXX(GP/MC/MU)806/810/814 and PIC24EPXXX(GP/GU)810/814
27.1 Overview
The CRC module can be programmed for CRC
polynomials of up to the 32nd order, using up to 32 bits.
Polynomial length, which reflects the highest exponent
in the equation, is selected by the PLEN<4:0> bits
(CRCCON2<4:0>).
The CRCXORL and CRCXORH registers control which
exponent terms are included in the equation. Setting a
particular bit includes that exponent term in the
equation; functionally, this includes an XOR operation
on the corresponding bit in the CRC engine. Clearing
the bit disables the XOR.
For example, consider two CRC polynomials, one a
16-bit equation and the other a 32-bit equation:
x16 + x12 + x5 + 1
and
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7
+ x5 + x4 + x2 + x + 1
To program these polynomials into the CRC generator,
set the register bits as shown in Table 27-1.
Note that the appropriate positions are set to ‘1’ to indicate
that they are used in the equation (for example, X26 and
X23). The 0 bit required by the equation is always XORed;
thus, X0 is a don’t care. For a polynomial of length, N, it is
assumed that the Nth bit will always be used, regardless
of the bit setting. Therefore, for a polynomial length of 32,
there is no 32nd bit in the CRCxOR register.
TABLE 27-1:
CRC
Control Bits
PLEN<4:0>
X<31:16>
X<15:0>
CRC SETUP EXAMPLES FOR
16 AND 32-BIT POLYNOMIAL
Bit Values
16-Bit
Polynomial
32-Bit
Polynomial
01111
0000 0000
0000 000x
0001 0000
0010 000x
11111
0000 0100
1100 0001
0001 1101
1011 011x
27.2 Programmable CRC Resources
Many useful resources related to Programmable CRC
are provided on the main product page of the Microchip
web site for the devices listed in this data sheet. This
product page, which can be accessed using this link,
contains the latest updates and additional information.
Note:
In the event you are not able to access the
product page using the link above, enter
this URL in your browser:
http://www.microchip.com/wwwproducts/
Devices.aspx?dDocName=en554310
27.2.1 KEY RESOURCES
• Section 27. “Programmable Cyclic Redundancy
Check (CRC)” (DS70346) in the “dsPIC33E/
PIC24E Family Reference Manual”
• Code Samples
• Application Notes
• Software Libraries
• Webinars
• All related “dsPIC33E/PIC24E Family Reference
Manual” Sections
• Development Tools
DS70616G-page 462
 2009-2012 Microchip Technology Inc.