English
Language : 

PIC18LF24K Datasheet, PDF (159/594 Pages) –
PIC18(L)F26/45/46K40
13.3 CRC Functional Overview
The CRC module can be used to detect bit errors in the
Flash memory using the built-in memory scanner or
through user input RAM memory. The CRC module can
accept up to a 16-bit polynomial with up to a 16-bit seed
value. A CRC calculated check value (or checksum)
will then be generated into the CRCACC<15:0>
registers for user storage. The CRC module uses an
XOR shift register implementation to perform the
polynomial division required for the CRC calculation.
EXAMPLE 13-1: CRC EXAMPLE
CRC-16-ANSI
x16 + x15 + x2 + 1 (17 bits)
Rev. 10-000206A
1/8/2014
Standard 16-bit representation = 0x8005
CRCXORH = 0b10000000
CRCXORL = 0b0000010- (1)
Data Sequence:
0x55, 0x66, 0x77, 0x88
DLEN = 0b0111
PLEN = 0b1111
Data entered into the CRC:
SHIFTM = 0:
01010101 01100110 01110111 10001000
SHIFTM = 1:
10101010 01100110 11101110 00010001
Check Value (ACCM = 1):
SHIFTM = 0: 0x32D6
CRCACCH = 0b00110010
CRCACCL = 0b11010110
SHIFTM = 1: 0x6BA2
CRCACCH = 0b01101011
CRCACCL = 0b10100010
Note 1: Bit 0 is unimplemented. The LSb of any
CRC polynomial is always ‘1’ and will always
be treated as a ‘1’ by the CRC for calculating
the CRC check value. This bit will be read in
software as a ‘0’.
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 159