Pages: [1] 2   Go Down
Author Topic: nrf24l01 radios + RF24 library + Ethernet shield do not work together  (Read 3173 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I am performing communication between two arduinos using the RF24 library (http://maniacbug.github.io/RF24 - thanks maniacbug!) and nrf24l01+ radios.
I am using an arduino Uno as TX and an arduino Leonardo as RX.

The communication between the arduinos is working fine, however, when I insert an Ethernet shield (http://www.seeedstudio.com/wiki/Ethernet_Shield_V1.0) in the arduino Uno, the messages cannot be sent anymore.

The nrf24l01 radio in the UNO  is connected in the pins: 6,7,10,11,12 and 13.

I initalize the RF24 library like this:

Code:
RF24 radio(6,7);

I am not sure, but I think that the problem is related to the ICSP pins, which are used by both nrf24l01+ radios and the ethernet shield.

In order to try to avoid such problem, I started the RF24 library in the UNO using pins 6 and 7, which are not used by the ethernet shield. However, the problem still remains.

ps: the ethernet shield was not initialized in any moment.

Do you guys have any clue how to make RF24 library (using nrf24l01+ radios) work in the arduino UNO with ethernet shield?

Thank you!


Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 150
Posts: 6140
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try your RF24 library with the ethernet shield connected, but disabled. Add this to your setup() function:
Code:
void setup() {
    // disable SD SPI
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);

    // disable w5100 SPI
    pinMode(10, OUTPUT);
    digitalWrite(10, HIGH);

    // now do the rest of your setup
}
Does the RF24 work when you try that?

BTW, both those devices use a significant amount of 5v. Careful about your power supply. The onboard regulator may have trouble with both.

edit: Do not use D10 on the nrf24 device. That is the slave select for the w5100.
« Last Edit: November 21, 2013, 07:37:45 am by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi SurferTim... thank you so much for your hint, and sorry for the delay to answer the message.

I tried to do what you said, but the radios could not communicate between them yet.

As you said that I could have problems with the power supply, I plugged the 3.3v and GRD pins of the radio in another arduino just to use another power supply, but I still faced the same problem.

I cannot understand why even setting the port D10 and D4 to HIGH I could not have the radios working.

I am stuck in this problem. smiley-cry

Any other hint?
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 219
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have added a 10uf electrolytic across the 3.3v input to the nRF24l01, which cured my problem using those two devices together.  It would work *some* but eventually would always quit.  They just seem to be very delicate.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you JohnHoward...

I'll try to do what you suggest and then I am going to post here the result.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

test done... I used the 10uf electrolytic capacitor, but unfortunately it did not solve my problem.

When I do not plug the ethernet shield, everything works fine. When plug  it on the arduino, the radio stops working smiley-cry

Any other idea?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello! I have used these around 1 year no problems

Having following Arduino (clone) 1280 <--> NRF24L01:
51: MOSI
GND: GND
52: SCK
50: MISO
48: CE
49: CSN
3V: VCC
GND: GND
Pin6 is connected to 433Mhz transmitter
Pin22 has thermometers (2pcs)
w5100 network board is normally attached to default pins of 1280, not yet any other problems than this is slow...

But I have problems with 433Mhz receiver:
Pin5 is connected to 433Mhz receiver (not used but just connected, sometimes Arduino hangs), receiver is 5v.
Also tried to connect 433Mhz receiver to Pin2 (interrupt 0), but same not good results. So not using receiver currently,just transmitter

Edit: oh, I noticed now you are using UNO, not mega
« Last Edit: December 06, 2013, 02:16:16 am by finnduino » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've found people saying that used the nrf24l01 radio + rf24 library with ethernet shield, but it is hard to believe, since I've been trying all suggestions but with no success.

The only thing that I have in mind now is that I can try another library other than the RF24 that does not use the ICSP pins.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 569
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you disconnected the nRF from pin 10, as stated in an earlier post.

The RF24 radio(6,7) means you should be using pin 6 for CE and pin 7 for CSN.

How exactly are you connecting, as a later post mentions pin 4?

The ethernet shield will use 10 as CS, then they share 11, 12, 13 for SPI

I have used thes together successfully and I am still doing, although I am now using ENC28J60 ethernet boards instead if the W5100 based shields.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi tack,

I am not using the pin 4. Another user just suggested me to set pin 4 as HIGH in order to disable the SDcard of the shield. (by the way, my shield does not have sdcard embeeded)

I am using the pins 6 and 7 for CE and CSN pins.

I am sure I am not wiring the nrf14l01 incorrectly, because everything works ok when I do not plug the ethernet shield.

So, the scenario is the following:
When I have my arduino UNO only with the nrf24l01 connected in the ports 6, 7 (for CE and CSN), 11,12 and 13, everything works fine.
But when I plug the ethernet shield, the radio stops working.
In my tests, I did not change the sketch, so I do not initialize the ethernet shield, I just plug the shield... nothing else.

Do you used any trick to make the shield and the radios working together? (e.g., using some capacitor with the radio, or setting port 10 as HIGH).

Thanks!
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 569
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've dropped you a PM for your email to send you an old sketch I had when using Arduino Uno with a Wiznet based Ethernet Shield for testing.

It might also be a good idea to post some pictures/diagrams of your connections and your code for people to look over.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

tack sent me a code which was working fine with him, but it did not work for me when stacking the ethernet shield.

I think my problem is a hardware incompatibility, because I've done tons of tests.

I've found the information below on the oficial site of the freetronics (http://www.freetronics.com/pages/stacking-arduino-shields#.UqeDteF3-Bs)

"One little catch is with Ethernet shields based on the Wiznet W5100 chipset, which includes the official Ethernet shield and many third-party shields. The W5100 has a design flaw that causes it to maintain control of the SPI bus even when another device has been selected, making it very tricky to combine the official Ethernet shield with other shields that use SPI."

My next test needs to be using an official arduino ethernet shield. (currently, I am using the Seeed Studio Ethernet Shield v1.1.)
Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 150
Posts: 6140
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
"One little catch is with Ethernet shields based on the Wiznet W5100 chipset, which includes the official Ethernet shield and many third-party shields. The W5100 has a design flaw that causes it to maintain control of the SPI bus even when another device has been selected, making it very tricky to combine the official Ethernet shield with other shields that use SPI."
That is not true. It works well with other SPI devices. I use it a lot with the SD card. The major problem is not disabling all SPI devices before starting the begin() functions for those devices.

Quote
currently, I am using the Seeed Studio Ethernet Shield v1.1.
Is that an ENC28j60 IC?
Logged

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 401
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi SuferTim, seems like you are the specialist smiley-mr-green
I have the same problems. Without the 5100 it works fine. Clear settings on the nRF24L01. Exactly as I set them.
If I plug in the ethernet card, that works fine. But the nRf24L01 sends out garbled output from its registers.

Code:
STATUS           = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1     = 0x0000000080 0x1111112188
RX_ADDR_P2-5     = 0x00 0xff 0xff 0xff
TX_ADDR          = 0xffffffffff
RX_PW_P0-6       = 0x00 0x00 0x00 0x80 0x00 0x00
EN_AA            = 0x00
EN_RXADDR        = 0xff
RF_CH            = 0xff
RF_SETUP         = 0x00
CONFIG           = 0x00
DYNPD/FEATURE    = 0x80 0x00
Data Rate        = 1MBPS
Model            = nRF24L01
CRC Length       = 16 bits
PA Power         = PA_MIN

Barry Emons demo
server is at 192.168.0.200
I measured the voltage on the 3.3V with my fluke and it showed an exact 3.3V. I I'll try a scope tomorrow. But it is strange.
Logged

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 401
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Seems like I had to move the CSN pin to pin 53. I thought I could use any pin for CSN and CE. Put  (on my Mega2560) CE on pin 40, and CSN on pin 53. and got it working.
Getting the right response etc.
So up to the next challenge smiley connect up to 25  or more devices to 1 sender/receiver.
Logged

Pages: [1] 2   Go Up
Jump to: