![Texas Instruments EMIF16 Скачать руководство пользователя страница 29](http://html.mh-extra.com/html/texas-instruments/emif16/emif16_user-manual_1097088029.webp)
3.6 Checking the Status of Operation
SPRUGZ3A—May 2011
KeyStone Architecture External Memory Interface (EMIF16) User Guide
3-5
Chapter 3—Operating Modes
www.ti.com
3.6 Checking the Status of Operation
The NAND Flash status register (NANDFSR) can be used to check the status of the
WAIT pin while in NAND Flash Mode. This is accomplished by connecting the WAIT
pin to the R/B# pin. For reads, the R/B# signal goes low and remains low while the
NAND Flash retrieves the data requested. R/B# signal goes high to indicate that the
data requested by the EMIF16 is ready to be read. During a write/program operation,
the R/B# goes low and remains low while the NAND Flash programs the device with
the write data from the EMIF16. Once the device is free to accept the next transaction,
the R/B# signal goes high. Thus, software can use the NANDFSR to determine the
status of the Flash device and determining when to submit the next transaction. The
Wait Rise (WR) interrupt in the Interrupt Raw Register (IRR) can also be used to check
for a rising edge on the appropriate WAIT pin. For details on interrupt support and
handling refer to
3.7 ECC Support
For data integrity purposes, NAND Flash supports ECC. EMIF16 supports 1-bit ECC
calculation for up to 512 Bytes and 4-bit ECC calculation for up to 518 Bytes.
1-bit ECC calculation for NAND device connected to a specific chip select is set off by
writing a ‘1’ to the CSN_ECC_START bit of the NAND Flash Control Register
(NANDFCR). 1-bit ECC calculation for each chip select is independent of other chip
selects. Once the 1-bit ECC is calculated for a chip select, it can be read from the
corresponding chip select’s NAND Flash 1-bit ECC Register. Reading this register
clears the CSN_ECC_START bit. Software is responsible for initiating the ECC
calculation before starting to write or read data from the NAND Flash.
It is also the responsibility of the software to read the calculated 1-bit ECC from the
NAND Flash 1-Bit ECC register for the corresponding chip select after writing or
reading the required number of data bytes from the NAND Flash. If the software writes
or reads greater than 512 bytes before reading the NAND Flash ECC register, the value
of the 1-bit ECC will be incorrect.
shows how 1-bit ECC calculation is performed on a 512 Byte block of data
for an 8-bit NAND Flash device.
Figure 3-3
1-bit ECC calculation for 8-bit NAND device
Byte 1
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8e
p16e
p32e
…
…
p2048e
Byte 2
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8o
Byte 3
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8e
p16o
Byte 4
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8o
.
.
.
.
.
.
p2048o
Byte 509
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8e
p16e
p32o
Byte 510
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8o
Byte 511
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8e
p16o
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
p8o
Byte 512
p1o
p1e
p1o
p1e
p1o
p1e
p1o
p1e
p20
p2e
p20
p2e
p4o
p4e