Interfacing Processor To NAND Flash Memories
Interfacing Processor To NAND Flash Memories
Interfacing Processor To NAND Flash Memories
Technical notes on using Analog Devices DSPs, processors and development tools
a Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors or
e-mail processor.support@analog.com or processor.tools.support@analog.com for technical support.
Copyright 2006, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of
customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property
of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however
no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.
a
MLC chips provide much larger storage capacity applications. SLC NAND flash is appropriate for
than SLC; however, they also suffer from lower specific, high-performance applications.
bandwidth for read and write operations. Also, SLC NAND flash is better suited for applications
the Error Correcting Code (ECC) requirement for that require speed. It performs many write/erase
MLC is higher than for SLC, as MLC technology
cycles that require high endurance and high
is more prone to bit errors. The cost per bit of reliability, such as in solid-state hard disk drives
MLC flash is much lower than that of SLC and devices used for seismic data recording,
devices. Figure 1 shows the comparison. networking, HDTV, bar code scanners,
Item SLC MLC shockproof PCs, flight recorders, handheld code
storage devices, as well as PDAs and digital still
Storage capacity Small Large
cameras.
Throughput High Low Typical applications that are well-suited for
ECC 1bit/528B 4bit/528B MLC NAND flash memory include digital video
Write/Erase Endurance 100K times 10K times and digital still camera memory cards, USB flash
drives, MP3 players, automobile diagnostic
Cost High Low
monitors, GPS devices, animatronics devices,
Figure 1. SLC vs. MLC Performance Comparison video game cards, and many toy applications.
Applications that may be suited for either MLC
MLC NAND flash memory provides a NAND or SLC NAND technology include
competitive level of performance and makes memory cards for printers (fonts), cell phones,
high-density NAND cards more affordable, telecom applications, voice mail, and TV set-top
enabling new breakthroughs in portable boxes. Figure 2 illustrates the classifications.
Write_Command(0xd0);
while(!Wait_NAND_RADY());
Write_Command(0x70);
delay(50000);
NAND_Data = *pNAND_DATA_REG;
NAND_Finish();
if(NAND_Data != 0xe0)//0xc0)
return false;
for(i = 0;i<DATA_NUM;i++)
*pNAND_DATA_REG = *(psrc+i);
Write_Command(0x10);
while(!Wait_NAND_RADY());
Write_Command(0x70);
delay(5000);
NAND_Data = *pNAND_DATA_REG;
NAND_Finish();
if(NAND_Data != 0xe0)
return false;
else
return true;
}
Write_Command(0x00);
Write_Address(NAND_Address_Table.NAND_Address.NAND_Address_A0_A7,
NAND_Address_Table.NAND_Address.NAND_Address_A8_A11,
NAND_Address_Table.NAND_Address.NAND_Address_A12_A19,
NAND_Address_Table.NAND_Address.NAND_Address_A20_A27,
NAND_Address_Table.NAND_Address.NAND_Address_A28,
0x04);
Write_Command(0x30);
while(!Wait_NAND_RADY());
for(i = 0;i<DATA_NUM;i++)
{
delay(600);
*(pdes+i) = *pNAND_DATA_REG;
}
NAND_Finish();
return true;
}
The basic NAND flash drivers are based on low-level operations, like Write_Command(),
Write_Address(), Wait_NAND_RADY(), and Set_CE(). These operations handle the GPIO and address
signals to manipulate the flash chip. Listing 4 is for the implementation of the write command.
void Write_Command(unsigned char command)
{
Set_CE(0);
Write_NAND_FLASH_Com(command);
}
else
*pFIO_FLAG_D |= PF11;
}
DMA can also be used to perform read/write memory device, which will compromise the
operations from/to the flash memory device. In integrity of the interface and yield unexpected
this case, the programmer should ensure that no results.
other core or DMA accesses happen to any of the CRO screenshots representing timing diagrams
external memory banks. Any such accesses can for this interface are shown in the following
cause spurious RD# and/or WR# pulses to the flash figures.
ECC for NAND Flash Unlike NOR flash, NAND flash demands a
mechanism, such as TrueFFS, to be implemented
Both the SLC and MLC NAND flashes require to map bad blocks.
an Error Correction Code (ECC) to detect and
correct bit errors. The Reed-Solomon algorithm File systems in the industry, such as JFFS,
is well-suited for this and has become the JFFS2, FAT, and so on, are feasible for NAND
standard EEC method for both types of flash flash. Additionally, the YAFFS (Yet Another
memory. Flash File System) is the only file system that
has been designed specifically for use with
The RS encoder and decoder for 72-bit RS NAND flash under any operating system.
(464, 456, 4) code have been implemented and YAFFS uses journaling error correction and
integrated into the NAND flash read/write verification techniques to enhance robustness,
drivers. and is designed to work within the constraints
of⎯and exploit the features of⎯NAND flash in
order to maximize performance. A future
NAND Flash File Systems revision of this EE-note will include the
NAND flash is optimized for file structures implementation of a specific file system for
where each word does not need to be read, but NAND flash.
instead provides that sectors of data can be
moved to and from the media supporting a hard-
drive-like repository structure for data storage to
support file systems and allocation tables (FAT).
References
[1] ADSP-BF533 Blackfin Embedded Processor Data Sheet, Rev. C, May, 2006. Analog Devices, Inc.
[2] MLC NAND Performance for Consumer Applications, Toshiba America Electronic Components, Inc.
[3] K9F2G08U0M 256M x 8 Bit / 512M x 8-Bit NAND Flash Memory Data Sheet, Rev 1.2, October 31, 2005.
Samsung Electronics, Inc.
[4] TC58NVG3D4CTG 8 GBIT (1G × 8 BIT / 512M × 16 BIT) CMOS NAND E2PROM (Multi-Level-Cell) Data Sheet,
TOSHIBA Semiconductor Company.
[5] Application Note for NAND Flash Memory, Rev. 2.0, December 1999, Memory Product & Technology Division from
Samsung Electronics, Inc.
[6] ADSP-BF533 Blackfin Processor Hardware Reference, Rev. 3.2, July 2006. Analog Devices, Inc.
[7] Interfacing NAND Flash Memory with ADSP-2126x SHARC Processors (EE-279), Rev. 1, November 2005.
Analog Devices, Inc.
Document History
Revision Description