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

17K205

Intro: 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

3 Comments

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
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
The links is broken, would be cool if it gets updated.