0

I'm trying to communicate between Arduino Nano and Arduino Uno using nRF24L01+.

I tried using RF24 by ManiacBug and TMRH20, but when I open the serial monitor after uploading the Example Programs Getting Started from ManiacBug and pingpair Program from TMRH20, it does not change its address.

The addresses for reading and writing I'm using are 0xF0F0F0F0E1LL and 0xF0F0F0F0D2LL, but the response I'm receiving is as follows: enter image description here

I check all the connection and tried different examples available on the internet, but nothing worked at all.

1

You can set addresses using SPI commands. For example a 5-byte transmitter address could be written as (MSB first):

  digitalWrite(CSN_pin, LOW);
  SPI.transfer(0x30); // write TX_ADDR register
  SPI.transfer(tx_addr[0]);
  SPI.transfer(tx_addr[1]);
  SPI.transfer(tx_addr[2]);
  SPI.transfer(tx_addr[3]);
  SPI.transfer(tx_addr[4]);
  digitalWrite(CSN_pin, HIGH);

where tx_addr is an array of 5 bytes. Similarly you can write to the RX_ADDR registers, see the nRF24L01+ datasheet, section 9 for the register map.

Furthermore, the following code allows you to read the TX_ADDR register:

  digitalWrite(CSN_pin, LOW);
  SPI.transfer(0x10); // read TX_ADDR register
  data_out[0] = SPI.transfer(0x0);
  data_out[1] = SPI.transfer(0x0);
  data_out[2] = SPI.transfer(0x0);
  data_out[3] = SPI.transfer(0x0);
  data_out[4] = SPI.transfer(0x0);
  digitalWrite(CSN_pin, HIGH);

  Serial.print("TX_ADDR=");
  Serial.print(data_out[0]);
  Serial.print(data_out[1]);
  Serial.print(data_out[2]);
  Serial.print(data_out[3]);
  Serial.println(data_out[4]);
  • @MichaeIT I tried this solution, but no luck. I've gone through github.com/nRF24/RF24/issues/211 thread, but still no luck. – Teck Freak Mar 10 at 12:53
  • Try writing and reading, as suggested in the above example. If this does not work, then there is some problem with the SPI. – MichaelT Mar 10 at 13:43
  • I tried this, and getting the response 00000. SPI of arduino is problem or nRF? As I tried different nRF and Arduino. – Teck Freak Mar 10 at 15:33
  • @MichaeIT I am successful in making it work on Arduino Uno by connecting MISO, MOSI and SCK pins directly to the ICSP header pins, but not successful in Arduino Nano. – Teck Freak Mar 10 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.