How to Use the NRF24L01’s IRQ Pin to Generate an Interrupt With Arduino

Introduction: How to Use the NRF24L01’s IRQ Pin to Generate an Interrupt With Arduino

In this instructable we look at how to use the pulse signal from an nRF24L01+ transceiver module's IRQ pin to trigger an interrupt in Arduino. You can find the code from the video on my blog: http://forcetronic.blogspot.com/2016/07/using-nrf24l01s-irq-pin-to-generate.html

Be the First to Share

    Recommendations

    • The 1000th Contest

      The 1000th Contest
    • Battery Powered Contest

      Battery Powered Contest
    • Hand Tools Only Challenge

      Hand Tools Only Challenge

    3 Discussions

    0
    kintara58.
    kintara58.

    Tip 2 years ago on Introduction

    Thanks for the code. As an additional note : I found that the IRQ signal from the NRF24 stays LOW and so will not generate another IRQ until the Rxdata had been accessed. So, it’s very important to include your following code (or a similar action) in void interruptFunction() to reset the IRQ signel to HIGH.

    while(wirelessSPI.available()) { //get data sent from transmit
    wirelessSPI.read( &gotByte, 1 ); //read one byte of data and store it in gotByte variable . This will reset the IRQ signal so other IRQs can be sent.

    As the gotByte value was never used I assumed those two lines could be omitted - but they cannot. Without them the NRF24 would hold the IRQ pin LOW and so could not issue another IRQ.
    KIntara

    1
    JayendranR
    JayendranR

    Reply 2 months ago

    Hi Kintara,

    You could simply call whatHappened(tx_ok, tx_fail, rx_ready) on the object, passing three bool variables. The call clears the interrupt and you can selectively take an action based on the boolean flags.

    Cheers,
    Jay

    0
    TorstenL
    TorstenL

    6 months ago

    The links is broken, would be cool if it gets updated.