nrf24l01 +ethernet module on one arduino

Good day! iam trying to connect an ethernet module on the arduino. The problem is that the pin specified for the ethernet is already used for the nrf24l01. i tried shorting the two and connect them to the same pins but when i execute the code for nrf, it is not working anymore. can i ask how to solve this problem???

How about telling us what pins you are talking about?

And post your program.

…R
Simple nRF24L01+ Tutorial

Robin2: How about telling us what pins you are talking about?

And post your program.

...R Simple nRF24L01+ Tutorial

pins 10 - CSN 11 - MOSI 12 - MISO 13 - SCK

i connected the nrf and ethernet on the same pins by shorting them and when i do, the nrf is not working. i already tested the nrf without the ethernet and it is working. is there anythng that i should do?

MOSI, MISO and SCK will use the same pins, but you need to use separate pins for the CSN and CE pins for the nRF24 and the CSN pin for the Ethernet module.

You could use pin 10 for the Ethernet module CSN pin pin 9 for the nRF24 CSN pin pin 8 for the nRF24 CE pin.

drummin89: MOSI, MISO and SCK will use the same pins, but you need to use separate pins for the CSN and CE pins for the nRF24 and the CSN pin for the Ethernet module.

You could use pin 10 for the Ethernet module CSN pin pin 9 for the nRF24 CSN pin pin 8 for the nRF24 CE pin.

i tried using different pins for the CE and CSN for both, still the nrf wont work

can you post something showing how it is wired and your program.

Does it work if you unplug the ethernet module and/or code out the ethenet module?

drummin89: can you post something showing how it is wired and your program.

Does it work if you unplug the ethernet module and/or code out the ethenet module?

it does work if i removed the ethernet module. i dont have the code for the ethernet yet, i just tested it to see if the nrf would work but it wont. ive seen some query about the w5100 spi bug but im still wondering if i can fix this on the hardware part before touching the code

uwabara: it does work if i removed the ethernet module. i dont have the code for the ethernet yet,

Post the program you have been trying.

Post a link to the datasheet for the ethernet module or shield

Unless you are prepared to provide the details when you are asked this is just a complete waste of everyone's time, including yours.

...R

Robin2:
Post the program you have been trying.

Post a link to the datasheet for the ethernet module or shield

Unless you are prepared to provide the details when you are asked this is just a complete waste of everyone’s time, including yours.

…R

Im very sorry for i was signed in on my mobile a while ago so i cant post my code but i was able to make the nrf work again with the ethernet module. what i did was declare different pins for the ethernet module for its mosi miso sck and ss pins. here is the code

#include <Ethernet.h>


/*Master TxRx Node 00*/
//CE-9, CSN-10, SCK-13, MO-11, MI-12//
//PB-4, LED-2, LEDACK-3

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>


#define SCK 6  //13
#define MOSI 3 //11
#define SS 8
#define MISO 5 //12
#define soundalarm 1 // for alarm na toh
#define lightalarm 2

int msg[1]; // this is the received data storage

RF24 radio(9, 10);               // nRF24L01 (CE,CSN)
RF24Network network(radio);      // Include the radio in the network

const uint16_t this_node = 00;   // Address of this node in Octal format ( 04,031,etc)
const uint16_t node01 = 01;      // Address of the other node in Octal format
const uint16_t node02 = 02;
const uint16_t node03 = 03;  
const uint16_t node04 = 04; 


void setup() {
 Serial.begin(9600);
 SPI.begin();
 radio.begin();
 network.begin(90, this_node);  //(channel, node address)
 radio.setDataRate(RF24_2MBPS);
 
 pinMode(soundalarm, OUTPUT);
 pinMode(lightalarm, OUTPUT);
 }
 

void loop() {
 network.update();
 //===== Receiving and Sending Ack Signal=====//
 while ( network.available()) {// Is there any incoming data?
 RF24NetworkHeader header00;
 network.read(header00, &msg[0], sizeof(msg[0])); // Read the incoming data
 Serial.println(msg[0]);

if (msg[0] == 011) // if received bits is 011 {
   msg[0] = 777; // Read the incoming data and prepares the ack code bits
   digitalWrite(soundalarm, HIGH);
   digitalWrite(lightalarm, HIGH);
   delay(2000); //babaguhin pa  ito
   digitalWrite(soundalarm, LOW);
   digitalWrite(lightalarm, LOW);
   RF24NetworkHeader header01(node01);
   bool ok = network.write(header01, &msg[0], sizeof(msg[0]));}
   
if (msg[0] == 012)  { // if received bits is 012
   msg[0] = 776; // Read the incoming data and prepares the ack code bits
   digitalWrite(soundalarm, HIGH);
   digitalWrite(lightalarm, HIGH);
   delay(2000); //babaguhin pa  ito
   digitalWrite(soundalarm, LOW);
   digitalWrite(lightalarm, LOW);
   RF24NetworkHeader header01(node01);
   bool ok = network.write(header01, &msg[0], sizeof(msg[0]));}

if (msg[0] == 021) { // if received bits is 021
   msg[0] = 775; // Read the incoming data and prepares the ack code bits
   digitalWrite(soundalarm, HIGH);
   digitalWrite(lightalarm, HIGH);
   delay(2000); //babaguhin pa  ito
   digitalWrite(soundalarm, LOW);
   digitalWrite(lightalarm, LOW);
   RF24NetworkHeader header01(node01);
   bool ok = network.write(header01, &msg[0], sizeof(msg[0]));}

if (msg[0] == 022)  { // if received bits is 022
   msg[0] = 774; // Read the incoming data and prepares the ack code bits
   digitalWrite(soundalarm, HIGH);
   digitalWrite(lightalarm, HIGH);
   delay(2000); //babaguhin pa  ito
   digitalWrite(soundalarm, LOW);
   digitalWrite(lightalarm, LOW);
   RF24NetworkHeader header01(node01);
   bool ok = network.write(header01, &msg[0], sizeof(msg[0]));}

if (msg[0] == 031)  { // if received bits is 031
   msg[0] = 773; // Read the incoming data and prepares the ack code bits
   digitalWrite(soundalarm, HIGH);
   digitalWrite(lightalarm, HIGH);
   delay(2000); //babaguhin pa  ito
   digitalWrite(soundalarm, LOW);
   digitalWrite(lightalarm, LOW);
   RF24NetworkHeader header01(node01);
   bool ok = network.write(header01, &msg[0], sizeof(msg[0]));}

   }

uwabara: Im very sorry for i was signed in on my mobile a while ago so i cant post my code but i was able to make the nrf work again with the ethernet module. what i did was declare different pins for the ethernet module for its mosi miso sck and ss pins. here is the code

I don't see how that can work. SPI only works on pins 11, 12 and 13

...R