5.7.4 Cyclic Redundancy Check (CRC)

AVR and PIC32CM MCUs provide hardware support for Cyclic Redundancy Check (CRC) to ensure data and code integrity, which is crucial for safety and reliability in embedded systems. Both MCUs can perform CRC checks over memory regions (such as Flash or SRAM), support standard CRC polynomials, and can trigger system responses (such as interrupts or resets) if a CRC mismatch is detected. These features help prevent the execution of corrupted code and enable robust error detection in data transfers or memory checks. Table 5-30 shows a comparison of features between AVR and PIC32CM.

Table 5-30. AVR® and PIC32CM CRC Features
Feature/AspectAVR® CRC (CRCSCAN)PIC32CM CRC (DSU, DMAC)
IntegrationStand-alone CRCSCAN peripheralIntegrated into Device Service Unit (DSU) and Direct Memory Access Controller (DMAC)
User ConfigurationSelectable region and polynomialSelectable region and polynomial (DMAC)
Supported Polynomials

CRC-16-CCITT

CRC-32 (IEEE® 802.3)

DSU: CRC-32

DMAC: CRC-16-CCITT & CRC-32

Memory RegionsFlash (entire, boot, or application section)Any memory accessible via bus matrix (Flash, SRAM)
Trigger/ControlCan run at reset, initialize, or by softwareCommand issued via DSU or DMAC
Status/ResultSupportedSupported
InterruptsNMI on CRC failureNo direct NMI, but can trigger interrupts/events
DMA IntegrationN/ADMAC can perform CRC on transferred data
Software FallbackSupportedSupported