3

Im building an RC car project and using 2 NRF24's for communication. I own an Arduino Uno, Nano and Nano Every. The NRF's work great with the Uno and Nano in any combinations but using a Nano Every either as TX or RX doesn't work.

I have tried the NRF24 and NRFLite and both say "Cannot communicate with radio".

When using the NRFLite library examples Basic_TX on the Uno/Nano and Basic_RX on the Nano Every, the Uno/Nano says transmission was successful even though the Every says "Cannot communicate with radio". This lasts about 1 second before the Uno/Nano says the transmission failed again. This happens every time you reset the Every. It is as if the NRF24 gets powered on but then is unable to communicate with the Every.

I am using power adapters for the NRF's and powering them through the 5v pin. No luck with capacitors either. Have swapped out all the wires and also double checked all connections.

Is there something wrong with the Nano Every? Does it work with a NRF24 for anyone?

I have completely ran out of ideas to fix this. Thank you in advance

4
  • 1
    How do you wire the Nano Every and define your pin definition on your sketch? Nano Every has SS pin on D8, not like most of the Arduino AVR-based boards on pin 10.
    – hcheung
    Jul 27, 2021 at 1:22
  • Hi hcheung! I have the SCK on D13, MISO on D12, MOSI on D11, CE on 7 and CSE on 8. I'm not sure what the SS pin is :(
    – Sumemerboy
    Jul 27, 2021 at 14:43
  • SS is Slave Select, some called Chip Select (CS), you might want try to use pin 8 as CE, and pick another pin for CSE.
    – hcheung
    Jul 27, 2021 at 15:08
  • Sadly no luck with that. I bought a new nrf24 and that didnt help either, it worked with the regular Nano tho. Looks like my Nano Every is just broken.
    – Sumemerboy
    Jul 29, 2021 at 9:39

1 Answer 1

3

I stucked with the same problem too when use nRF24L01+ and Arduino Nano Every to transmit data to Arduino Uno with nRF24L01+. So I have solved the problem as follows below. I hope it could help you and for somebody else.

  1. First of all you should add Arduino megaAVR Boards in the boards manager.

1.1 It is first necessary to add the URL of their Boards Manager JSON file in: File > Preferences > Additional Boards Manager URLs and Paste the link: https://raw.githubusercontent.com/amperka/iskra-boards/master/package_amperka_index.json

1.2. Then go to Tools>Boards Manager, search Arduino SAMD Boards and install it

enter image description here

1.3. Choose Arduino Nano Every in Tools>Board>Arduino megaAVR Boards>Arduino Nano Every

enter image description here

  1. Upload the library for RF24. It must be compatible for architecture megaavr because Arduino Nano Every uses Microchip ATmega4809. I use the latest version RF24-1.4.1. Here is the link to the library: https://www.arduinolibraries.info/libraries/rf24

  2. You should check whether you connected nRF24L01+ and arduino correctly.

The pinout of Arduino Uno is as follows: 5V - VCC if you connect nRF24L01+ via nRF24L01+ adapter (I use adapter) or 3.3V - VCC without adapter

GND - GND

9 pin - CE

10 pin - CSN

11 pin - MOSI

12 pin - MISO

13 pin - SCK

not connected - IRQ

However, I use another pinout for Arduino Nano Every. When I use the same pinout as Arduino Uno it can't find nRF24L01+. You can check it in Serial Monitor by using a sketch below. If you get zeros in the third line, for example, something like this: RX_ADDR_P0-1 = 0x0000000070 0x0000000000. It means that Arduino Nano Every isn't connected to nRF24L01+ correctly and Arduino Nano Every doesn't see it. I suppose the problem with the library of RF24 and it should be fixed. Perhaps I'm wrong and the problem with another things.

So I use the following pinouts for Arduino Nano Every: 5V - VCC if you connect nRF24L01+ via nRF24L01+ adapter (I use adapter) or 3.3V - VCC without adapter

GND - GND

10 pin - CE

A3 - CSN (if you will get zeros in the third line RX_ADDR_P0-1 in Serial Monitor then change A3 to another one. You can vary pin from A5 and so on until A0). do not use A7 and A6 because on some model dev boards, A6 and A7 are analog input only.

11 pin - MOSI

12 pin - MISO

13 pin - SCK

not connected - IRQ

The sketch for checking:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(10,A3);  // for arduino nano every
//RF24 radio(9,10); // for arduino uno

