2.4.2 Starting and Stopping a Programming Cycle

For protection against accidental operations, the erase/write initiation sequence must be written to the NVMKEY register to allow any erase or program operation to proceed. The two instructions following the start of the programming sequence should be NOPs. To start an erase or write sequence, the following steps must be completed:

  1. Write 0x55 to the NVMKEY register.
  2. Write 0xAA to the NVMKEY register.
  3. Set the WR bit in the NVMCON register.
  4. Execute three NOP instructions.

The WR bit can be polled to generate enough clock cycles for the programming operation and to determine if the erase or write cycle has been completed.