NRF24 custom PCB not working

Hi,

I've created a custom PCB with an 328p and NRF24L01+, unfortunately it's not sending anything and I'm out of ideas.
What I've tried so far:

  • breadboard setup with a generic NRF24 module and Arduino Pro Mini: working
  • my PCB with identical software: not working
  • no data is received, and nothing is detected with a NRF24 scanner ("spectrum scanner")
  • all signals to the NRF look good and identical to the breadboard setup (MOSI, MISO, CS, CSN, SCK)
  • the 16mhz clock of the NRF is oscillating correctly

-> The HF part (NRF24 chip and all surrounding components) were assembled by JLCPCB
-> The NRF layout is pretty much identical to the reference from the datasheet
-> An antenna is connected
Here's the link to the project:

https://oshwlab.com/timbenning/lgb_track_controller

Look here Simple nRF24L01+ 2.4GHz transceiver demo - #30 by Robin2 post #30 . There is a test to see if thr mcu can communicate with the Nrf24L01 at the register level over SPI. That may help isolate the problem.

in my infinite wisdom, I've allocated pin 0 and 1 as CS and CSN. Therefore I can't simultaneously communicate with the NRF24 and have a serial connection for debugging.
I can try to use the LEDs as indicator, but it's a bit difficult to read anything from it.

Ok. You can probably use software serial and an external USB/ UART adaptor. Use say pins pb1 abd pb2 and try to grab these at say U1.

Otherwise, debugging is not going to be easy. I tend to litter all my boards, where I am using unfamiliar chips, with jumpers so I can isolate parts. Then I sometimes omit the full integrated breadboard testing stage.

the software serial is not working yet. There's no signal on the allocated pins 13 and 14 whatsoever...
maybe i have a better update in a while

I have a small ATmega328P 3,3V based board that takes a single i

You allocated pin 0 and 1 to the NRF24, but why ?

Debugging the proptotype must have been fun .............

For the normally essential debugging stuff, you can use send only software serial, only one pin needed.

Serial works now (although not on pin 14 for some reason).
Anyway, the example code you mentioned doesn't work properly with software serial it seems.
I modified it to use mySerial.println instead of Serial.println, but the radio.printDetails() function uses the normal Serial output instead of software serial it seems. Not sure how to amend the library to fix that.
This is my code:

// 18 Mar 2018 - simple program to verify connection between Arduino
//      and nRF24L01+
//  This program does NOT attempt any communication with another nRF24

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

#include <printf.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX


#define CE_PIN   1
#define CSN_PIN  0

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;


void setup() {
    mySerial.begin(9600);
    printf_begin();

    mySerial.println("CheckConnection Starting");
    mySerial.println();
    mySerial.println("FIRST WITH THE DEFAULT ADDRESSES after power on");
    mySerial.println("  Note that RF24 does NOT reset when Arduino resets - only when power is removed");
    mySerial.println("  If the numbers are mostly 0x00 or 0xff it means that the Arduino is not");
    mySerial.println("     communicating with the nRF24");
    mySerial.println();
    radio.begin();
    radio.printDetails();
    mySerial.println();
    mySerial.println();
    mySerial.println("AND NOW WITH ADDRESS AAAxR  0x41 41 41 78 52   ON P1");
    mySerial.println(" and 250KBPS data rate");
    mySerial.println();
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.setDataRate( RF24_250KBPS );
    radio.printDetails();
    mySerial.println();
    mySerial.println();
}


void loop() {

}

and this is the output:

FIRST WITH THE DEFAULT ADDRESSES after power on
  Note that RF24 does NOT reset when Arduino resets - only when power is removed
  If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
     communicating with the nRF24



AND NOW WITH ADDRESS AAAxR  0x41 41 41 78 52   ON P1
 and 250KBPS data rate

Whoops. So you've really no idea if its a genuine chip or if the matching networks are correct tuned/matched?
Why not use the nRF24L01 modules which avoid all such issues as well as being certified EMI compliant?

[ For microwave stuff like this you really need RF test equipment to commission your prototype PCBs - a VNA and SA are pretty much required equipment up at 2.4GHz as the layout and PCB material have large effects on stray impedances. For instance the capacitors in an antenna matching network like this might be a couple of pF only, so stray capacitance around them, or a change in size from 0603 to 0402 has a large effect. ]

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.