Go Down

Topic: can't get nRF24L01 module to work on MEGA 2560 (Read 244 times) previous topic - next topic

milosavljevicuros

Hi Arduinos!

everything connected and setup is just like here : http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

one wifi module on mega and another atmega 328p on breadbord. (both works fine  when using blink sketch of other).
but when I upload "getting started" sketch with RF24 Library they do not seem each other!
I have tried switching modules between boarduino and mega but no luck.Again Mega reports that nRF24L01  have zeroes as tx and rx address. (images attached)

Is there any  workaround for this?

      PS. A heard about power supply to be the issue so I built complete separate 3,3v supply just for modules,All voltages measured are fine.I have checked wiring mode than   times   :smiley-eek:

Kind Regards

SurferTim

#1
Oct 19, 2014, 11:02 pm Last Edit: Oct 19, 2014, 11:07 pm by SurferTim Reason: 1
I would connect the CE and CSN connections to D9 and D10 on the Mega and try the same code you used on the other Arduino.

You might want to set D10 to OUTPUT and HIGH in your setup function on the Mega before calling any of the RF24 functions.
Code: [Select]
void setup() {
 pinMode(10, OUTPUT);
 digitalWrite(10,HIGH);

 // rest of your setup stuff


edit: Connect the other SPI data lines to D50 to D52 as described for the Mega.

milosavljevicuros

thank you very much!

I have found a two problems :
1) in mega sketch i should change from
RF24 radio(9,10);
to
RF24 radio(9,53);
that's why mega didn't see the modules parameters
2) because i built a completely separate supply for modules i forgot that they have to have common ground!
after i wired grounds together , everything works great!

thank you SufferTim for posting here anyway.

Kind regards

SurferTim

Or you could have moved the SS connection to D10 and left the code as it is.
Code: [Select]
RF24 radio(9,10);
That way the sketch would have been compatible with a Mega and an Uno without the need to modify that setting. Only the SPI data lines (MISO, MOSI, and SCK) would be relocated.


Go Up