Using Arduino with an I2C EEPROM

I got my hands on an AT24C256 (256 kbit = 32 kbyte serial EEPROM). I found no library for it, so I created a small sketch with few functions to show how the i2c_eeprom_write_page and i2c_eeprom_read_byte functions work.

Because this chip is I2C, it only uses the analog pins 4 & 5 (SDA and SCL), and of course the power (5V) and GND.

Connect as follows:

Arduino analog pin 4 to EEPROM pin 5

Arduino analog pin 5 to EEPROM pin 6

Arduino 5V to EEPROM pin 8

Arduino GND to EEPROM pin 1,2,3,4



Be sure to leave pin 7 of the EEPROM open or tie it to GND otherwise the EEPROM will be write protected.

Just a few quick functions for reading/writing the EEPROM (not a library, yet). 'deviceaddress' refers to the EEPROM I2C address, eg. 0x50.