I need help with wiring the CE and the CSN from the nRF to which pin on the LOLIN S2.
nRF24L01. / ESP32/ LOLIN S2
MISO. / MISO 37
MOSI / MOSI 35
GND. / GND
VCC. / VCC
SCK. / SCK 36
CE. / ?
CSN ?
I HAVE ATTACHED THE PICTURES OF THE TWO BOARDS
Your other topic on the same subject deleted.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
See also FAQ - Arduino Forum for general rules on forum behavior and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…
It will help you get the best out of the forum in the future.
Thank you.
horace
March 21, 2024, 2:48pm
3
on an ESP32 I used the following
// ESP32 connections
// ESP32 SCK pin GPIO18 goes to NRF24L10_pin SCK
// ESP32 MISO pin GPIO19 goes to NRF24L10_pin MI
// ESP32 MOSI pin GPIO23 goes to NRF24L10_pin MO
// NRF24L10 CE to ESP32 pin GPIO4
// NRF24L10 CSN to ESP32 pin GPIO 5
using the Radiohead RF24 library with the initialisation
RF24 radio(4, 5); //CE and CSN
your ESP32S2 could use the standard SPI pins and GPIO4
// ESP32S2 connections
// ESP32S2 SCK pin GPIO36 goes to NRF24L10_pin SCK
// ESP32S2 MISO pin GPIO37 goes to NRF24L10_pin MI
// ESP32S2 MOSI pin GPIO35 goes to NRF24L10_pin MO
// NRF24L10 CE to ESP32S2 pin GPIO4
// NRF24L10 CSN to ESP3S2 pin GPIO 34
and the RF24 initialisation
RF24 radio(4, 34); //CE and CSN
power the NRF24L01 from 3.3V and GND with a 10uF capacitor
This is the receiver code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(115200);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
this is the transmitter code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
You've failed to state what the problem is.
horace
March 21, 2024, 6:06pm
7
does it work? if not what happens?
what microcontrollers are you using as hosts?
how are the NRF24L01s connected and powered?