Home > other >  K9F2G08X0A analysis
K9F2G08X0A analysis

Time:10-01

K9F2G08X0A 2048 Block (Block), each Block contains 64 Page (Page), each Page contains 2 k byte of normal storage space, as well as 64 byte check space.

Total space=2048 * 64 * (2 * 1024 + 64) byte

The actual storage space=2048 * 64 * 2 * 1024 byte

2. The pin definition and connection



3. The way of addressing


Address: Block and Page addressing

Address: by addressing Page

4. The command

The following motioned for several command operation, more orders, please join on chip manual.

(1) Read ID


Description: send 0 x90 first and then send 0 x00, then nand flash will return five data and the content of the different data on the basis of the chip is endless also and same, see manual value

(2) Page Read


Description: send 0 x00 before sending to read the address of the data, then send 0 x30, according to the R/B can be judged whether to send complete. The command to send completed from RE falling edge first, chip will begin from the address to the end of the page when all the data in the output

(3) Page Program


Description: send first 0 x80 and then send the address and data, after sending 0 x10, read the R/B, command to write again after sending 0 x70 basis to determine whether written success I/O0, 0:1: success failure

(4) Block Erase


Description: send 0 x90 first and then send the address line 1 2 3, and then send the erasing command 0 xd0, according to the R/B pins judgment erase operation is completed, after sending 0 x70 judged according to the status of the I/O0 erasing the success, 0:1: success failure

Note 1:

/* initializes the NAND Flash */

Void nand_init (void)

{

# define TACLS 0

# define TWRPH0 3

# define TWRPH1 0/* judgment is S3C2410 or S3C2440 */

If ((GSTATUS1==0 x32410000) | | (GSTATUS1 x32410002==0))//2410 {nand_chip. Nand_reset=s3c2410_nand_reset;

Nand_chip. Wait_idle=s3c2410_wait_idle; Nand_chip. Nand_select_chip=s3c2410_nand_select_chip; Nand_chip. Nand_deselect_chip=s3c2410_nand_deselect_chip; Nand_chip. Write_cmd=s3c2410_write_cmd; Nand_chip. Write_addr=s3c2410_write_addr; Nand_chip read_data=https://bbs.csdn.net/topics/s3c2410_read_data;/* can make the NAND Flash controller, initialization of ECC, ban selected, set the timing */s3c2410nand -> NFCONF=(115) | | (112) (111) | (TACLS8) | (TWRPH04) | (TWRPH10); } else {nand_chip. Nand_reset=s3c2440_nand_reset; Nand_chip. Wait_idle=s3c2440_wait_idle; Nand_chip. Nand_select_chip=s3c2440_nand_select_chip; Nand_chip. Nand_deselect_chip=s3c2440_nand_deselect_chip; Nand_chip. Write_cmd=s3c2440_write_cmd; # ifdef LARGER_NAND_PAGE nand_chip. Write_addr=s3c2440_write_addr_lp; # the else nand_chip. Write_addr=s3c2440_write_addr; # endif nand_chip. Read_data=s3c2440_read_data;/* set timing */s3c2440nand -> NFCONF=(TACLS 12) | | (TWRPH0 8) (TWRPH1 4);/* can make NAND controller, initialization of ECC, ban piece choose */s3c2440nand -> NFCONT=(1, 4) | | (1, 1) (1, 0). }/* reset NAND Flash */nand_reset (); }

To note here is that the large page nand, address send five times, the first two are colom addr is three times in a row after the addr, colom addr is responsible for the inside pages addressing, we actually addressing space for 2 k=2 ^ 11, so you just need to 11, so the program only took the low 11

Addressing A0 ~ to page A10. Another 64 byte OOB space can use A11 to address.

A12 ~ A17 used to addressing page within the block, the 64 - page

A18 ~ A28 used to addressing piece, a total of 2048 pieces of

Nand flash underlying operating functions:

Reset/* */static void s3c2410_nand_reset (void) {s3c2410_nand_select_chip ();//selected chips s3c2410_write_cmd (0 XFF);//reset command s3c2410_wait_idle ();//wait for nand ready s3c2410_nand_deselect_chip ();//deselect}/* waiting for NAND Flash ready */static void s3c2410_wait_idle (void) {int I; Volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2410nand - & gt; NFSTAT; while(! (* p & amp; BUSY)) for (I=0; I10; I++); }/* signal piece choose */static void s3c2410_nand_select_chip (void) {int I; S3c2410nand - & gt; NFCONF & amp;=~ (111); for(i=0; I10; I++); }/* cancel piece selected signal */static void s3c2410_nand_deselect_chip (void) {s3c2410nand - & gt; NFCONF |=(111); }/* issued orders */static void s3c2410_write_cmd (int CMD) {volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2410nand - & gt; NFCMD; * p=CMD; }/* send address */static void s3c2410_write_addr (unsigned int addr) {int I; Volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2410nand - & gt; NFADDR; * p=addr & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 9) & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 17) & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 25) & amp; 0 XFF. for(i=0; I10; I++); }/* */static data read unsigned char s3c2410_read_data (void) {volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2410nand - & gt; NFDATA; Return * p; }/* * S3C2440 NAND Flash operation function reset//* */static void s3c2440_nand_reset (void) {s3c2440_nand_select_chip (); S3c2440_write_cmd (0 XFF);//reset command s3c2440_wait_idle (); S3c2440_nand_deselect_chip (); }/* waiting for NAND Flash ready */static void s3c2440_wait_idle (void) {int I; Volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2440nand - & gt; NFSTAT;//status register, in place only 0. 0:1: busy ready while (! (* p & amp; BUSY)) for (I=0; I10; I++); }/* signal piece choose */static void s3c2440_nand_select_chip (void) {int I; S3c2440nand - & gt; NFCONT & amp;=~ (11); for(i=0; I10; I++); }/* cancel piece selected signal */static void s3c2440_nand_deselect_chip (void) {s3c2440nand - & gt; NFCONT |=(11); }/* issued orders */static void s3c2440_write_cmd (int CMD) {volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2440nand - & gt; NFCMD;//NFCMD different flash orders, send * p=CMD command signal; }/* send address (page 4 cycles) */static void s3c2440_write_addr (unsigned int addr) {int I; Volatile unsigned char * p=(volatile unsigned char *) & amp; S3c2440nand - & gt; NFADDR; * p=addr & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 9) & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 17) & amp; 0 XFF. for(i=0; I10; I++); * p=(addr & gt;> 25) & amp; 0 XFF. for(i=0; I10; I++); }/* send address (large page 5 cycles) */static void s3c2440_write_addr_lp (unsigned int addr) {int I; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related