Electronics

EEPROM Memory Module I2C Interface AT24C256

AED 9.45

Low stock
1

Description

The AT24C256 is a 32-Kbyte serial, EEPROM (Electrically Erasable Programmable Read-Only Memory) that is divided into 256Kbit WORDS of 8 BITS each. EEPROM can retain data indefinitely unless you delete or write it, and the data is not lost when the power is turned off. Some microcontrollers have limited storage, such as the Arduino, which has just 512 bytes of data storage compared to the AT24C256, which has 256Kb EEPROM, which will be ideal for storing a modest quantity of data or expanding data storage for your microcontroller. The 24C256 is designed for use in low-power, low-voltage storage systems that are powered by the i2C serial communication channel.

Specifications:

  • Maximum Writing Time: 5 mS
  • Read / Write Cycle: 100000
  • Data Retention: > 200 Years
  • Write Current Consumption: 3mA – 5VDC
  • Read Current Consumption: 400uA – 5VDC
  • Power Consumption on Standby: 100nA -5VDC
  • Temperature Range: -40*C to +125*C

Required Components to experiment with the Module:

  • Arduino Microcontroller, Teensy, ESP8266, ATTINY, STM32
  • AT24C256 chip / Module
  • Resistors (4k7, 10k, 220 Ohms)
  • Capacitor (0.1 uf)
  • 3mm LED
  • Solder Less Bread Board
  • Jumper Wire / DuPont Wire

How to wire the Module With Arduino Nano:

As you can see in the diagram above the Pins A0, A1, A2 are connected to the ground these pins allow you to customize the device i2C bus address, below the datasheet that we verify how it is formed the byte address. For more details please refer to the Datasheet below.

4 significant bits are present for the control code while bits A0, A1, and A2 are customizable. The least significant bit R/W is used to select a WRITE/READ operations, connected to GND PIN A0, A1, A2 files chIP SELECT BITS are 0. See the address of the device below. we get a value of 0x50

To perform WRITING / READING the 24C256 you must submit in addition to CONTROL BYTE which specifies the device address in i2C Bus, two bytes that indicate the address memory we what to write/read.

The Sample Code for the EEPROM Memory Module I2C Interface AT24C256:

#include 
#include "AT24C256.h" //Include AT24C256 Code Libraries

AT24C256 g_eeprom(0x50); //Start code 0x50 Address

void printContents() {
int eeaddress = 0;
byte value;

  while (true) {
    value = g_eeprom.read(eeaddress++);
    if ((value == 0xFF) || (eeaddress == 32768)) {
      Serial.println();
      break;
    }
    Serial.print((char)value);
  }
}

void setup() {
  Serial.begin(9600);
  Serial.println ( "14CORE | 24C256 EEPROM TEST CODE"); // send a message to the serial monitor   
  Serial.println ( "--------------------------------");
  Serial.println ( "START... ");
  Wire.begin();
  printContents();
}

void loop() {
  while (Serial.available()) {
    int i, m;
    String data = Serial.readStringUntil('\n');

    for (i = 0, m = data.length(); i < m; ++i) {
      g_eeprom.write(i, data[i]);
    
    Serial.println("14CORE | AT24C256 WRITE CODE TEST");
    Serial.println("---------------------------------")
      Serial.println("Writing  : ");
      Serial.print(data[i]);
      Serial.println(" IN : ");
      Serial.println(i);
    }
    g_eeprom.write(i, 0xFF); //Start write 
    printContents();
  }
  delay(1);
}