nRF24 would not transmit when connected to Nano, but works fine with Mega

  • Hi,
    after exhaustive troubleshooting, using both logic analyzer and oscilloscope I'm giving up. I have three Arduino Mega boards that all operate nRF24 flawlessly. I have a number of Nanos that would read registers fine, but would not transmit a payload.

    The problem is when finding a parent. In the RF24.cpp there is a special treatment for broadcast. Namely, it disables the ACK. In the function RF24_sendMessage a mega would receive RF24_MAX_RT (well, it was trying to send but got no ACK). It flashes the Tx and the communication is established:

    // timeout counter to detect HW issues
    uint16_t timeout = 0xFFFF;
    do {
    	RF24_status = RF24_getStatus();
    } while  (!(RF24_status & ( _BV(RF24_MAX_RT) | _BV(RF24_TX_DS) )) && timeout--);

    My Nanos (some clones) would receive timeout instead. Apparently, it does not try to transmit.

    By means of logic analyzer, I could see that the signaling is absolutely equivalent, from Nano to nRF24 as from Mega and nRF24. Mega however does transmit stably, while Nano fails every time. Probably the nRF24 is more discriminative at SPI signaling.

    Does any one have any experiences similar to this? Any ideas maybe?

  • @etxmsol by some magic 5 minutes after I posted the solution dawned on me. I assumed Nano has a voltage regulator for 3V3 like Mega, but in fact it is the FTDI chip that generates 3V3 output. Better they did not have it!!! The typical current acc to spec is 15mA, max 24mA. About as per nRF24 spec for itself, but let alone the PA and LNA. Now when I use my Mega's 3V3 output to feed the nRF connected to Nano, everything is alive.

    Strangely, in my quest I used a Fluke to measure consumed current by nRF24 and I saw it is about 20mA for both Mega and Nano. It is likely that the actual moment of transfer is very short and probably just missed in measurements.

    Well, what a lesson!

  • Mod

    That is why a capacitor is usually necessary as the current used by the chip spikes during transmission and voltage regulators usually can not keep up

  • @gohan said in nRF24 would not transmit when connected to Nano, but works fine with Mega:

    voltage regulators usually can not keep up

    LP2985 on Mega gives 150mA, which is at least in double excess of the highest nRF24 +LNA+PA can consume. It should do fine without the cap.

    On Nano it is not a voltage regulator. FTDI chip converts serial to USB. And for Nano I did use the caps 4, 10 and 20 uF - none helped. Honestly, I haven't noticed any effect of these caps so many on the forum talk about. If it works, it works, if not - bad luck. I can believe in a very rare case the extra charge of a 20uF cap could topple the scale, giving illusion that this is a solution.

    When I reduced from RF24_PA_MAX to RF24_PA_HIGH it started to work sometimes. When down to RF24_PA_LOW it works stable. However I transmit 7 bytes only, the payload can be up to 32 bytes. This will further increase power requirements and will further short 3V3 output.

    In order to save MySensors lib from ungrounded suspicions (which I had) and simply to act professionally we should admit that on Nano the 3V3 output should not be used. Otherwise the behavior is undefined. Even without PA. The spec for nRF24 says 14mA at transmission. The spec for FTDI says it 15mA typical, 24mA max. It is an unacceptable low margin for expecting stable communication.

Log in to reply

Suggested Topics