Go Down

Topic: nrf24l01 radios + RF24 library + Ethernet shield do not work together (Read 9856 times) previous topic - next topic

SurferTim

Just to insure I understand your setup, how did you start the RF24 library with that pin setup? Did you use this?
Code: [Select]
RF24 radio(40,53);

nicoverduin

Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl
Do not PM me for personal consultancy unless you are willing to pay for it.

SurferTim

#17
Dec 20, 2013, 02:05 pm Last Edit: Dec 20, 2013, 02:35 pm by SurferTim Reason: 1
If you tried other pins for the CSN pin and it didn't work, then you move it to the default slave select pin for the Mega and it does work, that would appear to be a bug in the RF24 library. The CSN pin should work on about any digital pin. ??

edit: Let me change that earlier statement so it is correct.
Quote
"One little catch is with Ethernet RF24 shields based on the Wiznet W5100 RF24 chipset, which includes the official Ethernet shield and many third-party shields. The W5100 RF24 has a design library 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 RF24 with other shields that use SPI."


nicoverduin

Hi Tim
I still have to recheck with CSN on another pin. If so, it would certainly help. A software bug is easier to fix than a hardware one :)

In my current setup I have a mega2560 with the W5100 ethernet and a nRF24L01+ as motherstation. 2 Uno's each with a nRF24L01+. The all share the same address for reading and another for writing. In the message I send, there is a device ID so that the right device can respond and it works great :)
Now time to build an app in Appcelerator to replace the webbrowser :)
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl
Do not PM me for personal consultancy unless you are willing to pay for it.

nicoverduin

Voltage Regulator Chip.
Of the Arduino? Then why does it not work if I move the CE pin to another location?
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl
Do not PM me for personal consultancy unless you are willing to pay for it.

nicoverduin

By some stupid error I broke the Mega2560 so I had to fall back on the Uno. And of course the W5100 and the nrf24L01 did not like to cooperate. So I did the following:
Changed the nrf24L01 library to use DigitalIO(= SoftSPI)
And this worked great. code changes:
in rf24.h I added
Code: [Select]

#include <DigitalIO.h>
const uint8_t SOFT_SPI_MISO_PIN = 16;
const uint8_t SOFT_SPI_MOSI_PIN = 15;
const uint8_t SOFT_SPI_SCK_PIN  = 14;


and in the class declaration:
Code: [Select]

<class RF24
{
private:
SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN, SPI_MODE> spi;


in rf24.cpp
Change SPI.  into spi.

and comment out the following lines

Code: [Select]

#ifdef ARDUINO
//  spi.setBitOrder(MSBFIRST);
//  spi.setDataMode(SPI_MODE0);
//  spi.setClockDivider(SPI_CLOCK_DIV4);
#endif


Not the final solution yet, but now it always works :)
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl
Do not PM me for personal consultancy unless you are willing to pay for it.

nicostak

If it could help , i noticed the Nrf+Eth problem also with the other MIRF library. I think i found the mistery cause in the CSN pin. If i unplug it, everything works fine. So weird

Go Up