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

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

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

Introduction

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

Explore Projects Built with 25LC160

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Wi-Fi Controlled LCD Display with Pushbutton Interface
Image of DashboardNodeWiringDiagram: A project utilizing 25LC160 in a practical application
This circuit features an ESP32 microcontroller interfaced with an LCD display via an LCM1602 IIC module, and includes multiple pushbuttons and a potentiometer for user input. The ESP32 also communicates with an MCP2515 CAN controller, and the circuit is stabilized with several resistors and electrolytic capacitors.
Cirkit Designer LogoOpen Project in Cirkit Designer
RTL8720DN-Based Interactive Button-Controlled TFT Display
Image of coba-coba: A project utilizing 25LC160 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-Enabled IoT Device with Real-Time Clock and Power Management
Image of LRCM PHASE 2 BASIC: A project utilizing 25LC160 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
ESP32-Based Wi-Fi Controlled Robotic System with Multiple Sensors and Motor Drivers
Image of mit: A project utilizing 25LC160 in a practical application
This circuit is a sensor and motor control system powered by a 9V battery and regulated by a buck converter. It includes multiple sensors (SEN0245, SEN0427, I2C BMI160) connected via I2C to an ESP32 microcontroller, which also controls two N20 motors with encoders through an MX1508 DC motor driver.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 25LC160

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 DashboardNodeWiringDiagram: A project utilizing 25LC160 in a practical application
ESP32-Based Wi-Fi Controlled LCD Display with Pushbutton Interface
This circuit features an ESP32 microcontroller interfaced with an LCD display via an LCM1602 IIC module, and includes multiple pushbuttons and a potentiometer for user input. The ESP32 also communicates with an MCP2515 CAN controller, and the circuit is stabilized with several resistors and electrolytic capacitors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of coba-coba: A project utilizing 25LC160 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 BASIC: A project utilizing 25LC160 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 mit: A project utilizing 25LC160 in a practical application
ESP32-Based Wi-Fi Controlled Robotic System with Multiple Sensors and Motor Drivers
This circuit is a sensor and motor control system powered by a 9V battery and regulated by a buck converter. It includes multiple sensors (SEN0245, SEN0427, I2C BMI160) connected via I2C to an ESP32 microcontroller, which also controls two N20 motors with encoders through an MX1508 DC motor driver.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Data logging in embedded systems
  • Configuration and calibration data storage
  • Firmware or parameter storage in microcontroller-based systems
  • Industrial automation and control systems
  • Consumer electronics requiring small-scale non-volatile memory

Technical Specifications

The following table outlines the key technical details of the 25LC160:

Parameter Value
Memory Size 16 Kbits (2K x 8)
Interface 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 (tWC) 5 ms (typical)
Endurance 1,000,000 write/erase cycles
Data Retention 200 years
Operating Temperature Range -40°C to +85°C
Package Options PDIP, SOIC, TSSOP, MSOP

Pin Configuration and Descriptions

The 25LC160 is available in an 8-pin package. The pinout and descriptions are as follows:

Pin Name Type Description
1 CS Input Chip Select: Activates the device when pulled low.
2 SO Output Serial Data Output: Outputs data during read operations.
3 WP Input Write Protect: Disables all write operations when pulled low.
4 VSS Power Ground: Connect to system ground.
5 SI Input Serial Data Input: Receives data during write operations.
6 SCK Input Serial Clock: Synchronizes communication between the master and the EEPROM.
7 HOLD Input Hold: Pauses communication without resetting the SPI bus when pulled low.
8 VCC Power Power Supply: Connect to a voltage source (2.5V to 5.5V).

Usage Instructions

How to Use the 25LC160 in a Circuit

  1. Power Supply: Connect the VCC pin to a power 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 EEPROM.
    • Connect the SCK pin to the SPI clock pin of the microcontroller.
    • Connect the SI pin to the SPI MOSI (Master Out Slave In) pin.
    • Connect the SO pin to the SPI MISO (Master In Slave Out) pin.
  3. Optional Pins:
    • If write protection is required, pull the WP pin low.
    • If the hold feature is needed, connect the HOLD pin to a GPIO pin or pull it high if unused.
  4. SPI Configuration: Configure the SPI interface on the microcontroller with the following settings:
    • Clock polarity (CPOL): 0
    • Clock phase (CPHA): 0
    • Data order: MSB first
  5. Read/Write Operations:
    • To write data, send the WRITE instruction (0x02) followed by the memory address and data bytes.
    • To read data, send the READ instruction (0x03) followed by the memory address and read the data bytes.

Important Considerations and Best Practices

  • Ensure the CS pin is pulled high when the EEPROM is not in use to avoid unintentional operations.
  • Avoid exceeding the maximum clock frequency of 10 MHz to ensure reliable communication.
  • Use decoupling capacitors (e.g., 0.1 µF) near the VCC pin to stabilize the power supply.
  • Allow sufficient time for the write cycle (5 ms) to complete before initiating another write operation.
  • Use the WP pin to protect critical data from accidental overwrites.

Example Code for Arduino UNO

Below is an example of interfacing the 25LC160 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() {
  Serial.begin(9600);
  SPI.begin();
  pinMode(CS_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH); // Ensure CS is high initially
}

void loop() {
  // Write data to EEPROM
  writeEEPROM(0x0000, 0x42); // Write 0x42 to address 0x0000
  delay(10); // Wait for write cycle to complete

  // Read data from EEPROM
  byte data = readEEPROM(0x0000);
  Serial.print("Read Data: 0x");
  Serial.println(data, HEX);

  while (1); // Stop execution
}

void writeEEPROM(unsigned int address, byte data) {
  digitalWrite(CS_PIN, LOW); // Select the EEPROM
  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); // Deselect the EEPROM
}

byte readEEPROM(unsigned int address) {
  digitalWrite(CS_PIN, LOW); // Select the EEPROM
  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); // Deselect the EEPROM
  return data;
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Read/Write:

    • Ensure the CS pin is correctly toggled (low during operations, high otherwise).
    • Verify SPI connections and ensure the correct pins are used for MOSI, MISO, and SCK.
    • Check the power supply voltage and ensure it is within the operating range (2.5V to 5.5V).
  2. Corrupted Data:

    • Ensure the write cycle time (5 ms) is respected before initiating another operation.
    • Use decoupling capacitors to stabilize the power supply.
  3. Device Not Responding:

    • Verify the SPI clock frequency does not exceed 10 MHz.
    • Check the WP and HOLD pins; ensure they are configured correctly.

FAQs

Q1: Can I use the 25LC160 with a 3.3V microcontroller?
A1: Yes, the 25LC160 operates within a voltage range of 2.5V to 5.5V, making it compatible with 3.3V systems.

Q2: How many write/erase cycles can the 25LC160 handle?
A2: The device supports up to 1,000,000 write/erase cycles, ensuring long-term reliability.

Q3: What happens if power is lost during a write operation?
A3: The data being written may be corrupted. It is recommended to use a power-fail detection circuit to prevent such issues.

Q4: Can I use multiple 25LC160 devices on the same SPI bus?
A4: Yes, multiple devices can share the same SPI bus. Assign a unique CS pin for each device to select them individually.