6.4.9 WRERR Bit

The WRERR bit in the NVMCON1 register can be used to determine if a write error occurred. WRERR will be set if one of the following conditions occurs:
  • If WR is set while the NVMADRH:NMVADRL points to a write-protected address
  • A Reset occurs while a self-write operation was in progress
  • An unlock sequence was interrupted

The WRERR bit is normally set by hardware, but can be set by the user for test purposes. Once set, WRERR must be cleared in software.

Table 6-3. Actions for PFM When WR = 1
Free LWLO Actions for PFM When WR = 1 Comments
1 x Erase the 32-word row of the NVMADRH:NVMADRL location
  • If WP is enabled, WR is cleared and WRERR is set
  • All 32 words are erased
  • NVMDATH:NVMDATL is ignored
0 1 Copy NVMDATH:NVMDATL to the write latch corresponding to the NVMADR LSBs
  • Write protection is ignored
  • No memory access occurs
0 0 Write the write-latch data to PFM row
  • If WP is enabled, WR is cleared and WRERR is set
  • Write latches are reset to 0x03FF
  • NVMDATH:NVMDATL is ignored