What pin connections work?

I can't get any RF connection between two instances of GettingStarted.ino - (File --> Examples --> RF24 --> GettingStarted). One has the declaration
bool radioNumber = 0;
the other
bool radioNumber = 1;.
Each starts normally, each appears to transmit when the instruction is given, neither receives.

I have followed the instructions in Terry King's page including
1. Connect one nRF24L01 to your first Arduino according to the table above (Use the TMRh20 RF24 Library column connections). This specifies CE -> 7, CSN -> 8, MOSI -> 11, MISO -> 12, and SCH -> 13.

Another source specifies the MISO, SCK, and MOSI connections to some of the set of six pins labelled ICSP at the right-hand end of the board.

but then goes on to state

On Arduino UNO boards SPI pins are connected with some digital pins. While using modem you most remember that these digital pins won’t be available.

MOSI is connected to the digital pin 11     
MISO is connected to the digital pin 12     
SCK is connected to the digital pin 13    
SS (not used, but also blocks) is connected to the digital pin 10

That's confusing enough, but I can't find an SS pin anywhere.

Then there is the mystery of the IRQ pin. Terry specifies its use for RF24, but not for RF24(TMRh20).

Honestly, "The hurrieder I go the confuseder I get!"

Would someone please unravel this for me. I think this is all that stands between me and getting RF communication going. (I am using Arduino v. 1.6.12 and RF24(TMRh20) with Arduino UNOs and NRF24L01 PCBs.)

Thanks

This might be helpful in understanding the SS pin as it relates to SPI:
https://www.arduino.cc/en/Reference/SPI

Note about Slave Select (SS) pin on AVR based boards

All AVR based boards have an SS pin that is useful when they act as a slave controlled by an external master. Since this library supports only master mode, this pin should be set always as OUTPUT otherwise the SPI interface could be put automatically into slave mode by hardware, rendering the library inoperative.

It is, however, possible to use any pin as the Slave Select (SS) for the devices. For example, the Arduino Ethernet shield uses pin 4 to control the SPI connection to the on-board SD card, and pin 10 to control the connection to the Ethernet controller.

So what this means is that even if SS is not used you still need to be careful about how you use that pin when you're using SPI. This is why usually the microcontroller's SS pin(pin 10 on Uno and similar) is used when one is required even though any pin could be used to control the SPI slave device when the microcontroller is being used in SPI Master mode. If slave select is not used(as appears the case from the quote you posted) then you still need to be careful of what you do with the SS pin since if it goes LOW the microcontroller will be put in SPI Slave mode.

Further to what pert said, the hardware SS pin, (pin 10 on an UNO), is automatically made an output by the "SPI" library in the 'begin()' function, and if another pin is used for SS pin 10 can be used for general digital output without upsetting SPI operation. (Just don't make it an input, because as pert says, if it's an input and goes low it will cause problems.)

From the 'begin()' function in "SPI.cpp":-

// When the SS pin is set as OUTPUT, it can be used as
// a general purpose output port (it doesn't influence
// SPI operations).
pinMode(SS, OUTPUT);

Edit: I only mentioned this because many people and some example sketches indicate that the hardware SS pin must explicitly be made an output in your program even if it's not used, but that's not necessary since it's done automatically.

Note, though, that if you do use a different pin, that pin must be made an output, either by your code or any library that uses it.

pert
I read that page about SPI and plunged deeper into despair :disappointed_relieved: . Like many technical documents, not just in electronics, it appears to be written for people with a basic understanding of the subject and an easy familiarity with the jargon. To be honest, it was not much use to me … but … with that, the comments from OldSteve, and the Wikipedia page I get the impression that I can forget about pin 10, forget about SS altogether, just don’t use pin 10 as an INPUT while using SPI.

That leaves two small mysteries for my starting post on this thread.

  1. The IRQ pin, number 8, on the NRF24L01 PCB. I am assuming that that is an Interrupt Request pin and of no significance in a program as simple as GettingStarted.
  2. Is there anything to be gained or lost using the MOSI, MISO, and SCK pins in the ISCP set as against using pins 11, 12, an 13?

FTR: while setting up again this afternoon I put my meter across the Gnd and Vcc pins on one of the UNOs while it was running the Blink program. There is a substantial fluctuation in voltage with the blinking of the on-board LED, which explains Terry’s concern about power supply to the NRF24L01. In my setup, my NRF24L01s have independent, stabilized power.

Despite that, when the GettingStarted hardware is set up and the Arduino software is compiled and uploaded (see photo too big to attach) starting serial monitor for radioNumber = 0 outputs

