A non-volatile ROM like EEPROM stands for electrically erasable programmable ROM which is used to allow individual bytes of data to be erased & reprogrammed. These ICs are called byte erasable chips which are used for storing small amounts of data within computing & other different electronic devices. Microchip Technology Inc. developed EEPROM chips like 24AA1026, 24LC1026, and 24FC1026 which are 1024 Kbit Serial EEPROM with 1.7V – 5.5V broad range voltage. These memory chips are mainly developed to use in low-power-based applications like data acquisition, personal communications, etc. This article provides brief information on 24LC1026 serial EEPROM.
What is 24LC1026 Serial EEPROM?
24LC1026 is an external EEPROM, developed by Microchip. This chip mainly supports an I2C interface with dual-direction used for transferring data & addresses between four devices. The 24LC1026 EEPROM IC is embedded with ESD & wire protection. This is a very small and power-efficient chip that includes different CLK frequencies based on the i/p power voltage. The memory of this chip is spacious & placed in the 128K x 8 bits form. This IC can rewrite to 1 million write cycles & has a write time of a page typically 3 milliseconds. The 24LC1026 EEPROM IC is mainly designed to use in personal applications which range from the consumer to the industry level.
Pin Configuration:
The pin configuration of 24LC1026 Serial EEPROM is shown below. This IC includes 8 pins and each pin and its functionality are discussed below.
Pin1 (NC): It is a not connected pin.
Pins 2 & 3 (A1 & A2): This EEPROM IC includes two address pins A1 & A2. These two pins help in connecting various devices on an only bus. This IC is capable of connecting at a time four different devices.
Pin4 (VSS): It is a reference potential pin.
Pin 5 & 6 (I2C Interface): This IC uses an I2C interface mainly used for transferring data. This IC includes two pins SCL &SDA. Here, the SCL pin synchronizes the data between the memory component as well as other devices whereas SDA is one kind of transceiver that communes addresses & data in between EEPROM as well as other peripherals.
Pin-7 (Write Protect): This is a write protection pin used to avoid modification of any mechanical data within the EEPROM. Once it is allied to VSS, then it allows Write operations.
Pin8 (VCC): It is a +ve power supply pin.
Features & Specifications:
The features and specifications of 24LC1026 Serial EEPROM include the following.
- This memory device uses low-power CMOS technology for quick processing.
- It can link 1024K serial data bits, arranged internally as 128K words of 8 bits each.
- It functions on the I2C protocol for serial transmission.
- It connects up to four devices.
- It includes an integrated mechanism to eliminate ground bounce generated by switching of transistors.
- It includes a Schmitt Trigger to filter the i/ps.
- The data transfer protocol within this IC is two-wired.
- It supports a self-timed write or erases cycle.
- It is embedded through hardware wire safety to stay away from mechanical data change.
- This memory module is a cost-effective, low-power & extremely strong device.
- Its operating voltage ranges from 2.5 Volts to 5.5 Volts.
- Its max operating voltage is 6.5 volts.
- Its operating current is 5.0 mAmps.
- Its read current maximum is 450uA.
- Its write current is 5mAmps.
- Its standby current is 5uAmps.
- Its CLK frequency maximum is 400 kHz.
- Its data retention time is > 200 years.
- It includes 1 million no.of write cycles.
- Its typical page writing time is 3 msec.
- Its max time of writes cycle is 5msec.
- Its page write buffer is 128 Bytes.
- Its ESD safety is > 400V.
- Its range of operating temperature is from -40°C to 85°C.
- The type of package is 8-pin SOIC, PDIP & SOIJ.
Equivalent & Alternatives
Equivalent 24LC1026 serial EEPROM is 24LC512 and alternative 24LC1026 serial EEPROM ICs are 25LC050 & 24C32.
24LC1026 Serial EEPROM Interfacing with a Microcontroller
The 24LC1026 EEPROM interfacing with any microcontroller which includes the I2C port is shown below. The EEPROM IC communicates through the I2C protocol. To interface this IC with the microcontroller unit, you need to power the IC with 3.3V/5V by connecting the communication lines.
The required components to make this interfacing mainly include 24LC1026 EEPROM IC, any microcontroller which has I2C, and two pull-up resistors. The connections of this interfacing follow as;
The microcontroller with I2C support is simply connected to the exterior 24LC1026 EEPROM IC throughout SDA & SCL. The relationship of master-slave can be carried out through these open-drain data lines. Thus they need pull-up resistors for avoiding loss of data.
Pin 6 like the SCL of EEPROM IC is connected to the SCL pin of the microcontroller. Pin 5 like the SDA of EEPROM is connected to the microcontroller’s SDA pin. Here, two pull-up resistors are used to pull high both the SCK & SDA pins. So this will maintain the bus at high condition throughout the inactive conditions.
The A0, A1 & A2 chip select pins are connected to the three GPIO pins of the microcontroller like GPIO0, GPIO1 & GPIO2. These chip-select pins are utilized simply if one EEPROM/ I2C device is allied to a similar microcontroller. The address pins are sealed with the microcontroller unit’s GPIO pins if necessary. They are useful to set the addresses once various devices are connected to a microcontroller or else they are grounded.
The WP pin of EEPROM is enabled whenever it is provided by voltage and it guards the entire array of memory from the loss of data. To perform the normal functions of read & write, it should be kept low or else it permits data & address to be read simply & prohibits the write operations. Once the protection is required then this WP pin will be grounded.
The communication can be started by transmitting the address of the device to the EEPROM IC which is followed through the address of memory. After the address allotment, data can be transferred & stored at the particular location. Once data is required to be read, then requirements are sent that include the particular device as well as the address of memory and the data is go back through the EEPROM.
Code to Interface with a 24LC1026 Serial EEPROM using the Atmel AVR microcontroller:
#include <stdio.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <util/twi.h>
#define EEPROM_ADDRESS 0b1010000 // EEPROM I2C address, 7-bit format
#define EEPROM_PAGE_SIZE 64 // EEPROM page size in bytes
void EEPROM_WriteByte(uint32_t address, uint8_t data);
uint8_t EEPROM_ReadByte(uint32_t address);
int main(void)
{
// Initialize I2C interface
TWBR = ((F_CPU / 100000UL) – 16) / 2; // Set I2C clock frequency to 100 kHz
TWCR |= (1 << TWEN); // Enable I2C interface
// Write data to EEPROM
uint32_t eepromAddress = 0x0000;
uint8_t dataToWrite = 0xAA;
EEPROM_WriteByte(eepromAddress, dataToWrite);
// Read data from EEPROM
uint8_t dataRead = EEPROM_ReadByte(eepromAddress);
// Print the read data
printf(“Data Read from EEPROM: 0x%02X\n”, dataRead);
return 0;
}
void EEPROM_WriteByte(uint32_t address, uint8_t data)
{
// Start I2C communication
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for START condition
if ((TWSR & 0xF8) != TW_START)
{
// Handle error condition
printf(“I2C START Error!\n”);
while (1)
;
}
// Send slave address and write bit
TWDR = (EEPROM_ADDRESS << 1) | TW_WRITE;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for slave address acknowledgment
if ((TWSR & 0xF8) != TW_MT_SLA_ACK)
{
// Handle error condition
printf(“EEPROM Address Write Error!\n”);
while (1)
;
}
// Send high byte of memory address
TWDR = (address >> 16) & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address High Byte Write Error!\n”);
while (1)
;
}
// Send middle byte of memory address
TWDR = (address >> 8) & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address Middle Byte Write Error!\n”);
while (1)
;
}
// Send low byte of memory address
TWDR = address & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address Low Byte Write Error!\n”);
while (1)
;
}
// Send data byte to be written
TWDR = data;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for data byte acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Data Write Error!\n”);
while (1)
;
}
// Stop I2C communication
TWCR = (1 << TWINT) | (1 << TWSTO) | (1 << TWEN);
_delay_ms(10);
}
uint8_t EEPROM_ReadByte(uint32_t address)
{
uint8_t data;
// Start I2C communication
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for START condition
if ((TWSR & 0xF8) != TW_START)
{
// Handle error condition
printf(“I2C START Error!\n”);
while (1)
;
}
// Send slave address and write bit
TWDR = (EEPROM_ADDRESS << 1) | TW_WRITE;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for slave address acknowledgment
if ((TWSR & 0xF8) != TW_MT_SLA_ACK)
{
// Handle error condition
printf(“EEPROM Address Write Error!\n”);
while (1)
;
}
// Send high byte of memory address
TWDR = (address >> 16) & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address High Byte Write Error!\n”);
while (1)
;
}
// Send middle byte of memory address
TWDR = (address >> 8) & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address Middle Byte Write Error!\n”);
while (1)
;
}
// Send low byte of memory address
TWDR = address & 0xFF;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for memory address acknowledgment
if ((TWSR & 0“`c
// Check the status code for memory address acknowledgment
if ((TWSR & 0xF8) != TW_MT_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Address Low Byte Write Error!\n”);
while (1)
;
}
// Repeat START condition to initiate read operation
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for repeated START condition
if ((TWSR & 0xF8) != TW_REP_START)
{
// Handle error condition
printf(“I2C Repeated START Error!\n”);
while (1)
;
}
// Send slave address and read bit
TWDR = (EEPROM_ADDRESS << 1) | TW_READ;
TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for slave address acknowledgment
if ((TWSR & 0xF8) != TW_MR_SLA_ACK)
{
// Handle error condition
printf(“EEPROM Address Read Error!\n”);
while (1)
;
}
// Read data byte from EEPROM
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWEA);
while (!(TWCR & (1 << TWINT)))
;
// Check the status code for data byte acknowledgment
if ((TWSR & 0xF8) != TW_MR_DATA_ACK)
{
// Handle error condition
printf(“EEPROM Data Read Error!\n”);
while (1)
;
}
data = TWDR;
// Stop I2C communication
TWCR = (1 << TWINT) | (1 << TWSTO) | (1 << TWEN);
_delay_ms(10);
return data;
}
The functionality of the above code is
Function Declarations:
- EEPROM_WriteByte(): This function is responsible for writing a single byte of data to the 24LC1026 EEPROM at a specified memory address.
- EEPROM_ReadByte(): This function reads a byte of data from the 24LC1026 EEPROM at a specified memory address.
main() Function:
- Initializes the I2C interface by setting the TWI (Two-Wire Interface) bit rate register (TWBR) to achieve a desired I2C clock frequency (100 kHz in this case) and enables the TWI module.
- Calls EEPROM_WriteByte() to write a test byte (dataToWrite) to the EEPROM at the specified memory address (eepromAddress).
- Calls EEPROM_ReadByte() to read a byte of data from the EEPROM at the same memory address.
- Prints the read data using printf().
EEPROM_WriteByte() Function:
- Initiates the I2C communication by sending a START condition and waits for its completion.
- Checks the status code for the START condition.
- Sends the EEPROM address with the write bit (TW_WRITE) to initiate communication with the EEPROM.
- Sends the high byte, middle byte, and low byte of the memory address where the data should be written.
- Sends the data byte to be written to the EEPROM.
- Finally, sends a STOP condition to end the I2C communication.
EEPROM_ReadByte() Function:
- Initiates the I2C communication by sending a START condition and waits for its completion.
- Checks the status code for the START condition.
- Sends the EEPROM address with the write bit to initiate communication with the EEPROM.
- Sends the high byte, middle byte, and low byte of the memory address to specify the location from which data should be read.
- Repeats the START condition to initiate a read operation.
- Sends the EEPROM address with the read bit (TW_READ) to read data from the EEPROM.
- Reads the data byte from the EEPROM and sends an acknowledgment.
- Finally, sends a STOP condition to end the I2C communication.
The above code is based on the assumption of the availability of necessary hardware and proper configuration of the I2C interface of the AVR microcontroller and 24LC1026 Serial EEPROM to the appropriate I2C pins of the AVR microcontroller.
The datasheets of the 24LC1026 EEPROM and the specific AVR microcontroller should be referred for more detailed information on I2C registers, specific pin connections, and any other specific considerations for proper operation apart from the one mentioned in the above section on interfacing with a microcontroller.
Advantages & Disadvantages
The advantages of 24LC1026 EEPROM include the following.
- This IC lets individual bytes be deleted & reprogrammed.
- This IC has the capability of both page write & byte write up to 128 bytes of data.
- This IC holds data even when there is no power supply.
- The data in this IC can be erased very fast.
- Reprogramming this IC is simple without removing it from the PC.
- This IC erases data electronically within 5 to 10 ms.
- The disadvantages of 24LC1026 EEPROM include the following.
- EEPROM IC needs different voltages for reading, writing & removing the data.
- The data maintenance time period of this IC for most of the devices is limited to approximately 10 years.
- External serial type EEPROM needs a long time to access.
- This IC is expensive as compared to EPROM & PROM.
- The read or write cycles on EEPROM IC is slow as compared to the cycles over RAM.
Applications
Despite the availability of other non-volatile memory technologies like NAND and NOR Flash, EEPROMs continue to be utilized in specific scenarios that benefit from their unique characteristics. Here are a few examples of current uses of EEPROMs.
EEPROMs: Configuration Data: EEPROMs are commonly employed to store configuration settings in electronic devices such as routers, modems, and embedded systems. These settings can be modified by the user or the device itself, and the non-volatile nature of EEPROM ensures that the settings are retained even when power is removed.
Small Data Storage: EEPROMs are well-suited for storing relatively small amounts of data that require frequent modification. For example, they are used in smart cards, RFID tags, and various microcontroller-based systems to store user-specific data, calibration data, or system parameters.
Firmware Storage: In some systems, EEPROMs are used to store firmware or small software modules that can be updated or reprogrammed as needed. This flexibility allows for firmware upgrades or bug fixes without requiring the replacement of the entire memory chip.
Security and Encryption: EEPROMs with built-in security features, such as encryption and tamper detection, are utilized in applications where data integrity and confidentiality are crucial. These include secure storage devices, cryptographic keys, and secure boot mechanisms.
Automotive Applications: EEPROMs are commonly used in automotive electronics for storing vehicle-specific data, such as mileage, maintenance records, and configuration settings. They provide a reliable and non-volatile storage solution for critical information.
While EEPROM technology may not be as prevalent as other memory technologies in certain high-capacity or high-speed applications, its unique characteristics make it suitable for specific use cases that require small, flexible, and non-volatile data storage.
Please refer to this link for the 24LC1026 Serial EEPROM Datasheet.
Thus, this is an overview of 24LC1026 Serial EEPROM, pinout, features, specifications, advantages, disadvantages, and applications. The 24LC1026 EEPROM is a 1024 K-bit chip and it operates across a 1.7V – 5.5V broad voltage range. This IC has up to 128 bytes of both page write & byte write data capability. Here is a question for you what is EPROM?