![Texas Instruments AM1808 Скачать руководство пользователя страница 866](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_1094558866.webp)
Bit 7
Bit 7
Bit 7
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bit 6
Bit 5
Bit 4
Bit 2
Bit 3
Bit 1
Bit 0
Bit 6
Bit 6
Bit 1
Bit 3
Bit 2
Bit 4
Bit 5
Bit 5
Bit 4
Bit 2
Bit 3
Bit 1
Bit 0
Bit 0
p8o
p8o
p8e
p8e
p16e
p16o
p32e
Byte 1
Byte 2
Byte 3
Byte 4
Bit 6
Bit 6
Bit 6
Bit 6
Byte 2
Bit 7
Byte 4
Byte 3
Bit 7
Bit 7
Byte 1
Bit 7
Bit 1
Bit 3
Bit 2
Bit 4
Bit 5
Bit 5
Bit 5
Bit 4
Bit 4
Bit 2
Bit 2
Bit 3
Bit 3
Bit 1
Bit 1
Bit 5
Bit 4
Bit 2
Bit 3
Bit 1
p16e
p8o
Bit 0
p16o
Bit 0
Bit 0
p8o
p8e
p32o
Bit 0
p8e
p2048e
p2048o
p1o
p1e
p1e
p1o
p1e
p1o
p1o
p1e
p2o
p2e
p2o
p2e
p4o
p4e
Architecture
866
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
External Memory Interface A (EMIFA)
For an 8-bit NAND Flash p1o through p4e are column parities and p8e through p2048o are row parities.
Similarly, the algorithm can be extended to a 16-bit NAND Flash. For a 16-bit NAND Flash p1o through
p8e are column parities and p16e through p2048o are row parities. The software must ignore the
unwanted parity bits if ECC is desired for less than 512 bytes of data. For example. p2048e and p2048o
are not required for ECC on 256 bytes of data. Similarly, p1024e, p1024o, p2048e, and p2048o are not
required for ECC on 128 bytes of data.
Figure 19-15. ECC Value for 8-Bit NAND Flash
19.2.5.6.6.2 4-Bit ECC
The EMIFA supports 4-bit ECC on 8-bit/16-bit NAND Flash. In NAND mode, if the NAND Flash 4-bit ECC
start bit (4BITECC_START) in the in the NAND Flash control register (NANDFCR) is set, the EMIFA
calculates 4-bit ECC for the selected chip select. Only one chip select can be selected for the 4-bit ECC
calculation at one time. The selection of the chip select is done by programming the 4-bit ECC CS select
bit field (4BITECCSEL) in the NAND Flash control register (NANDFCR). The calculated parity (for writes)
and syndrome (for reads) can be read from the NAND Flash 4-bit ECC 1-4 registers
(NAND4BITECC[4:1]). The 4-bit ECC start bit (4BITECC_START) is cleared upon reading any of the
NAND Flash 4-bit ECC 1-4 registers (NAND4BITECC[4:1]). The NAND Flash 4-bit ECC 1-4 registers are
cleared upon writing one to the 4-bit ECC start bit (4BITECC_START).
The 4-bit ECC algorithm works on a 10-bit data bus, but only the lower eight bits of the data bus actually
contain data. When the EMIFA is used in 16-bit mode, the lower and upper 8-bits of the 16-bit data read
from the data bus are fed into the ECC engine one at a time, in that order. In all cases, since only 8-bits of
data are fed to the ECC engine, the upper two bits of the 10-bit data bus that feeds the ECC engine are
always zero. However, the parity and the syndrome value read from the NAND Flash 4-bit ECC 1-4
registers (NAND4BITECC[4:1]) are 10 bits wide. It is the responsibility of software to convert 10-bit parity
values to 8 bits before writing to the spare location of the NAND Flash after a write operation. Similarly, it
is the responsibility of the software to convert the 8-bit parity values read from the spare location of the
NAND Flash after a read operation, to 10 bits before writing the NAND Flash 4-bit ECC load register
(NAND4BITECCLOAD).
The 4-bit ECC employed in the EMIFA interface is a Reed-Solomon error correcting code. The symbol
size is ten bits (two bits are always zero and eight bits contain data as described above). With eight 10-bit
parity words, up to four symbols can be corrected per block read. Though the ECC operation is called 4-
bit, it is important to note that correction can actually happen on up to four 10-bit symbols. Only the lower
eight bits of each 10-bit symbol actually contain data (see above), so correction can happen on up to four
bytes. When bit errors are randomly distributed through the block of data read from the NAND, those
errors are not likely to fall into the same bytes of data, so 4-bits of correction is an apt description.
Technically speaking, however, more than four bits of error can be corrected if multiple bit errors are
confined to four or fewer bytes of the data. If bit errors fall into more than four bytes, the ECC engine will
report that there are too many errors to correct.