12/11/11 Thanks for being open. I'm new to arduino.
I'm having troubles getting a MEGA2560 (not r3) to connect with a NANO v3 using the rf24L01+ radio.
I'm using arduino 1.0 IDE and maniacbug-RF24-53cb579.zip (12/11/11) for the radio's library.
For code I'm Using the maniacbug's examples GettingStarted.pde. Nothing else on any of arduinos boards.
Used the same code for all the arduinos for testing GettingStarted.pde
I first had a working radio connection with the UNO board and the NANO.
They both worked fine as either RX or TX.
Then I traded the UNO for the MEGA2560.
With the MEGA2560 as the TX:
The NANO would recieve the correct time, but the MEGA2560
would not get an ok ping back from GettingStarted.pde's ok = radio.write(...)
and then it would time out. Below is some of the Serial dialog:
Serial on MEGA as TX :
** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending 5976...failed.
Failed, response timed out.
... repeats
Serial on NANO as RX:
Got payload 5976...Sent response.
... repeats keeps getting time right
Reversing the TX and RX With NANO as the TX and
the MEGA2560 as the RX. The Mega fails to see anything.
/// NANO transmitter with MEGA recieving
** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending 347419...failed.
Failed, response timed out.
......repeats
Nothing more from MEGA's serial.
----
Below other attempts to solve the problem:
My first thoughts were wiring errors, but UNO worked fine.
The Hardware wiring differents for UNO, NANO and MEGA:
For UNO/NANO mosi:11 miso:12 sck:13
For MEGA2560 mosi:51 miso:50 sck:52
Did not connect IRQ on any arduino.
Other software tries with same results. That is NANO would recieve but MEGA would not Recieve.
Tried different versions of arduino v22 and v23. no help.
Tried different versions of maniacBug's lib. no help
Tried maniacBug's pingpong examples. (earlier versions) no help
Tried using the mirf's library. Had same problems. The forum has thread that is similiar.
Sounds like the same problem to me.
Topic: Problem with Nrf24L01+ and arduino MEGA (Read 294 times)
Threads ends with following:
"Had the same problem using the resistors / voltage dividers!
If you connect the nrf2410 direct to the MEGA 2560 problem seems to be fixed.
The fault seems to be on pin 5 SCK when you use resistors / voltage dividers!"
I've not used the resistors directly, I did try to connect some pins on rf24 with
some of the ICSP header pins for awhile, which I believe has some resistor in line.
That didn't help. So, I check my clock SCK wire, shorten it. But no help.
--
Tried ElecFreaks code (ElectFreakLIB(10-11)_SPI_rf24L01(1).zip) they said was for MEGA2560.
Didn't work for me.
Some earlier forums reports were concern with SPI library and the MEGA.
So I had the adruino 1.0's SPI.cpp Serial print the DEFINES pre pinMode() assigments.
UNO/NANO had MOSI:11 MISO:12 SCK:13 SS:10 and MEGA had MOSI:51 MISO:50 SCK:52 SS:53.
Seems ok to me? I Checked to make sure the MEGA2560 was getting define as (__AVR_ATmega2560__) it was.
Hardware tries:
Swapped radios modules (with the wiring) from UNO to MEGA. UNO still worked and the MEGA still did not work.
Swapped out the MEGA2560 with a different MEGA2560. No help.
Tried different (ce, csn) pins on MEGA (8,9), (4,5) and (9,53) for GettingStarted.pde RF24 radio(9,10);
Tried flashing leds on MEGA's 50-53 pins to make sure that they sort of worked and I was lining pins up right.
LEDs Worked fine.
Below is the status reports.
I added a radio.printDetails(); after the GettingStarted.pde's
bool ok = radio.write( &time, sizeof(unsigned long) );
for both UNO and MEGA. Both were the same, both had config= 0x0C as the only differents from below status.
MEGA status
RF24/examples/GettingStarted/
ROLE: Pong back
*** PRESS 'T' to begin transmitting to the other node
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 <0> = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5 <0> = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0d2
RX_PW_P0-6 <0> = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR <0> = 0x03
RF_CH = 0x4c
RF_SETUP <0> = 0x07
CONFIG = 0x0f
DYNPD/FEATURE <0> = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_HIGH
UNO' status
RF24/examples/GettingStarted/
ROLE: Pong back
*** PRESS 'T' to begin transmitting to the other node
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 <0> = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5 <0> = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0d2
RX_PW_P0-6 <0> = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR <0> = 0x03
RF_CH = 0x4c
RF_SETUP <0> = 0x07
CONFIG = 0x0f
DYNPD/FEATURE <0> = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_HIGH
NANO status
RF24/examples/GettingStarted/
ROLE: Pong back
*** PRESS 'T' to begin transmitting to the other node
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 <0> = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5 <0> = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0d2
RX_PW_P0-6 <0> = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR <0> = 0x03
RF_CH = 0x4c
RF_SETUP <0> = 0x07
CONFIG = 0x0f
DYNPD/FEATURE <0> = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_HIGH
Hopefully, someone can see where I when wrong. Thanks.