1.5 Configuration Change Protection (CCP) Registers

CCP registers are used to protect system-critical I/O register settings from accidental modification, as well as Flash self-programming from accidental execution. Writing to a register under CCP is possible only after writing a specific signature/key to the CCP register, which is part of the CPU module. The values of the signatures can be found in the Configuration Change Protection subsection of the device data sheet.

There are two types of writes to a protected register, each with its key:

  • protected I/O registers (the key/signature is IOREG)
  • protected self-programming (the key/signature is SPM)

Some of the registers that are under the Configuration Change Protection are listed in the table below.

Register NameKeyFunctionality
CLKCTRL.MCLKCTRLAClock Controller – Main Clock Control AIOREGIt allows the user to select the clock source for the main clock and to output the clock
CLKCTRL.MCLKLOCKClock Controller – Main Clock LockIOREGIt allows the user to lock the Main Clock Control registers
RSTCTRL.SWRRReset Controller – Software Reset EnableIOREGIt allows the user to apply a software Reset to the device
IVSEL in CPUINT.CTRLACPU Interrupt Controller – the Interrupt Vector Select bit from the CTRLA register IOREGIt allows the user to place the interrupt vector at the start of the application section of Flash or the start of the boot section of Flash
NVMCTRL.CTRLANonvolatile Memory Controller – the CTRLA registerSPM

It allows the user to issue one of the next commands:

  • Write page buffer to memory
  • Erase page
  • Erase and write page
  • Page buffer clear, etc.

Changes to the protected I/O registers or bits, or execution of protected instructions are only possible after the CPU writes one of these signatures to the CCP register. The signatures are listed in the description of the CCP (CPU.CCP) register.

A code example is provided in Writing to Configuration Change Protection (CCP) Registers.