![NXP Semiconductors SAFE ASSURE Qorivva MPC5601P Reference Manual Download Page 376](http://html.mh-extra.com/html/nxp-semiconductors/safe-assure-qorivva-mpc5601p/safe-assure-qorivva-mpc5601p_reference-manual_1721898376.webp)
Chapter 17 Flash Memory
MPC5602P Microcontroller Reference Manual, Rev. 4
376
Freescale Semiconductor
Example 17-7. ECC logic check
UT0
= 0xF9F99999;
/* Set UTE in UT0: Enable User Test */
UT1
= 0x55555555;
/* Set DAI31-0 in UT1: Even Word Input Data */
UT2
= 0xAAAAAAAA;
/* Set DAI63-32 in UT2: Odd Word Input Data */
UT0
= 0x80FF0000;
/* Set DSI7-0 in UT0: Syndrome Input Data */
UT0
= 0x80FF0008;
/* Set EIE in UT0: Select ECC Logic Check */
UT0
= 0x80FF000A;
/* Set AIE in UT0: Operation Start */
do
/* Loop to wait for AID=1 */
{ tmp
= UT0;
/* Read UT0 */
} while ( !(tmp & 0x00000001) );
data0
= UMISR0;
/* Read UMISR0 content (expected 0x55555555) */
data1
= UMISR1;
/* Read UMISR1 content (expected 0xAAAAAAAA) */
data2
= UMISR2;
/* Read UMISR2 content (expected 0x55555555) */
data3
= UMISR3;
/* Read UMISR3 content (expected 0xAAAAAAAA) */
data4
= UMISR4;
/* Read UMISR4 content (expected 0x00FF00FF) */
UT0
= 0x00000000;
/* Reset UTE, AIE and EIE in UT0: Operation End */
17.3.8.2
Error Correction Code (ECC)
The Flash macrocell provides a method to improve the reliability of the data stored in Flash: the usage of
an Error Correction Code. The word size is fixed at 64 bits.
Each double word of 64 bits has an associated 8 ECC bits that are programmed in such a way to guarantee
a Single Error Correction and a Double Error Detection (SEC-DED).
ECC circuitry provides correction of single bit faults and is used to achieve automotive reliability targets.
Some units will experience single bit corrections throughout the life of the product with no impact on
product reliability.
17.3.8.2.1
ECC algorithms
The Flash macrocell supports the ECC algorithm “All 1s No Error”.
17.3.8.2.2
All 1s No Error
The All 1s No Error algorithm detects as valid any double word read on a just erased sector (all the 72 bits
are 1s).
This option allows performing a Blank Check after a Sector Erase operation.
17.3.8.3
EEPROM emulation
The chosen ECC algorithm allows some bit manipulations so that a Double Word can be rewritten several
times without needing an erase of the sector. This allows to use a Double Word to store flags useful for the
EEPROM emulation.
As an example the chosen ECC algorithm allows to start from an All ‘1’s Double Word value and rewrite
whichever of its four 16-bit Half-Words to an All ‘0’s content by keeping the same ECC value.
shows a set of Double Words sharing the same ECC value.