const uint8_t num_channels = 128;
uint8_t values[num_channels];
void setup(void)
{
  Serial.begin(9600);
  printf_begin();
  radio.begin();
  radio.setAutoAck(false);
  radio.startListening();

  radio.printDetails();
  delay(5000);

  radio.stopListening();
  int i = 0;
  while ( i < num_channels )  {
    printf("%x",i>>4);
    ++i;
  }
  printf("\n\r");
  i = 0;
  while ( i < num_channels ) {
    printf("%x",i&0xf);
    ++i;
  }
  printf("\n\r");
}
const int num_reps = 100;

void loop(void)
{
  memset(values,0,sizeof(values));
  int rep_counter = num_reps;
  while (rep_counter--) {
    int i = num_channels;
    while (i--) {
      radio.setChannel(i);
      radio.startListening();
      delayMicroseconds(128);
      radio.stopListening();
      if ( radio.testCarrier() )
        ++values[i];
    }
  }
  int i = 0;
  while ( i < num_channels ) {
    printf("%x",min(0xf,values[i]&0xf));
    ++i;
  }
  printf("\n\r");
}
int serial_putc( char c, FILE * ) {
  Serial.write( c );
  return c;
}

void printf_begin(void) {
  fdevopen( &serial_putc, 0 );
}

Here is the correct output in Serial Monitor the third line without zeros: RX_ADDR_P0-1 = 0xf0f0f0f0d2 0xc2c2c2c2c2

SPI Speedz  = 10 Mhz
STATUS      = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xf0f0f0f0d2 0xc2c2c2c2c2
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR     = 0xf0f0f0f0d2
RX_PW_P0-6  = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA       = 0x00
EN_RXADDR   = 0x02
RF_CH       = 0x00
RF_SETUP    = 0x14
CONFIG      = 0x0f
DYNPD/FEATURE   = 0x38 0x38
Data Rate   = 1 MBPS
Model       = nRF24L01+
CRC Length  = 16 bits
PA Power    = PA_HIGH
ARC     = 15

the next two lines are a list of available channels that should be read from top to bottom (i.e. we have 127 channels, еру channels are presented in 16-bit version, the first line is the first digit of each of 127 channels, the second line is the second digit of each of 127 channels).

00000000000000001111111111111111222222222222222233333333333333334444444444444444555555555555555566666666666666667777777777777777

0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

then the level of noisiness of the channels is displayed. There are noise from the channel 09 to the channel 3f approximately. this noise from my wifi router and some another electronics. you should choose free channels for your purpose.

00000010114663444533233300000000001000011233544433221100112223212010000000000000000000000000000000000000000000000000000000000000

00200000035575656777697332111321022125625559643632551111000333012000000000100000010001000000001000000000000011010000000000000000

00000001135a9a767767c89a85646565866555645897434644445200121212122000000000000000000000001000000000000000011000000010000000000000

00101000035567667357878a51123341220322335373542222122000112313112000000001010000000001000000020000000010000000000000100000000010

11000011047587577457694521122232111121243247542232210100002222111000000000100002000002000000000000000000000000000010000000000000

Note:

  1. Check Tools. There should be: Board:Arduino Nano Every; Registers emulation: "ATMEGA328"; Port:COM#(Arduino Nano Every).

  2. some transmission errors can occur due to poor contacts between wires and pins of arduino, so the wires should be soldered.

If everything is ok, then you can use your sketches for the receiver and transmitter respectively. Good luck!

5
  • so you say: pin 9 doesn't work as CE or pin 10 doesn't work as CS if Nano Every is used with ATmega328 emulation? could you try which one is the problem?
    – Juraj
    Sep 1, 2021 at 10:26
  • The problem is that CSN doesn't work on digital pins of Arduino Nano Every but it works on one of Arduino Uno. CSN works only on analog pins (A5-A0) of Arduino Nano Every. CE works well if you connect it to the 9 or 10 pin of arduino nano every. Actually I have found it accidentally. Sep 1, 2021 at 11:29
  • UPD: If you use registers emulation "None (ATMEGA4809)" it works too. I mean if you use pinout as shown above. Otherwise it doesn't work. Sep 1, 2021 at 11:36
  • I have no problem to use pin 10 as CS (for Ethernet) even in 328p emulation mode
    – Juraj
    Sep 1, 2021 at 12:12
  • 1
    Thank you for those excellent instructions. After days of trying to get this danged Nano Every to work with the nRF24L01+, your guide got it going! I can't think you enough. I hope it's ok to share this URL with others who are also struggling to date...?? Cheers
    – Blondie SL
    Sep 3, 2021 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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