u/JeinStobeck

Cannot use nrf24 on Seeed Xiao ESP32-C5

Hello everyone.

I just got a xiao mcu to use with a nrf24 as receiver. I spent the whole day trying to figure out how to set it up, to no avail.

So far, here is my code (below). I finally have SPI OK, after setting manually every pin. But I get Radio Fail and nRF FAIL as well. The wiring obviously is pristine and has been checked more times than I dare to say.

Any help or hint would be appreciated, thanks in advance !

Edit : Output is :

SPI OK

RADIO FAIL

nRF FAIL

DETAILS

SPI Speedz = 10 Mhz

STATUS = 0x00 RX_DR=0 TX_DS=0 TX_DF=0 RX_PIPE=0 TX_FULL=0

EN_RXADDR = 0x00

RF_CH = 0x00

RF_SETUP = 0x00

CONFIG = 0x00

DYNPD/FEATURE = 0x00 0x00

Data Rate = 1 MBPS

Model = nRF24L01+

CRC Length = Disabled

PA Power = PA_MIN

ARC = 0

===

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



#define CE_PIN D6
#define CSN_PIN D5
#define SCK_PIN D8
#define MISO_PIN D9
#define MOSI_PIN D10


const byte thisSlaveAddress[6] = "00001";


RF24 radio(CE_PIN, CSN_PIN);


char dataReceived[12]; // this must match dataToSend in the TX


SPIClass spi(FSPI);
//===========


void setup()
{


   pinMode(CE_PIN, OUTPUT);
   pinMode(CSN_PIN, OUTPUT);
   pinMode(MOSI_PIN, OUTPUT);
   pinMode(SCK_PIN, OUTPUT);
   pinMode(MISO_PIN, INPUT);
   
   Serial.begin(9600);
   delay(3000);


   bool okspi = spi.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CSN_PIN);
   Serial.println(okspi ? "SPI OK" : "SPI FAIL");


   bool ok = radio.begin(&spi);
   Serial.println(ok ? "RADIO OK" : "RADIO FAIL");


   bool okchip = radio.isChipConnected();
   Serial.println(okchip ? "nRF OK" : "nRF FAIL");


   radio.setPALevel(RF24_PA_MIN);
   radio.setDataRate( RF24_1MBPS);


   radio.openReadingPipe(1, thisSlaveAddress);
   radio.startListening();


   Serial.println("DETAILS");
   radio.printDetails();
   Serial.println("===");
}


//=============


void loop()
{
   if (radio.available()) {


    radio.read(&dataReceived, sizeof(dataReceived));
    //Serial.println(dataReceived);
    delay(1000);
   }
}
reddit.com
u/JeinStobeck — 6 days ago

Using an arduino to setup an ESC for Brushless Motor

Hello, I am in the process of building a arduino RC plane. I just bought an ESC for my motor (Roxxy 715 S-Bec).

My plan (for starters) is to control it using my arduino, and so far i've used the setup and code available here :

https://howtomechatronics.com/tutorials/arduino/arduino-brushless-motor-control-tutorial-esc-bldc/

My problem is setting up the ESC for its first time. The user manual states :

- Programmable RC system set servo travel for throttle / motor to 100% in both directions

- Move transmitter throttle stick to the motor OFF position

- Connect a fully charged flight battery (-> beeps tones etc should occur)

The full manual is available here.

I do not understand how, plugging the battery last, the ESC could possibly understand that the throttle is at max then min, given no power source is supplied.

Sorry if my question does not fit here, and thank you for answering !

u/JeinStobeck — 8 days ago