

The 24LC128, manufactured by Microchip Technology, is a 128 Kbit (16 K x 8) EEPROM (Electrically Erasable Programmable Read-Only Memory) that communicates via the I2C (Inter-Integrated Circuit) interface. This non-volatile memory component is designed to retain data even when power is removed, making it ideal for applications requiring persistent data storage.








The 24LC128 is a robust and versatile EEPROM with the following key specifications:
| Parameter | Value |
|---|---|
| Memory Size | 128 Kbit (16 K x 8) |
| Interface | I2C (2-wire) |
| Operating Voltage Range | 2.5V to 5.5V |
| Maximum Clock Frequency | 400 kHz (Fast Mode) |
| Write Cycle Time | 5 ms (typical) |
| Data Retention | > 200 years |
| Endurance | 1,000,000 write/erase cycles |
| Operating Temperature Range | -40°C to +85°C |
| Package Types | PDIP, SOIC, TSSOP, MSOP |
The 24LC128 is typically available in an 8-pin package. Below is the pinout and description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | A0 | Device address input (used for I2C addressing) |
| 2 | A1 | Device address input (used for I2C addressing) |
| 3 | A2 | Device address input (used for I2C addressing) |
| 4 | VSS | Ground (0V reference) |
| 5 | SDA | Serial Data (I2C bidirectional data line) |
| 6 | SCL | Serial Clock (I2C clock line) |
| 7 | WP | Write Protect (active high; disables write operations when tied to VCC) |
| 8 | VCC | Power supply (2.5V to 5.5V) |
Below is an example Arduino sketch to write and read data from the 24LC128 EEPROM:
#include <Wire.h> // Include the Wire library for I2C communication
#define EEPROM_I2C_ADDRESS 0x50 // Base I2C address of 24LC128
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Write a byte to EEPROM
writeEEPROM(0x0000, 0x42); // Write 0x42 to memory address 0x0000
delay(10); // Wait for the write cycle to complete
// Read the byte back from EEPROM
byte data = readEEPROM(0x0000);
Serial.print("Read data: 0x");
Serial.println(data, HEX); // Print the read data in hexadecimal format
}
void loop() {
// Main loop does nothing
}
// Function to write a byte to the 24LC128 EEPROM
void writeEEPROM(unsigned int address, byte data) {
Wire.beginTransmission(EEPROM_I2C_ADDRESS);
Wire.write((address >> 8) & 0xFF); // Send the high byte of the address
Wire.write(address & 0xFF); // Send the low byte of the address
Wire.write(data); // Send the data byte
Wire.endTransmission(); // End the I2C transmission
}
// Function to read a byte from the 24LC128 EEPROM
byte readEEPROM(unsigned int address) {
Wire.beginTransmission(EEPROM_I2C_ADDRESS);
Wire.write((address >> 8) & 0xFF); // Send the high byte of the address
Wire.write(address & 0xFF); // Send the low byte of the address
Wire.endTransmission(); // End the I2C transmission
Wire.requestFrom(EEPROM_I2C_ADDRESS, 1); // Request 1 byte from EEPROM
while (Wire.available() == 0); // Wait for data to become available
return Wire.read(); // Read and return the received byte
}
EEPROM Not Responding on I2C Bus:
Data Corruption:
Write Operations Failing:
Incorrect Data Read:
Q: Can I use multiple 24LC128 devices on the same I2C bus?
Q: What happens if power is lost during a write operation?
Q: Is the 24LC128 compatible with 3.3V systems?