Sequence for Execution of Self-Programming

To execute self-programming (the execution of writes to the NVM controller’s command register), the following steps are required:

  1. 1.The software temporarily enables self-programming by writing the SPM signature to the CCP register (CPU.CCP).
  2. 2.Within four instructions, the software must execute the appropriate instruction. The protected change is immediately disabled if the CPU performs accesses to the Flash, NVMCTRL, or EEPROM, or if the SLEEP instruction is executed.