Analysis on the connection between S3C2440 and NAND Flash (k9f1208)

Source: Internet
Author: User
The wiring of NAND Flash is different from that of nor flash and SDRAM. Taking the k9f1208 on the tq2440 Development Board as an example, the wiring method of NAND Flash is analyzed.

The k9f1208 structure is as follows:

K9f1208 bits are 8 bits in width.

Page 1: the last 16 bytes of 512 bytes and 16 bytes are used to store verification codes and other information. Actual data cannot be stored.

A block has 32 pages: (16 K + 512) byte

K9f1208 has 4096 (64 m + 2 m) bytes, with a total of 64 Mbyte operating chip capacity

 

NAND Flash reads and writes data on pages and erased data on blocks.

The wiring diagram of s3c24440 and k9f1208 is as follows:

Is the NAND Flash pin configuration of S3C2440:

After you select a NAND Flash model, you must determine the ncon, gpg13, gpg14, and gpg15 status of the S3C2440 Based on the selected NAND Flash.

It is the definition of the Four-pin status in S3C2440:

One page of k9f1208 is 512 bytes, so ncon is connected to a low level, while gpg13 is connected to a high level.

K9f1208 requires four Addressing commands, so gpg14 is connected to a high level

The Bit Width of k9f1208 is 8, so gpg15 is connected to a low level.

 

NAND Flash addressing

For k9f1208, the address and command can only be passed on I/O [], and the data width is 8 bits.

Address Transfer is divided into four steps, such:

Step 1: Send the column address. Select one byte in the 512byte page. 512byte needs 9bit to choose, here only the A0-A7, the reason is to divide a page into 2 parts, each part of 256 bytes. The read command is used to determine whether to read the first 256 bytes or the last 256 bytes.

 

When the start address (column address) to be read is 0 ~ In 255, we use the 256 H command. When the starting address for reading is ~ 511, The 01h command is used.

A block has 32 pages and uses a A9-A13 of 5 digits to select a page in a block.

There are a total of 4096 blocks, with a A14-A25 total of 12 bits to choose a block.

K9f1208 has a total of 64 Mbyte, requires a total of 26 A0-A25 addresses.

 

For example, you want to read the content starting from 5,000th bytes of NAND Flash. Break down 5000 into column addresses and row addresses.

Column_address = 5000% 512 = 392

Page_address = (5000> 9) = 9

Because column_address> 255, use the 01h command to read

The order of sending commands and parameters is:

Nfcmmd = 0x01; read from the last 256 bytes

Nfaddr = column_address & 0xff; send the low 8-bit column_address to the data line

Nfaddr = page_address & 0xff; send A9-A16

Nfaddr = (page_address> 8) & 0xff;
Send A17-A24

Nfaddr = (page_address> 16) & 0xff; send A25

The above nfcmmd, nfaddr. Is the S3C2440 NAND Flash control register. The read data is stored in nfdata.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.