[메모리]

NAND Flash vs. NOR Flash

Neo Park 2012. 2. 6. 16:39

 

 

Beside the different silicon cell design, the most important difference between NAND and NOR Flash is the bus interface.
 NOR Flash is connected to a address / data bus direct like other memory devices as SRAM etc.
NAND Flash uses a multiplexed I/O Interface with some additional control pins. NAND flash is a sequential access
device appropriate for mass storage applications, while NOR flash is a random access device appropriate for code storage application.NOR Flash can be used for code storage and code execution.
Code stored on NAND Flash can't be executed frome there. It must be loaded into RAM memory and executed from there.
NOR Flash와 NAND Flash의 가장 큰 차이는  버스 인터페이스이다. NOR Flash는 SRAM과 같은
다른 메모리 디바이스들과 마찬가지로 어드레스/데이타 버스에 바로 연결된다. NAND Flash는 몇명 제어핀이
추가된 다중화된 I/O 인터페이스를 사용한다. NOR Flash가 코드 저장에 적합한 랜덤 엑세스 디바이스인데 반해
NAND Flash는 데이타 저장에 적합한 순차 엑세스 디바이스다.
NOR Flash가 코드가 저장/실행되는 저장 장치인데 반해 NAND Flash 저장된 코드는 NAND Flash상에서 수행될 수 없다.
NAND Flash에 저장된 코드는 RAM으로 로드되어야만 수행될 수 있다.

NOR NAND
Interface Bus I/O
Cell Size Large Small
Cell Cost High Low
Read Time Fast Slow
Program Time single Byte Fast Slow
Program Time multi Byte Slow Fast
Erase Time Slow Fast
Power consumption High Low, but requires additional RAM
Can execute code Yes No, but newer chips can execute a small loader out of the first page(삼성의 oneNAND가 여기에 해당된다.)
Bit twiddling nearly unrestricted 1-3 times, also known as "partial page program restriction"
Bad blocks at ship time No Allowed

Some facts about write speed.
NAND is typically faster than NOR for large writes. A typical NOR write is 10uS per word,
which results in 1280uS per 512 bytes on a 32-bit bus. A typical NAND write is 50nS per byte + 10uS page
seek + 200uS program which results in 236uS per 512 bytes on a 8 bit bus.
As NAND Flash is cheaper than NOR Flash and has a very slim interface it was selected as the optimum solution
for large nonvolatile storage applications such as solid state file storage, digital audio/voice recorder,
 digital still camera and portable applications requiring non-volatility.
 
속도에 관한 몇몇 사실.
일반적으로 NAND는 대량 기록시 NOR보다 빠르다. NOR의 전형적인 기록속도는 32-비트 버스상에서 512-바이트를 기록하였을 때,
1280uS로 워드당 10us 정도이다. NAND의 경우 8-비트 버스를 통해 512-바이트를 기록하였을 때,
236uS로 이는 바이트당 50nS에 200uS의 기록시간과 10uS의 페이지 탐색시간을 합한 수치이다.
NAND Flash는 NOR Flash에 비해 저렴한데다 작은 인터페이스이므로 대용량의 비 휘발성 저장 매체를 필요로하는
어플리케이션에서는 가장 적합한 선택이될 수 있다.

NAND Types

There are various types of NAND Flash available. Bare NAND chips, SmartMediaCards, DiskOnChip.
SmartMediaCards are bare NAND chips covered by thin plastic. They are very common in digital cameras and MP3 players. T
he card itself contains nothing smart at all. It gets smart by software.
DiskOnChip is NAND Flash with additional glue logic as a drop in replacement for NOR Flash chips.
The glue logic provides direct memory access to a small address window, which contains a boot loader stub,
which loads the real boot code from the NAND device. The logic contains also control registers for
the static NAND chip control lines and a hardware ECC generator.
 
NAND flash의 종류에는 깡짜 NAND 칩, SmartMediaCard, DiskOnChip등이 있다.
SmartMediaCard는 깡짜 NAND에 껍데기를 입혀놓은 놈으로 디카와 MP3 플레이어에 주로 사용된다.
카드 자체에는 smart한 기능이 전혀 들어가 있지 않으며 SW에 의해서 smart 해진다.
DiskOnChip은 NOR Flash를 대체할 수 있도록 글루 로직이 추가되어있다. 이 글루 로직은 아주 작은 메모리 윈도우를
CPU의 주소 공간에서 직접적으로 바라 볼 수 있도록 해주며 이 메모리 윈도우에는 NAND 디바이스에 저장된
실제 부트 코드를 로드하는 코드가 저장된다. 또한 여기에는 NAND chip 제어 라인과 HW ECC 제너레이터를 제어할 때
사용되는 레지스터가 포함되어 있다.

NAND technical view

The memory is arranged as a array of pages. A page consists of 256 / 512 Byte data and 8 /
16 Byte spare (out of band) area. Newer chips have 2048 Bytes data and and 64 Bytes spare area sizes.
The spare area is used to store ECC (error correction code), bad block information and filesystem dependend data.
n pages build one block. The read / write access to data is on a per page basis.
Erase is done on a per block basis. The commands to read / write / erase the chip is given by writing to the chip
with the Command Latch Enable pin high. Address is given by writing with the Address Latch Enable pin high.
 
