Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Using EEPROM of NRF24LE1 (Part 5/14)

By Amanpreet Singh May 7, 2023

EEPROM with NRF24LE1

All the good and bad incidents are stored in the brain memory of humans. Similarly, the controller uses EEPROM to save data or variables. In this article, we will see how to use the EEPROM of NRF24LE1 and what are its uses?

Do you know what makes the memory in electronics? Let’s take an example of a capacitor. It has the capability to hold voltage and thus it’s treated as memory component. There are two types of memories in electronics; Volatile and non-volatile. The volatile one gets erased if the power supplied to this memory is cut. That means the data stored will be erased in case of power failure. The non-volatile has an advantage of holding data even when the power is off. The most common example of volatile memory is the RAM used in our computers. The examples of volatile memory are hard disk, SD cards, EEPROM, etc.

Prototype of NRF24LE1 and EEPROM Interfacing

Fig. 1: Prototype of NRF24LE1 and EEPROM Interfacing

In this article, we will focus on EEPROM in our NRF module and its use. EEPROM stands for Electrically Erasable Programmable Read Only Memory. It is a type of Non-Volatile. It can be programmed and erased by providing special programming signals. They are available in small sizes and can be easily interfaced with AVR, Arduino or PIC.  Sometimes they are inbuilt in microcontrollers. But for expansion of memory we have to use the external one.

The NRF24LE1, being an amazing component, has inbuilt EEPROM memory. It has 1.5 Kb of Non Volatile data memory. This memory proves useful when we interface sensors and want to retain the readings for future use. For using read and write features of this memory we will use function in our code.

We will use nrfsdk (software development kit) provided by Nordic Semiconductor Ltd.

Please visit our previous article on NRF24LE1 for more help.

Some functions we will be using to read and write EEPROM are:

• lib_eeprom_byte_write() – This function takes address location and a byte data to be written.

• lib_eeprom_bytes_write() – This function take multiple bytes of data along with the number of bytes and starting address.

• lib_eeprom_byte_read() – This function outputs a byte data from the provided memory address.

• ib_eeprom_bytes_read() – This function outputs multiple bytes data from the provided starting memory location
The description of the various functions is:
FUNCTION INPUT PARAMETER OUTPUT DESCRIPTION
lib_eeprom_byte_write() 8-bit address and 8-bit data – To write 8-bit data to specified –bit address
lib_eeprom_bytes_write() 8-bit address, 8-bit pointer to bytes to write and 8-bit value indicating number of bytes to write – To write multiple bytes to specified starting address
lib_eeprom_byte_read() 8-bit address 8-bit data To read 8-bit data from specified 8-bit address
lib_eeprom_bytes_read() 8-bit address, 8-bit pointer to bytes to write and 8-bit value indicating number of bytes to read – To read multiple bytes from specified starting address.

 

For complete understating, please take a look at the implementation of these functions in the code. The code has been commented for greater understanding.

We will write some data to EEPROM memory and then we will restart our system. After that we will read the previously stored data to check the working of the EEPROM.

 

Project Source Code

###

//Program to 

/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.

 *
 * The information contained herein is confidential property of Nordic
 * Semiconductor ASA.Terms and conditions of usage are described in detail
 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 * $LastChangedRevision: 133 $
 */
 
#include "reg24le1.h" // I/O header file for NRF24LE1
#include "lib_eeprom.h" // header file containing eeprom read/write functions
#include "hal_delay.h" // header file containing delay functions
 
 
// main code
void main()
{
P1DIR = 0; // set Port1 as output
 
P1 = 0; // make all pins of Port1 low
 
P1 = lib_eeprom_byte_read(0x00); // load 8-bit data from eeprom at address 0x00
delay_ms(2000); // delay of 2 seconds
 
while(1) // infinite loop
{
 
P10 = 0; // make pin0 of port1 low
P11 = 0; // make pin1 of port1 low
lib_eeprom_byte_write(0x00, P1); // write P1 register data to eeprom
delay_ms(2000); // delay of 2 seconds
lib_eeprom_byte_write(0x00, P1); // write P1 register data to eeprom
P10 = 1; // make pin0 of port1 high
P11 = 0; // make pin1 of port1 low
lib_eeprom_byte_write(0x00, P1); // write P1 register data to eeprom
delay_ms(2000); // delay of 2 seconds
P10 = 0; // make pin0 of port1 low
P11 = 1; // make pin1 of port1 high
lib_eeprom_byte_write(0x00, P1); // write P1 register data to eeprom
delay_ms(2000); // delay of 2 seconds
P10 = 1; // make pin0 of port1 high
P11 = 1; // make pin1 of port1 high
lib_eeprom_byte_write(0x00, P1); // write P1 register data to eeprom
delay_ms(2000); // delay of 2 seconds
 
}
}

###

 

Circuit Diagrams

Circuit-Diagram-NRF24LE1-EEPROM-Interfacing

Project Video


Filed Under: Tutorials

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Voltage mode pushpull is a nonsense SMPS?
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe