3.2 Page Erase

This algorithm (Table 3-2) erases one page of the Code Flash memory. The erase address is page size-aligned and its least significant parts are “don't care” bits. The Page Erase procedure does not have an effect for the User OTP memory. If FPED or Code-Protect have been enabled, Page Erase will have no effect against the User Configuration A and B areas. Like Bulk Erase, the Page Erase command may have no effect when targeting the UCA page, UCB page or an address range with a security descriptor defining the page as hardware write-protected.

Table 3-2. Page Erase Algorithm
ICSP™ SequenceICSP Command CodeData/OpcodeInstruction Executed
Step 1: Initialize pointers. Move VISI address to W8 and NVMCON address to W9.
CMDEXEC000xA0001F03MOV.SL #VISI, W8
CMDEXEC000xA400C003MOV.SL #NVMCON, W9
Step 2: Move NVMCON address to W0.
CMDEXEC000x00000309MOV.L W9, W0
Step 3: Write 0x4003 to NVMCON to set up for the Page Erase NVM operation.
CMDSEQWR100x00004003MOV.L #PGEDx<31:0>, [W0++]
Step 4: Initialize NVMADR with any address on the target page.
CMDSEQWR10EraseAddress[31:0]MOV.L #PGEDx<31:0>, [W0++]
Step 5: Set the WR bit (NVMCON[15]) to start the NVM operation and move NVMCON to VISI.
CMDEXEC000x8E900431MOVS.W #0xC003, [W9]
CMDEXEC000x83892400MOV.L [W9], [W8]
Step 6: Provide clocks to complete execution of the prior move of NVMCON to VISI by executing a second move of NVMCON to VISI, then shift VISI on PGEDx.
CMDEXEC000x83892400MOV.L [W9], [W8]
CMDRD01VISI
Step 7: Repeat Step 6 to poll the WR bit (NVMCON[15]) until it is clear, indicating completion.