Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Using EEPROM of NRF24LE1 (Part 5/14)

By Amanpreet Singh

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

 

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

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!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a loop calibrator? 
  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • What was before microcontrollers ?
  • Measure AC current accurateley (100mA to 10A)
  • 74HC595 creating Fake output
  • NEED HELP FOR OP-AMP IN BGR
  • Check undesired substrate mode...

RSS Electro-Tech-Online.com Discussions

  • Control Bare LCD With ATmega328p
  • Need a ducted soldering fan for solder smoke extraction
  • Sla ir li ion
  • Question about ultrasonic mist maker
  • Best way to reduce voltage in higher wattage system?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering