User Tools

Site Tools


tutorials:cb1:development:access_at24c_eeprom_via_i2c

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:cb1:development:access_at24c_eeprom_via_i2c [2013/12/04 08:07]
soloforce
tutorials:cb1:development:access_at24c_eeprom_via_i2c [2013/12/23 14:50] (current)
Line 31: Line 31:
 The connection of AT24C slave devices is in parallel(like the circuits below, which is a sort of write-protection AT24C configuration circuits), but they should have various device address in order to be addressed by I2C master. The addressing problem will be discussed later in this tutorial. The connection of AT24C slave devices is in parallel(like the circuits below, which is a sort of write-protection AT24C configuration circuits), but they should have various device address in order to be addressed by I2C master. The addressing problem will be discussed later in this tutorial.
  
-{{:​tutorials:​cb1:​development:​at24c256_circuits.png?​500 |}}+{{:​tutorials:​cb1:​development:​at24c256_circuits.png?​500|}}
  
 Once connection is done, you can use the //​**i2c-tools**//​(apt-get install it) to detect them. If things go normal, you should get the similar result below. Once connection is done, you can use the //​**i2c-tools**//​(apt-get install it) to detect them. If things go normal, you should get the similar result below.
  
-{{:​tutorials:​cb1:​development:​i2c_detect.png?​500 |}}+{{:​tutorials:​cb1:​development:​i2c_detect.png?​500|}}
  
 ===== AT24C Access ===== ===== AT24C Access =====
 +AT24C series EEPROM'​s address could be splited into two parts, higher bits and lower bits. The higher bits are fixed at //​**0x5**//,​ while lower bits could be hard coded by setting //**A2, A1, A0**//'​s power logic. As for AT24C256, only A1, A0 are valid for address.
 {{:​tutorials:​cb1:​development:​at24c_pinout.png?​500 |}} {{:​tutorials:​cb1:​development:​at24c_pinout.png?​500 |}}
 ===== Example Codes ===== ===== Example Codes =====
 +This code snippet is an interactive demo for storing text strings and fetching them back to and from AT24C256 chips. Of course you can modified it to make it able to handle binary data. You maybe need install //​**libi2c-dev**//​ package to compile & run. 
 <code c> <code c>
 /* /*
Line 261: Line 263:
 {{:​tutorials:​cb1:​development:​i2c_rw.png?​500 |}} {{:​tutorials:​cb1:​development:​i2c_rw.png?​500 |}}
 <WRAP noprint> <WRAP noprint>
-{{tag>Cubieboard ​Cubietruck}}+{{tag>Cubieboard1 Cubieboard2 ​Cubietruck ​I2C AT24C EEPROM}}
 </​WRAP>​ </​WRAP>​
tutorials/cb1/development/access_at24c_eeprom_via_i2c.txt · Last modified: 2013/12/23 14:50 (external edit)