NAND Flash写入问题
比如指定从Flash的第64页开始,不断循环写入多页数据,但是最终运行效果第64页中的数据全为FF,从第65页开始数据才能正常写入麻烦大家帮忙看一下是什么问题
写入程序如下
void ProgramPage(UINT32 lba)
{ //9.3ms
UINT16 i;
CMD_ADDR_MCU_TO_FLASH;//WRITE
DATA_MCU_TO_FLASH;
FLASH_EN;
FLASH_DATA_OUT;
Nf_send_cmd(0X80);
Nf_send_address(0);
Nf_send_address(0);
Nf_send_address((UINT8)lba);
Nf_send_address((UINT8)(lba>>8));
Nf_send_address((UINT8)(lba>>16));
WRITE_EN=1;
asm{nop;}
asm{nop;}
asm{nop;}
if (own==0)
{
for(i=0;i<LEN;i++)
{
FLASH_DATA=databuf1;
WRITE_EN=0;
WRITE_EN=1;
}
}
else
{
for(i=0;i<LEN;i++)
{
FLASH_DATA=databuf1;
WRITE_EN=0;
WRITE_EN=1;
}
}
Nf_send_cmd(0X10);
CMD_ADDR_FLASH_TO_MCU;//FLASH TO MCU DIR1
WAIT_RB;
CMD_ADDR_MCU_TO_FLASH;//MCU TO FLASH DIR1
FLASH_DATA_IN;
DATA_FLASH_TO_MCU;//FLASH TO MCU DIR2
READ_EN_LATCH;
asm {nop;}
asm {nop;}
asm {nop;}
if(IO0==0) FlashStatus=1;
else FlashStatus=0;
READ_EN=1;
FLASH_DISEN;
} 不知道我,不过顶一下,NAND什么意思哇?你学单片机多久了哇,朋友!
页:
[1]