User Word Programming Sequence

A word programming sequence typically includes the following steps, subject to the constraints externally imposed by the Security module:

  1. Write data to be programmed to NVMDATAx.
  2. Load NVMADR with the Flash address to be programmed.
  3. Configure NVMCON to word program:
    • WREN = 1
    • PROGOP = Word program (see NVMCON)
  4. Set the WR bit.
  5. The program sequence completes and the WR bit is cleared by hardware.
  6. Clear WREN bit.
  7. Test the WRERR bit to ensure the program sequence completed successfully.
Note: Writes to NVMDATAx registers are inhibited while WR = 1.