User Page Erase Sequence

Executing a page erase sequence typically includes the following user code steps, subject to the constraints externally imposed by the Security module:
  1. Load NVMADR with an address within the page to be erased.
  2. Configure NVMCON to page erase:
    • WREN = 1
    • PROGOP = page erase (see NVMCON)
  3. Set the WR bit.
  4. The program sequence completes and the WR bit is cleared by hardware.
  5. Clear WREN bit.
  6. Test the WRERR bit to ensure the erase sequence completed successfully.