我最近在看K9F1208芯片,
对K9F1208芯片而言,每页是(512K+16K)大小,也就是说寻找业内地址需要 9 位,参考资料上说bit8用来判断读写1st half或者2nd half,我们不用管它,那么在第二次发送地址的时候就是右移九位,每次只取低八位,但是源代码却是下面的,
#define ADDR_1st_CYCLE(ADDR) (u8)((ADDR)& 0xFF) /* 1st addressing cycle */
#define ADDR_2nd_CYCLE(ADDR) (u8)(((ADDR)& 0xFF00) >> 8) /* 2nd addressing cycle */
#define ADDR_3rd_CYCLE(ADDR) (u8)(((ADDR)& 0xFF0000) >> 16) /* 3rd addressing cycle */
#define ADDR_4th_CYCLE(ADDR) (u8)(((ADDR)& 0xFF000000) >> 24) /* 4th addressing cycle */
第二次发送不应该是
#define ADDR_2nd_CYCLE(ADDR) (u8)(((ADDR)& 0x1FE00) >> 9)
(后面以此类推),
然后我又查阅了k9f1g08的datasheet,照图片上的信息,
[img][/img]
它的地址发送不应该是:
/* FSMC NAND memory address computation */
#define ADDR_1st_CYCLE(ADDR) (u8)((ADDR)& 0xFF) /* 1st addressing cycle */
#define ADDR_2nd_CYCLE(ADDR) (u8)(((ADDR)& 0x0F00) >> 8) /* 2nd addressing cycle */
#define ADDR_3rd_CYCLE(ADDR) (u8)(((ADDR)& 0xFF000) >> 12) /* 3rd addressing cycle */
#define ADDR_4th_CYCLE(ADDR) (u8)(((ADDR)& 0xFF00000) >> 20) /* 4th addressing cycle */
吗?
我是不是哪里理解错了 |