27.5.6.6 Erase

Before a page can be written, it must be erased. The erase granularity depend on the address space (block or page). The Erase Block/Page command can be used to erase the desired block or page in the NVM main address space. Erasing the block/page sets all bits to ‘1’. If the block/page resides in a region that is locked, the erase will not be performed and the Lock Error bit in the INTFLAG register (INTFLAG.LOCKE) will be set. INTFLAG.PROGE will also be set since the command didn’t complete. The Erase Page command can be issued on the USER page in the auxiliary space.

The procedure for an Erase Block/Page command is as follows:

  • Write the address of the block/page to erase to ADDR. Any address within the block/page can be used.
  • Issue an Erase Block/Page command.

The page buffer can be written while an erase page or erase block is being performed.