We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X
Maximize Your Experience: Reap the Personalized Advantages by Completing Your Profile to Its Fullest! Update Here
Stay in the loop with the latest from Microchip! Update your profile while you are at it. Update Here
Complete your profile to access more resources.Update Here!
Item Qty
Your cart is empty.

What Is CRC?


Whether you are trying to obtain regulatory compliance or to simply design a robust and reliable product, functional safety is an absolute necessity. Several methods can be used to ensure the functional safety of end products. One of them, Cyclic Redundancy Check (CRC), is a powerful technique commonly used to check integrity in digital data. CRC generates an initial checksum of the data in memory that can be later compared with the calculated checksum for mismatch. A checksum mismatch can indicate an otherwise undetectable memory fault.

Why Is CRC Used?


CRC is a vital element of functional safety, and it is one of the key methods required to meet IEC or UL safety standards such as Class B (IEC 60730). Implementation of functional safety techniques is required by law for almost all consumer appliances and industrial electronics.

How Does CRC Work in PIC® and AVR® Microcontrollers


Many modern PIC and AVR microcontrollers (MCUs) have a built-in hardware module for CRC. This allows faster and lower-power CRC calculation without extra memory usage or additional CPU cycles when compared with a software implementation. This hardware module supports up to 32-bit polynomials and is implemented with a Linear Feedback Shift Register (LFSR) to generate a checksum of the data. PIC devices can directly feed data into the CRC module, which is useful for calculating the checksum of an outgoing datastream or for verifying an incoming datastream for transmission errors.

If the device is equipped with the SCAN feature, then the CRC module can directly read the memory on the device. This allows you to automatically validate specific regions of memory, such as boot or application, for system integrity. A more advanced version of the SCAN feature (available on select devices) is CRC On-Boot. This feature can be used to scan and verify areas, such as the boot, application, or data EEPROM with a preprogrammed checksum prior to the device running code.

8-bit Microcontrollers with Cyclic Redundancy Check


Documentation


Application Notes


Title
Using a Hardware or Software CRC with Enhanced Core PIC16F1XXX in Class B Applications Download
CRCSCAN on tinyAVR 0- and 1-series, and megaAVR 0-series Download

Technical Briefs


Title
TB3268 - Using the CRC-on-Boot Download
CRC and Memory Scan on 8-Bit Microcontrollers Download