27.3.1 Initialization
To enable a CRC in software (or via the debugger):
- Write the MODE and Source (SRC) bit fields of the Control B register (CRCSCAN.CTRLB) to select the desired mode and source settings.
- Enable the CRCSCAN by writing a '1' to the ENABLE bit in the Control A register (CRCSCAN.CTRLA).
The CRCSCAN can be enabled during the internal reset initialization to ensure the Flash is OK before letting the CPU execute code. If the CRCSCAN fails during the internal reset initialization, the CPU is not allowed to start normal code execution. The full source settings are available during the internal reset initialization. See the Fuse description for more information.
If the CRCSCAN was enabled during the internal reset initialization, the CRC
Control A and B registers will reflect this when normal code execution is started:
- The ENABLE bit in CRCSCAN.CTRLA will be '1'
- The MODE bit field in CRCSCAN.CTRLB will be BACKGROUND
- The SRC bit field in CRCSCAN.CTRLB will reflect the checked section(s).