NAND Flash 메모리는 페이지들의 배열로 정렬되어 있다. 하나의 페이지는 256 혹은 512-바이트의 데이터와 8 혹은
16-바이트의 spare(혹은 Out Of Band) 영역으로 구성된다. 최근의 칩들은 2048-바이트 데이터에 64-바이트 spare
영역을 사용하기도 한다. Spare 영역에는 Error Correction Code(ECC), 불량 블럭에 관한 정보, 파일 시스템과 관련된
데이터 등이 기록된다. 블럭은 n개의 페이지로 구성되는데 데이터에 대한 읽기/쓰기 동작은 페이지 단위로 수행되며
지우기 동작은 블럭단위로 수행된다. 칩에 대한 읽기/쓰기/지우기 명령은 Command Latch Enable 핀이 High인 상태에서
chip에 대한 write로 수행되며 주소는 Address Latch Enable 핀이 High 상태에서 write하여 전달한다.

There are only a few lines neccecary to access NAND Flashmemory.
16 bit buswidth chips are supported.

Pin(s) Function
I/O 0-7(15) Data Inputs/Outputs
/CE Chip Enable
CLE Command Latch Enable
ALE Address Latch Enable
/RE Read Enable
/WE Write Enable
/WP Write Protect
/SE Spare area Enable
R/B Ready / Busy Output

As it is neccecary to use the spare area, the /SE (Spare area Enable) pin should be tied to GND. /CE, CLE and
ALE should be GPIO pins or latched signals. It's possible to use address lines for ALE and CLE,
but you have to take care about the timing restrictions of the chip !
/RE and /WE can be tied to the corresponding lines of the CPU. Make sure, that they are logicaly combined with
the corresponding chipselect. You can also use two different chipselects for /RE and /WE,
but be aware of data hold time constraints of your NAND chip.
Data hold time after rising edge of /WE is different to data hold timeafter rising edge of chipselect lines!
I/O 0-7(15) are connected to the databus D0-D7(D15). The /WP pin can be used for write protection or
connected to VCC to enable writes unconditionally. As NAND flash uses a command driven programming and
erasing, an accidential write or erase is not likely to happen. The Ready / Busy output is not neccecary for
operation, but it can be tied to a GPIO or an interrupt line.

Filesystems supporting NAND

One major problem for using NAND Flash is, that you cannot write as often as you want to a page.
The consecutive writes to a page, before erasing it again, are restricted to 1-3 writes, depending on the manufacturers
specifications. This applies similar to the spare area.
This makes it neccecary for the filesystem to handle a writebuffer, which contains data, that is less than a page
 
NAND Flash를 사용할 때, 가장 큰 문제점들 중 하나는 페이지에 대한 데이터 기록을 원하는만큼 자주할 수 없다는 것이다.
NAND Flash 제조사에 따라 다르겠지만 지우지 않고 연속적으로 페이지에 write할 수 있는 회수는 1~3회로 제한되어 있다.
이 제한사항은 spare 영역도 크게 다르지 않다.
 
At the moment there are only a few filesystems, which support NAND
  • JFFS2 and YAFFS for bare NAND Flash and SmartMediaCards
  • NTFL for DiskOnChip devices
  • TRUEFFS from M-Systems for DiskOnChip devices
  • SmartMedia DOS-FAT as defined by the SSFDC Forum
JFFS2 and NTFL are Open Source, while TRUEFFS is a proprietary solution. SmartMedia DOS-Fat is
a specification from SSFDC forum. It is somewhat open under a non disclosure agreement with Toshiba,
who owns all rights on this specifications. NTFL is designed for the usage of DiskOnChip devices.
JFFS2 supports raw NAND chips and SmartMediaCards at the moment.
A JFFS2 support for DiskOnChip devices, based on the NAND code, is planned.
There are some other Open Source projects for NAND filesystem support, but there's no other working solution than
JFFS2 and YAFFS at the moment of this writing. YAFFS is available from YAFFS-Homepage.
YAFFS is faster than JFFS2 and consumes less RAM, JFFS2 provides on the fly file compression and decompression,
which is very helpfull for small FLASHs.
There is currently no support for the wide spread SmartMedia DOS-FAT filesystem,
mainly because it's not a reliable filesystem for industrial usage. It's ok for multimedia applications.
The hardware support layer is designed to support an implementation of SmartMedia DOS-FAT,
but nobody has made an attempt to implement it really. There are a couple of SmartMedia Card adaptors for USB,
PCMCIA, FireWire ... with Linux drivers available, which support the SmartMedia DOS-FAT.
JFFS2 and YAFFS include bad block management, wear leveling, error correction and provide
reliable filesystems for industrial use on top of NAND Flash.
 
JFFS2/YAFFS
    Open Source
    Bad block management
    Wear leveling
    Error correction 

JFFS2
   깡짜 NAND 칩, SmatMediaCard 지원.
   파일 압축/해제를 지원
 
YAFFS
   JFFS2보다 빠르고 RAM을 작게 사용

 

 

 

참조 : http://blog.naver.com/PostView.nhn?blogId=kmy1306&logNo=100048258263 

'[메모리]' 카테고리의 다른 글

4. SDRAM 동작테스트  (1) 2012.07.16
3. SDRAM 동작원리  (0) 2012.07.16
2. SDRAM 선정  (0) 2012.07.16
SDRAM 이란?  (0) 2012.07.16
SDRAM controller 설계  (1) 2012.07.16