Hi. I've been trying to get a pair of Arduino Pro Micros to talk to each other using NRF24L01+PA+LNA modules.
I'm using code from a tutorial I found online.
##Transmitter code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
bool rslt;
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
rslt = radio.write(&text, sizeof(text));
if(rslt) {
Serial.println("Acknowledge received");
}
else {
Serial.println("Tx failed");
}
delay(1000);
}
##Receiver code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text); }
}
On the transmitter end, I get one output of "Tx Failed" every second, and meanwhile, the receiver end spits out a rapid stream of empty received messages.
Since I was curious, I took a look at the signals with an oscilloscope, and this is roughly what I get each time:
There are some things about it that look weird to me, but since I've never used these before I'm not sure whether what I'm seeing is normal or not, especially on the CE and CSN lines.
I feel like I have tried everything at this point. I've taken the circuits apart and rebuilt them, I've switched out both of the NRF24 modules, I've switched the arduinos with spares I have, and still I end up with the same results.
##Some things about the circuit:
I'm using this (3.3V Voltage Regulator 950mA LD1117V33 (LD33V)) voltage regulator to get the 3.3V for the transceivers. There's one on each circuit. The voltage regulators get power from the VCC pin on the Arduino Pro Micro. I am also using a 10 microfarad decoupling capacitor on the 3.3V line to ground.
The pins I'm using from the Arduinos are as follows:
16 --> COPI (MOSI)
14 --> CIPO (MISO)
15 --> SCK
7 --> CE
8 --> CSN
I've read almost every forum post I could find on the NRF24L01 modules, and none of their solutions seemed to apply to me.
Any guidance on what could be going wrong is welcome!