I am having trouble getting this module to work using the tmrh20 lib. I am using these modules with two arduino mega and a 3.3V external power supply. I also placed 10 uF in parallel with the modules power pin. I would really appreciate any comments or suggustions.
In the code below all I am trying to do is turn on a led. Here are my pin assignment for both arduinos CE -> 7 CSN -> 8 SCK -> 52 MOSI -> 51 MISO -> 50 IRQ -> unconnected
Transmitter
//#include <DigitalIO.h>
#include <SPI.h>
#include "RF24.h"
#include <printf.h>
RF24 radio(7,8);
const uint64_t pipe = 0xE8E8F0F0E1LL;
unsigned long msg = 375983;
void setup() {
Serial.begin(115200);
printf_begin();
Serial.println("Transmitter");
pinMode(9, INPUT);
radio.begin();
radio.setChannel(108);
radio.openWritingPipe(pipe);
radio.startListening();
radio.printDetails();
}
void loop() {
radio.stopListening();
if (digitalRead(9) == HIGH)
{
while (!radio.write(&msg, sizeof(msg))){
radio.write(&msg, sizeof(msg));
}
Serial.println("Sending.....");
}
else {
Serial.println("Awaiting Input....");
}
delay(500);
}
print detail report
STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1 = 0xffffffffff 0xffffffffff
RX_ADDR_P2-5 = 0x7f 0xff 0x7f 0xff
TX_ADDR = 0x0000000000
RX_PW_P0-6 = 0xff 0x7f 0xff 0x7f 0xff 0xff
EN_AA = 0xff
EN_RXADDR = 0xff
RF_CH = 0xff
RF_SETUP = 0xff
CONFIG = 0xff
DYNPD/FEATURE = 0x7f 0xff
Data Rate = 1MBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MAX
Receiver
//#include <DigitalIO.h>
#include <SPI.h>
#include "RF24.h"
#include <printf.h>
RF24 radio(7,8);
const uint64_t pipe = 0xE8E8F0F0E1LL;
unsigned long msg;
void setup() {
Serial.begin(115200);
printf_begin();
Serial.println("Receiver");
pinMode(9, OUTPUT);
radio.begin();
radio.setChannel(108);
radio.openReadingPipe(0,pipe);
radio.printDetails();
}
void loop() {
radio.startListening();
digitalWrite(9, LOW);
if(radio.available()){
while(radio.available())
{
radio.read(&msg, sizeof(msg));
Serial.println("Incoming...");
delay(500);
Serial.println(msg);
}
}
else{
Serial.println("No Msg");
}
radio.stopListening();
Serial.println(msg);
if (msg == 375983){
digitalWrite(9, HIGH);
Serial.println(msg);
}
delay(500);
}
print detail report
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000000 0x0000000000
RX_ADDR_P2-5 = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000000000
RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x00
EN_RXADDR = 0x00
RF_CH = 0x00
RF_SETUP = 0x00
CONFIG = 0x00
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
UPDATE: Transmitter PrintDetail
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x00000000e1 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x00000000e1
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x6c
RF_SETUP = 0x07
CONFIG = 0x0f
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
Results form tmrh20 Getting Started Example
First Arduino
Sent 8340224, Got response 0, Round-trip delay 547172 microseconds
Now sending
Sent 9889124, Got response 0, Round-trip delay 511072 microseconds
Now sending
Sent 11401920, Got response 0, Round-trip delay 43348 microseconds
Now sending
Sent 12446992, Got response 0, Round-trip delay 635580 microseconds
Now sending
Sent 14084352, Got response 0, Round-trip delay 1620788 microseconds
Now sending
Sent 16706968, Got response 0, Round-trip delay 1227548 microseconds
Now sending
Sent 18936340, Got response 0, Round-trip delay 145372 microseconds
Second Arduino
*** PRESS 'T' to begin transmitting to the other node
The second arduino is not printing anything on the serial monitor, no matter what I enter.