Arduino UNO and EEPROM
Project Description: EEPROM SPI Communication with Arduino
In this quick tutorial, we'll explore how to communicate with an EEPROM (Electrically Erasable Programmable Read-Only Memory) using SPI (Serial Peripheral Interface) with an Arduino. The project utilizes the SPI library to enable writing and reading data to and from the EEPROM, demonstrating a practical use of non-volatile memory.
Requirements
- Arduino Uno.
- 25AA160A EEPROM.
- Breadboard and jumper wires.
- SPI communication enabled on the Arduino.
Features
- Write data to the EEPROM.
- Read data back from the EEPROM.
- Display the data in the Serial Monitor.
The 25AA160A EEPROM has both a Write Protect (WP) and Hold (HOLD) pin. Here's how these pins are used and connected:
Write Protect (WP):
- The WP pin is used to prevent accidental writes to the EEPROM.
- When WP is connected to GND, the write protect feature is disabled, and writing to the EEPROM is allowed.
- When WP is connected to VCC, the write protect feature is enabled, blocking write operations to the EEPROM.
Hold (HOLD):
- The HOLD pin is used to pause communication without terminating the current SPI transaction.
- When HOLD is connected to GND, the communication is paused.
- When HOLD is connected to VCC, the communication operates normally.
| EEPROMPin | Arduino Uno Pin | Description |
|---|---|---|
| CS | Pin 10 | Chip Select (Active Low) |
| SCK | Pin 13 | Serial Clock |
| SI | Pin 11 | Serial Input (MOSI) |
| SO | Pin 12 | Serial Output (MISO) |
#define WRITE_ENABLE 0x06: This command enables write operations on the EEPROM. Before writing any data, this command must be sent to allow the EEPROM to accept write instructions.
#define WRITE_DISABLE 0x04: This command disables write operations. It prevents further write commands from being executed, ensuring that no accidental overwrites occur.
#define READ_DATA 0x03: This command is used to read data from the EEPROM. When sent, the EEPROM returns the data stored at the specified address.
#define WRITE_DATA 0x02: This command initiates the writing of data to the EEPROM. It must be followed by the target address and the data to be written.
#define RDSR 0x05: This command reads the status register of the EEPROM. The status register contains information about the current state of the EEPROM, such as whether it is busy or ready for the next operation.
#define WRSR 0x01: This command writes to the status register. It allows modifications to specific settings within the EEPROM, such as configuring write protection
CODE:
You may also like
EmbedLab Team
Embedded systems engineer and educator. Writes weekly tutorials at EmbedLab to help beginners ship real hardware.
Related projects
Arduino and shift register
Project Description This Arduino project with code is a smart parking status display system designed to monitor and show the availability of parking spots in real-time. It leverages a 74HC165 s
Arduino traffic lights
This project implements a traffic light system with a countdown timer , designed using an Arduino microcontroller. It controls a sequence of traffic lights (red, yellow, and green) and a 7-segme
Arduino and Multiplexer
Hello In this article we will see how you can increase the output of the Arduino UNO board by using the 74HC4051 Multiplixer , we wil controll 8 LEDS! This Project is simulated using Proteu
Arduino buzzer + 4511 bcd + 7SEG
This Arduino code implements a countdown timer with a 7-segment display driven by a 4511 IC, a buzzer for an alarm, and an optional start/reset button. Here's a brief explanation: Components and
Arduino IR + LCD + Proteus8
Smart parking systems are innovative solutions that use sensors and microcontrollers to detect and display parking availability. This article explains how to build a basic smart parking system