RF24/examples/GettingStarted
*** PRESS 'T' to begin transmitting to the other node
Sent response 1953518614
Sent response 4096
Sent response 269488144
Sent response 353834516
Sent response 1461000021
Sent response 0
Sent response 0
Sent response 0
Sent response 269484032
Sent response 0
Sent response 0
Sent response 8192
Sent response 0
Sent response 672141332
Sent response 0
Sent response 0
Sent response 0
Sent response 269484032
Sent response 269484032
Sent response 268435456
Sent response 1342308629
Sent response 1316117
Sent response 1316117
Sent response 336925973
Sent response 4
Sent response 0
Sent response 0
Sent response 268435968
Sent response 1410662656
Sent response 268435456
Sent response 0
Sent response 0
Sent response 0
Sent response 269751552
Sent response 337137749
Sent response 0
Sent response 269504530
Sent response 16
Sent response 5246976
Sent response 0
Sent response 1427116032
Sent response 1343225856
Sent response 0
Sent response 134217744
Sent response 0
Sent response 0
Sent response 0
Sent response 0

(note that this is without radioNumber = 1 even being powered up). When radioNumber = 1 is powered up (radioNumber = 0 continues on its merry way) it reports

RF24/examples/GettingStarted
*** PRESS 'T' to begin transmitting to the other node

.

Then, entering ‘T’ in the monitor for radioNumber = 0 I get

Sent response 3147008
Sent response 0
Sent response 50331648
Sent response 0
Sent response 0
Sent response 0
Sent response 0
Sent response 0
Sent response 335544320
Sent response 48
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending
failed
Sent 22250916, Got response 0, Round-trip delay 10156 microseconds
Now sending
Sent 23262528, Got response 0, Round-trip delay 17724 microseconds
Now sending
Sent 24281700, Got response 268435456, Round-trip delay 18320 microseconds
Now sending
Sent 25301860, Got response 0, Round-trip delay 17888 microseconds
Now sending
Sent 26321204, Got response 0, Round-trip delay 18380 microseconds
Now sending
Sent 27341036, Got response 0, Round-trip delay 18272 microseconds
Now sending
Sent 28360764, Got response 0, Round-trip delay 18340 microseconds
Now sending
Sent 29380556, Got response 66304, Round-trip delay 18196 microseconds
Now sending
Sent 30400400, Got response 16, Round-trip delay 18132 microseconds
Now sending
Sent 31420020, Got response 0, Round-trip delay 18384 microseconds
Now sending
Sent 32439852, Got response 0, Round-trip delay 18208 microseconds
Now sending
Sent 33459512, Got response 0, Round-trip delay 18240 microseconds
Now sending

Here’s the rub:

This is not my code! Apart from the change in radioNumber in one of the code instances it is just as loaded out of the Arduino IDE. I have, to the best of available equipment, dealt with the issue of power supply to the NRF24L01s. I have, once again, carefully complied with Terry’s instructions on how to run GettingStarted, and it still refuses to run.

I am forced to the conclusion that this is another instance of what I remember Terry describing as something like “Works today, but not tomorrow!” How can we find out if it is, indeed, a problem on the Arduino side, and if it is then how does it get fixed?

vagulus:
Is there anything to be gained or lost using the MOSI, MISO, and SCK pins in the ISCP set as against using pins 11, 12, an 13?

On the Uno and similar boards(such as Nano, Pro Mini, and various ATmega328P based clones) they are all connected to the same pins on the microcontroller so there's no difference. However, if you look at the Connections chart on the SPI reference page you'll see that 11, 12, 13 are not universally connected to the SPI pins. Mega has them on 51, 50, 52, Leonardo doesn't even have them connected to pins. So the benefit of using the ICSP header is it's universal. This is how the "Mega compatible" shields that use SPI are able to work on all three board types.

Okay. So, if I am short of pins I can use the ICSP pins for the NRF24L01 and 11, 12, and 13 for other things? Andu] 10 for anything except an input?

vagulus:
So, if I am short of pins I can use the ICSP pins for the NRF24L01 and 11, 12, and 13 for other things?

You misunderstood what I said:

pert:
On the Uno and similar boards(such as Nano, Pro Mini, and various ATmega328P based clones) they are all connected to the same pins on the microcontroller

If you did a continuity test you'll see that the ICSP pins and the Arduino pins are connected. There's absolutely no difference between connecting to one or the other on the Unos you're using. However, SPI is a bus. That means theoretically you can connect multiple SPI devices to those same pins and only need to use a separate SS pin for each, though this doesn't always work in practice.

Hi pert

I read
However, SPI is a bus.
and my eyes glaze. :cold_sweat: I don't understand what that means. However, I don't think I need to know at the moment. My problem is to get some RF connection. I'll be trying the code in the Starter Kit page in the morning. If that doesn't work there is something weird going on.