主题 : 关于NAND读取NFDATA的问题, 严重迷惑中 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 8981
精华: 0
发帖: 10
金钱: 100 两
威望: 50 点
综合积分: 20 分
注册时间: 2009-09-13
最后登录: 2009-10-31
楼主  发表于: 2009-10-31 12:01

 关于NAND读取NFDATA的问题, 严重迷惑中

连续读NFDATA寄存器512次,可得到一页数据
static unsigned char s3c2440_read_data(void)
{  
    volatile unsigned char *p = (volatile unsigned char *)&s3c2440nand->NFDATA;
    return *p;
}  

for(j=0; j < NAND_SECTOR_SIZE; j++, i++) {
         *buf = s3c2440_read_data();
          buf++;
}

s3c2440nand->NFDATA 为NFDATA的地址.

问题是NFDATA的数据被读一次就会自动变一次么?
比如一页的开始数据为: 0001 0002 0003 .....
第一次调s3c2440_read_data时, NFDATA的值为0x0001
第一次调s3c2440_read_data时, NFDATA的值就自动变为0x0002么?

请各位大侠指教
级别: 新手上路
UID: 8981
精华: 0
发帖: 10
金钱: 100 两
威望: 50 点
综合积分: 20 分
注册时间: 2009-09-13
最后登录: 2009-10-31
1楼  发表于: 2009-10-31 12:59
自己顶.........难道真的是"只要被读访问, 寄存器就变内容"
PAGE READ
Page read is initiated by writing 00h-30h to the command register along with four address cycles. After initial power up, 00h command is latched. Therefore only four address cycles and 30h command initiates that operation after initial power up. The 2,112 bytes of data within the selected page are transferred to the data registers in less than 20µs(tR). The system controller can detect the completion of this data transfer(tR) by analyzing the output of R/B pin. Once the data in a page is loaded into the data registers, they may be read out in 25ns cycle time by sequentially pulsing RE. The repetitive high to low transitions of the RE clock make the device output the data starting from the selected column address up to the last column address.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2009-10-31 13:44
是啊,很多寄存器都是这样的,比如UART的RX Data寄存器,每读一次就会把这个Clock周期上接收到的数据读出来。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 8981
精华: 0
发帖: 10
金钱: 100 两
威望: 50 点
综合积分: 20 分
注册时间: 2009-09-13
最后登录: 2009-10-31
3楼  发表于: 2009-10-31 15:41
谢谢