

The 25LC640 is a 64 Kbit (8 K x 8) serial EEPROM manufactured by Microchip Technology. It is designed for non-volatile data storage, meaning it retains stored data even when power is removed. The component communicates using the SPI (Serial Peripheral Interface) protocol, making it suitable for a wide range of applications requiring reliable and compact memory solutions.








The following table outlines the key technical details of the 25LC640:
| Parameter | Value |
|---|---|
| Memory Size | 64 Kbit (8 K x 8) |
| Interface Protocol | SPI (Serial Peripheral Interface) |
| Operating Voltage Range | 2.5V to 5.5V |
| Maximum Clock Frequency | 10 MHz (at 4.5V to 5.5V) |
| Write Cycle Time | 5 ms (typical) |
| Endurance | 1,000,000 write cycles (typical) |
| Data Retention | 200 years (typical) |
| Operating Temperature Range | -40°C to +85°C |
| Package Types | PDIP, SOIC, TSSOP, MSOP |
The 25LC640 is typically available in an 8-pin package. The pinout and descriptions are as follows:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | CS | Chip Select: Activates the device when pulled low |
| 2 | SO | Serial Data Output: Outputs data during read operations |
| 3 | WP | Write Protect: Disables all write operations when tied to Vcc |
| 4 | Vss | Ground: Connect to system ground |
| 5 | SI | Serial Data Input: Receives data during write operations |
| 6 | SCK | Serial Clock: Synchronizes data transfer between the device and the controller |
| 7 | HOLD | Hold: Pauses communication without resetting the SPI bus |
| 8 | Vcc | Power Supply: Connect to a voltage source (2.5V to 5.5V) |
Below is an example of interfacing the 25LC640 with an Arduino UNO to write and read data:
#include <SPI.h>
// Pin definitions
const int CS_PIN = 10; // Chip Select pin connected to Arduino pin 10
void setup() {
// Initialize SPI and Chip Select pin
SPI.begin();
pinMode(CS_PIN, OUTPUT);
digitalWrite(CS_PIN, HIGH); // Set CS pin high to disable the device
Serial.begin(9600);
}
void loop() {
// Example: Write and read a byte to/from address 0x0000
writeEEPROM(0x0000, 0x42); // Write 0x42 to address 0x0000
delay(10); // Wait for write cycle to complete
byte data = readEEPROM(0x0000); // Read data from address 0x0000
// Print the read data
Serial.print("Read Data: 0x");
Serial.println(data, HEX);
while (1); // Stop the loop
}
// Function to write a byte to the EEPROM
void writeEEPROM(unsigned int address, byte data) {
digitalWrite(CS_PIN, LOW); // Enable the device
SPI.transfer(0x02); // Send WRITE instruction
SPI.transfer((address >> 8) & 0xFF); // Send high byte of address
SPI.transfer(address & 0xFF); // Send low byte of address
SPI.transfer(data); // Send data byte
digitalWrite(CS_PIN, HIGH); // Disable the device
}
// Function to read a byte from the EEPROM
byte readEEPROM(unsigned int address) {
digitalWrite(CS_PIN, LOW); // Enable the device
SPI.transfer(0x03); // Send READ instruction
SPI.transfer((address >> 8) & 0xFF); // Send high byte of address
SPI.transfer(address & 0xFF); // Send low byte of address
byte data = SPI.transfer(0x00); // Read data byte
digitalWrite(CS_PIN, HIGH); // Disable the device
return data;
}
Q: Can the 25LC640 be used with 3.3V systems?
A: Yes, the 25LC640 operates within a voltage range of 2.5V to 5.5V, making it compatible with 3.3V systems.
Q: How do I erase data on the 25LC640?
A: Data can be erased by writing 0xFF to the desired memory locations. The chip does not have a dedicated erase command.
Q: What is the endurance of the 25LC640?
A: The 25LC640 supports up to 1,000,000 write cycles per memory cell, ensuring long-term reliability.
Q: Can I use multiple 25LC640 chips on the same SPI bus?
A: Yes, multiple chips can share the same SPI bus. Assign a unique CS pin for each chip to select them individually.