Nand Flash 寻址方式及其驱动程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

NandFlash寻址方式及其驱动程序NandFlash寻址方式及其驱动程序•存储结构和寻址方式•命令和时序•2410、2440NandControler•DriverwithC•ECC存储结构----K9F1208U0M-YIB0寻址方式----K9F1208U0M-YIB0•ColumnAddress•[A0-A7][A8]对应byteinpageaddress•9bit寻址(512+16)byte/page•RowAddress•[A9-A13]对应pageinblockaddress•5bit寻址32page/block•[A14-A25]对应blockindeviceaddress•12bit寻址4096block/device存储结构----K9F8G08X0M寻址方式----K9F8G08X0M•ColumnAddress•[A0-A12]对应byteinpageaddress•13bit寻址(4K+128)byte/page•RowAddress•[A13-A18]对应pageinblockaddress•6bit寻址64page/block•[A19-A30]对应blockindeviceaddress•12bit寻址4096block/device2410、2440nandcontroller•特性•Registers--24102410特性2410特性2440特性2440特性2440特性2410RegisterTACLS+PWRPH0+PWRPH1•K9F1208找到时序图TACLS+PWRPH0+PWRPH1TACLS+PWRPH0+PWRPH1•对比下面的时序图:•tCLS/tALS+tWP+tCLH/tALH=0/0+25+10/10=35ns=TACLS+PWRPH0+PWRPH1TACLS+PWRPH0+PWRPH1•tCLS/tALSTACLS•tWPPWRPH0•tCLH/tALHPWRPH1假设HCLK为100MHZ(10ns)设定TACLS=0,PWRPH0=1,PWRPH1=0TACLS=1HCLK=10nsPWRPH0=2HCLK=20ns25ns这个不符合要求PWRPH1=1HCLK=10nsTACLS+PWRPH0+PWRPH1设定TACLS=0,PWRPH0=2,PWRPH1=0TACLS=1HCLK=10nsPWRPH0=3HCLK=30ns25nsPWRPH1=1HCLK=10nsTACLS+PWRPH0+PWRPH1假设HCLK=12MHz(83ns)设定TACLS=0,PWRPH0=0,PWRPH1=0TACLS=1HCLK=83nsPWRPH0=1HCLK=83ns25nsPWRPH1=1HCLK=83ns10ns经验值:0、4、22410Register2410Register时序命令----K9F1208U0M-YIB0RESETReadIDRead1Read1Read2Read2BlockErasePageProgram(True)Multi-PlaneBlockEraseMulti-PlanePageProgramDriverWithC•ControllerRegisterConfigure•2410NFCONF使能controller|初始化ECC|反片选|TACLS|TWRPH0|TWRPH1(115)|(112)|(111)|(TACLS8)|(TWRPH04)|(TWRPH10)•2440相对复杂一点,仔细看看,其实也差不多。从Reset开始•NFCONF&=~0x00000800;//片选•NFCMD=0xFF;//发命令0xFF•//ReadR/Bwaitidlewhile(!(NFSTAT&0x01)){for(i=0;i10;i++){;}}•NFCONF|=0x00000800;//反片选在使用FLASH之前一定要先Reset一下:Waitingfornextcommand!ReadID•NFCONF&=~0x00000800;//片选•NFCMD=0x90;//发命令0x90•//WriteAddress0x00NFADDR=0x00000000&0xFF;for(i=0;i10;i++);NFADDR=(0x000000009)&0xFF;for(i=0;i10;i++);NFADDR=(0x0000000017)&0xFF;for(i=0;i10;i++);NFADDR=(0x0000000025)&0xFF;for(i=0;i10;i++);•//ReadIDid=NFDATA24;//Makercode(K9F1208:0xEC)id|=NFDATA16;//Devicecode(K9F1208:0x76)id|=NFDATA8;//Mustbedon’tcare(K9F1208:0x0xA5)id|=NFDATA;//Supportmultiplaneoperation(K9F1208:0xC0)•NFCONF|=0x00000800;//反片选Read1(OnePage)•NFCONF&=~0x00000800;//片选•NFCMD=0x00;//发命令0x90•//writeaddress0xXXXXXXXXNFADDR=0xXXXXXXXX&0xFF;for(i=0;i10;i++);NFADDR=(0xXXXXXXXX9)&0xFF;for(i=0;i10;i++);NFADDR=(0xXXXXXXXX17)&0xFF;for(i=0;i10;i++);NFADDR=(0xXXXXXXXX25)&0xFF;for(i=0;i10;i++);•//ReadR/Bwaitidlewhile(!(NFSTAT&0x01)){for(i=0;i10;i++){;}}•//ReadOnePage512ByteDatafor(j=0;j512;j++){*buf=NFDATA&0xFF;buf++;}•NFCONF|=0x00000800;//反片选其它问题•SLCorMLC

1 / 38
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功