mini2440-256M上面用的eeprom的型号为AT24C08B,这个eeprom的大小为1024*8(8k),这是什么意思呢? 存储器芯片容量=存储单元数*数据位数用AT24C08B来具体解释就是,AT24C08B共有1024个存储单元,每个存储单元的大小事8位(bits),而我们知道8位为一个字节,所以mini2440开发板的eeprom的大小为1024个字节,即1K大小,那么括弧里面的8K是什么意思的,8K的意思是总共有8*1024个位,不要混淆了哦。所以mini2440用户手册上说eeprom的大小是256字节是错误的,256字节那是AT24C0A的大小。下面来看下AT24C08B地址的确定:看手册知:The AT24C08A only uses the A2 input for hardwire addressing and a total of two 8K devices may be addressed on a single bus system. The A0 and A1 pins are no connects.
从上面知,一条I2C总线上最多只能存在两个8K的eeprom,他们用A2这根线来区别。而A0,A1对于AT24C08B是用不到的,要么不连,要么全接地,看下mini2440的原理图:可以看到A2接到了地,而A0,A1选择了接到地,而不是不连。顺便提一句,wp接地表示可以正常读写,没有进行写保护。那么怎么确定AT24C08B的地址,接着看手册:
The 2K, 4K and 8K EEPROM devices all require an 8 bit device address word following a start condition to enable the chip for a read or write operation (refer to Figure 1).The device address word consists of a mandatory one,zero sequence for the first four most significant bits as shown. This is common to all the EEPROM devices.
The 8K EEPROM only uses the A2 device address bit with the next 2 bits being for memory page addressing. The A2 bit must compare to its corresponding hard-wired input pin.The A1 and A0 pins are no connect.
device address 的地址是不包含R/W的,看对应关系,呵呵,所以地址为1010000,即0x50,而eeprom里面的范围通过写时序图也可以看出只能是0x00000000---0xFFFFFFFF,这个从后面的程序测试中可以看出在这个范围以外的是没法读写的。
阅读(1752) | 评论(0) | 转发(0) |