Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use 25LC640: Examples, Pinouts, and Specs

Image of 25LC640
Cirkit Designer LogoDesign with 25LC640 in Cirkit Designer

Introduction

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.

Explore Projects Built with 25LC640

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
Image of LRCM PHASE 2 BASIC: A project utilizing 25LC640 in a practical application
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer
RTL8720DN-Based Interactive Button-Controlled TFT Display
Image of coba-coba: A project utilizing 25LC640 in a practical application
This circuit features an RTL8720DN microcontroller interfaced with a China ST7735S 160x128 TFT LCD display and four pushbuttons. The microcontroller reads the states of the pushbuttons and displays their statuses on the TFT LCD, providing a visual feedback system for button presses.
Cirkit Designer LogoOpen Project in Cirkit Designer
Cellular-Connected ESP32-CAM with Real-Time Clock and Isolated Control
Image of LRCM PHASE 2 PRO: A project utilizing 25LC640 in a practical application
This circuit integrates a LilyGo-SIM7000G module with an RTC DS3231 for timekeeping, interfaced via I2C (SCL and SDA lines). An 8-Channel OPTO-COUPLER is used to isolate and interface external signals with the LilyGo-SIM7000G's GPIOs. Power is managed by a Buck converter, which steps down voltage from a DC Power Source to supply the ESP32-CAM and LilyGo-SIM7000G modules, as well as the OPTO-COUPLER.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Based GPS Tracker with GSM Communication and Accelerometer
Image of Circuit Aayush: A project utilizing 25LC640 in a practical application
This circuit is designed for communication and location tracking purposes. It features an Arduino Nano interfaced with a SIM800L GSM module for cellular connectivity, a GPS NEO 6M module for obtaining geographical coordinates, and an AITrip ADXL335 GY-61 accelerometer for motion sensing. The LM2596 Step Down Module is used to regulate the power supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 25LC640

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of LRCM PHASE 2 BASIC: A project utilizing 25LC640 in a practical application
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of coba-coba: A project utilizing 25LC640 in a practical application
RTL8720DN-Based Interactive Button-Controlled TFT Display
This circuit features an RTL8720DN microcontroller interfaced with a China ST7735S 160x128 TFT LCD display and four pushbuttons. The microcontroller reads the states of the pushbuttons and displays their statuses on the TFT LCD, providing a visual feedback system for button presses.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LRCM PHASE 2 PRO: A project utilizing 25LC640 in a practical application
Cellular-Connected ESP32-CAM with Real-Time Clock and Isolated Control
This circuit integrates a LilyGo-SIM7000G module with an RTC DS3231 for timekeeping, interfaced via I2C (SCL and SDA lines). An 8-Channel OPTO-COUPLER is used to isolate and interface external signals with the LilyGo-SIM7000G's GPIOs. Power is managed by a Buck converter, which steps down voltage from a DC Power Source to supply the ESP32-CAM and LilyGo-SIM7000G modules, as well as the OPTO-COUPLER.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Circuit Aayush: A project utilizing 25LC640 in a practical application
Arduino Nano Based GPS Tracker with GSM Communication and Accelerometer
This circuit is designed for communication and location tracking purposes. It features an Arduino Nano interfaced with a SIM800L GSM module for cellular connectivity, a GPS NEO 6M module for obtaining geographical coordinates, and an AITrip ADXL335 GY-61 accelerometer for motion sensing. The LM2596 Step Down Module is used to regulate the power supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Data logging in embedded systems
  • Configuration and calibration data storage
  • Firmware storage for microcontrollers
  • Industrial automation systems
  • Consumer electronics requiring non-volatile memory

Technical Specifications

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

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the 25LC640 in a Circuit

  1. Power Supply: Connect the Vcc pin to a stable voltage source (2.5V to 5.5V) and the Vss pin to ground.
  2. SPI Connections:
    • Connect the CS pin to a GPIO pin on the microcontroller to enable/disable the device.
    • Connect the SCK, SI, and SO pins to the corresponding SPI pins on the microcontroller.
  3. Write Protect (WP): If write protection is required, tie the WP pin to Vcc. Otherwise, connect it to ground.
  4. HOLD Pin: If the hold function is not used, tie the HOLD pin to Vcc.

Important Considerations

  • Pull-Up Resistors: Use pull-up resistors on the CS, WP, and HOLD pins if they are not actively driven by the microcontroller.
  • Decoupling Capacitor: Place a 0.1 µF decoupling capacitor close to the Vcc pin to stabilize the power supply.
  • SPI Mode: The 25LC640 operates in SPI Mode 0 (CPOL = 0, CPHA = 0) or Mode 3 (CPOL = 1, CPHA = 1). Ensure the microcontroller is configured accordingly.

Example Code for Arduino UNO

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;
}

Troubleshooting and FAQs

Common Issues

  1. No Data Read/Write:
    • Ensure the CS pin is correctly toggled (low to enable, high to disable).
    • Verify SPI connections and ensure the microcontroller is configured for the correct SPI mode.
  2. Corrupted Data:
    • Check for noise on the SPI lines and ensure proper grounding.
    • Use a decoupling capacitor near the Vcc pin to stabilize the power supply.
  3. Write Operations Failing:
    • Ensure the WP pin is not tied to Vcc (write-protect mode).
    • Verify that the write cycle time (5 ms) is respected before initiating another operation.

FAQs

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.