XC886/888CLM
Flash Memory
User’s Manual
4-12
V1.3, 2010-02
Flash Memory, V 1.0
4.6
Error Detection and Correction
The 8-bit data from the CPU is encoded with an Error Correction Code (ECC) before
being stored in the Flash memory. During a read access, data is retrieved from the Flash
memory and decoded for dynamic error detection and correction.
The correction algorithm (hamming code) has the capability to:
•
Detect and correct all 1-bit errors
•
Detect all 2-bit errors, but cannot correct
No distinction is made between a corrected 1-bit error (result is valid) and an uncorrected
2-bit error (result is invalid). In both cases, an ECC non-maskable interrupt (NMI) event
is generated; bit FNMIECC in register NMISR is set, and if enabled via
NMICON.NMIECC, an NMI to the CPU is triggered. The 16-bit Flash address at which
the ECC error occurs is stored in the system control SFRs FEAL and FEAH, and can be
accessed by the interrupt service routine to determine the Flash bank/sector in which the
error occurred.
*