This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF24L01+ transmitting before auto acknowledgement is complete.

I'm running into a weird timing issue with a nRF24L01+ which I'm not quite sure how to work around in the general case. The basic setup is two radios, A and B. Auto acknowledgement is enabled on both radios. I'm transmitting a single packet from A to B and then attempting to respond with a packet from B to A. It appears that if I attempt to transmit the packet from B before the ack packet (from the original A->B transmission) is sent, the manually generated packet will never get transmitted.

The two attached traces (from the perspective of B) show a broken example and a working example. The only difference between the two is a 25 microsecond delay added before I attempt to transfer the response packet. nordic_ce, nordic_irq, and VDD_PA are all directly from radio B. loop, nordic_interrupt, process_interrupt, process_rx, and prepare_tx are all instrumented sections of my code.

In the broken example, the CE pulse to start the transmission happens when VDD_PA is still high. In this case, the IRQ never triggers, the FIFO_STATUS register says the transmit FIFO is not empty, and the STATUS register never shows TX_DS or MAX_RT high. Leaving the CE pin high forever gives exactly the same behavior. Turning off auto-ack on B does work with the shorter timing.

In the working example, the CE pulse happens after VDD_PA is low again. In this case, it looks like the packet gets transmitted twice, and then the IRQ pin goes low again.

My interpretation is that attempting to transition from RX mode to TX mode while the radio is auto-ack'ing doesn't actually put it into the TX mode state. Unfortunately, I don't see an obvious way to detect when the auto-ack is completed. I'm assuming I can avoid this problem by turning off auto-ack when I'm planning on sending a response, or by using an ack payload. However it seems possible to end up in this same situation with a more complex example. For example, when attempting to send a packet without realizing a packet has just been received.

Questions: [list=1] [] Any other explanations for why the broken example never transmits the response packet? [] Is there any way to determine when auto-ack is running or complete? [] Is there a feedback mechanism that I can use to detect that I didn't successfully initiate a transmission other than observing that the TX fifo isn't empty after a timeout? [] Is manually sending packets from a "primary receiver" with auto-ack enabled not generally supported? [/list]

Thanks for any insight!

broken.png

working.png

Related