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

Interrupts with NRF24LE1 (Part 3/14)

By Amanpreet Singh May 7, 2023

Interrupts with NRF24LE1

In our daily life we get distracted or interrupted by others many times. In that condition we suspend our ongoing work and pay attention to what others have to say. We only resume our previously suspended work after the completion of the interrupted task. The master which controls the processing of thoughts in us is our brain. The brain stops processing ongoing thoughts when we get interrupted and starts processing the other task. It resumes the previous ongoing processing when the task is complete. The controller works in a similar manner. Here, we will study interrupts associated with our NRF.

Final Interrupt

Fig. 1: Prototype of NRF24LE1 Interrupt Demonstration

We all know the task of interrupts in any controller. It tells the microcontroller to suspend its current execution of code, save the current state and process interrupt request. Controller processes interrupt request by jumping to Interrupt Service Routine (ISR) or Interrupt Handler. ISR is a function or procedure defined in the code which gets executed when interrupt occurs. Same is the case with NRF.

In NRF24LE1, there are total 18 sources for interrupts out of which 4 are hardware based and the rest are software based. Each Interrupt source has a vector address at which ISR has to be written. These interrupts can be level triggered (Low/High) or Edge triggered (Rise/Fall).
The attached image consists of different sources, vector address, polarity and their description.
In 32 pin package, there are 2 external hardware interrupts: INT0 and INT1. Interrupt pin for INT0 is P0.5 and for INT1 is P0.6.
Image of NRF24LE1 Interrupt Demonstration
Fig. 2: Image of NRF24LE1 Interrupt Demonstration
Interrupts can be controlled through various registers detailed below :
• Interrupt Enable 0 Register (IEN0) – An 8-bit register used to enable/disable global interrupts and Timer0, Timer1, Timer2, Port 0 and Serial Port individual interrupts.
• Interrupt Enable 1 Register (IEN1) – An 8-bit register used for enabling/disabling RF, SPI and Timer2 interrupts.
• INTEXP – This register enables/disables 2 wires, master and slave SPI interrupts. This register is also used to choose between INT0, INT1 and INT2.
• IP0 and IP1 (Interrupt Priority) – Two 8-bit registers used to set the priority levels among different sources.
• Interrupt Request Control Register (IRCON) – An 8-bit register this register contains interrupt request flags.
For software interrupt, we need to enable them according to functionalities we are using. For example, if we are using Timers then we will enable Timer interrupt which is associated with the internal timers of our module.
Image of NRF24LE1 Interrupt Demonstration
Fig. 2: Image of of NRF24LE1 Interrupt Demonstration
Presently we are focused on discussing hardware interrupts INT0. Some simple steps through which we can configure INT0 are-:
• First write 1 in bit7 of IEN0 to enable global interrupts and 1 in bit0.
• Write 1 in bit3 of INTEXP to select INT0.
• We have to write ISR for INT0
We have also written a code to explain the working of interrupt INT0. Besides, an LED blinking program has been written in our interrupt service routine. So the LED will blink whenever an interrupt occurs.
Check out the commented code for more details. Stay tuned for more articles in the series.

 

Project Source Code

###

//Program to 

#include"reg24le1.h" // I/O header file for NRF24LE1
#include // header file containing standard I/O functions
#include"hal_delay.h" // header file containing delay functions
#include"isrdef24le1.h" //header file containing Interrupt Service Routine definition for NRF24LE1
 
// main code
void main()
{
P0DIR = 0xf0; // make upper 4 bits of Port0 as input
P1DIR = 0;  // set Port1 as output
P1 = 0x00; // make all pins of Port1 low
IEN0 = 0x81; // enable interrupt from pin
INTEXP = 0x08; // enable INT0
while(1); // infinite loop, wait for interrupt
 
}
 
// Interrupt Service Routine
EXT_INT0_ISR()
{
P1 = 0xff; // make all pins of Port1 high
delay_ms(1000); // delay of 1 second
P1 = 0x00; // make all pins of Port1 Low
delay_ms(1000);  // delay of 1 second
}

###

 

Circuit Diagrams

Circuit-Diagram-NRF24LE1-Interrupt-Demonstration

Project Video


Filed Under: Tutorials

 

Next Article

← Previous Article
Next Article →

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.

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