The 24LC256 EEPROM:

The Microchip 24LC256 is a 32K x 8 (256 Kbit) Serial Electrically Erasable PROM, capable of operation across a broad voltage range (1.7V to 5.5V). It has been developed for advanced, low-power applications such as personal communications or data acquisition.

This device also has a page write capability of up to 64 bytes of data. This device is capable of both random and sequential reads up to the 256K boundary. Functional address lines allow up to eight devices on the same bus, for up to 2 Mbit address space. This device is available in the standard 8-pin plastic DIP, SOIC, TSSOP, MSOP and DFN packages.

Features:

  •  Single Supply with Operation Down to 2.5V for 24LC256 Devices
  •  Low-Power CMOS Technology:
  •   – Active current 400 uA, typical
  •   – Standby current 100 nA, typical
  •  2-Wire Serial Interface, I2C™ Compatible
  •  Cascadable up to Eight Devices
  •  Schmitt Trigger Inputs for Noise Suppression
  •  Output Slope Control to Eliminate Ground Bounce
  •  100 kHz and 400 kHz Clock Compatibility
  •  Page Write Time 5 ms max.
  •  Self-Timed Erase/Write Cycle

 

Pinout:

The 24LC256 EEPROM has the pinout shown in the following pictures:

Pins A0, A1 and A2 select the I2C addresses, 

 

 

1 0 1 0 A2 A1 A0 x


So if you connect pins A0, A1, A2 to GND the I2C address will be 1010000 = 0x50 in hexadecimal.

 

The WP pin is “write protect”, set this low for read/write or high for read only. We are going to link it to GND.

Pin Vcc will receive the +5V.

Pin Vss is the GND.

SCL and SDA pins are the pins used by the I2C bus.

 

Interfacing with Arduino

To interface the 24LC256 chip to Arduino I developed a simple board using a stripboard.

It is shown in the following picture:

If you decide to build this board, remeber that the copper tracks shall be on the bottom side so when you cut the tracks you have to mirror the abpove picture.

Now you have to connect, with some wires, your Arduino with this board.

GND <-->  GND

DA  <-->  A4

CL  <-->  A5

5V  <-->  5V

 

Testing the board

Now let's make some test, the code to do the test is very simple:

 

If all is working fine the output on the serial line should be as follows:

 

Writing data…

DONE

Reading data…

0 : 0

1 : 1

2 : 2

3 : 3

4 : 4

5 : 5

6 : 6

7 : 7

8 : 8

9 : 9

10 : 10

11 : 11

12 : 12

13 : 13

14 : 14

15 : 15

16 : 16

17 : 17

18 : 18

19 : 19

DONE

 

 

see you soon,

Gg1