ESP32 SPI issues

Hello, i am struggling with a spi connection between a ESP32-S3-DevKitC-1 (Master) and a ESP32 C3 Super Mini (Slave)
My Code:

#include <Arduino.h>
#include <SPI.h>
#define SCLK  4
#define MISO  5
#define MOSI  6
#define SS    7
void setup() 
{
  Serial.begin(115200);
  pinMode(SS, OUTPUT);
  SPI.begin(SCLK, MISO, MOSI, SS);
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
}

void loop() 
{
  digitalWrite(SS, LOW);
  
  byte dataToSend = 0x42;

  byte receivedData = SPI.transfer(dataToSend);

  digitalWrite(SS, HIGH);
  
  delay(1000);
}
#include <Arduino.h>
#include <SPI.h>
#define SCLK  4
#define MISO  5
#define MOSI  6
#define SS    7

volatile byte receivedData;
volatile bool dataReceived = false;

void setup() 
{
  Serial.begin(115200);
  pinMode(SS, INPUT_PULLUP);
  pinMode(MISO, OUTPUT);
  SPI.begin(SCLK, MISO, MOSI, SS);
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
}

void loop() 
{
  if(digitalRead(SS) == LOW) 
  {
    receivedData = SPI.transfer(0x00);
    
    Serial.print("receives data: ");
    Serial.println(receivedData, HEX);
  }
}

I tried it in ArduinoIDE with the boards selected:
"ESP32S3 Dev Module" and "Nologo ESP32C3 Super Mini"
in the Serial Terminal i just receive 0

I also tried it in Visual Studio Code with the Platformio extension, i selected:
"esp32-s3-devkitc-1" and "seeed_xiao_esp32c3"
i got the same result

i connected the grounds and pins 4-7 together on the boards.

would be nice if someone could help me.
Pinout Top

Please, post the pictures of your above two boards along with SPI connection to allow me running your codes.

I can not understand what you are doing hardware wise, it sounds like you are trying to connect two boards at the same time. Post a photo that clearly shows the wiring connections (may need 4 or 5)

i made a mistake i meen pins 4-7 i just corrected it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.