How to use SPI with ESP32-S3 (V3) Board?

Hello,

I used this sketch to find out the SPI pins of the board:

/*

Rui Santos
Complete project details at https://RandomNerdTutorials.com/esp32-spi-communication-arduino/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/

//Find the default SPI pins for your board
//Make sure you have the right board selected in Tools > Boards
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.print("MOSI: ");
Serial.println(MOSI);
Serial.print("MISO: ");
Serial.println(MISO);
Serial.print("SCK: ");
Serial.println(SCK);
Serial.print("SS: ");
Serial.println(SS);
}

void loop() {
// put your main code here, to run repeatedly:
}

What I got is:

MOSI 10
MISO 11
SCK 9
SS 8

But where are these pins on the board? Are there any working SPI scripts for this board?
I try to use SPI because I couldn’t get my BME 280 (BlueDot) sensor running on I2C with this board. The sensor can run on SPI as well …

Thank’s Martin

Those look like the GPIOs that are wired on-board to the SX1765. But they are not brought out to the header pins.

Ok. Thank you. Can you help me with running my BME 280 sensor via I2C? I tried to use pins 48 and 47 but it didn’t work.

1 Like

look in pin definition folder for your board. e.g. for WIFI KIT 32 V3. There you can see/define the SPI pins

C:\Users\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.7\variants\heltec_wifi_kit_32_v3\pins_arduino.h

As a reference you need to look here about pin assingments. Seems some pin_arduino.h files of Heltec are wrong

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/gpio.html

Thank you!

The SPI pins are as mentioned above (pin 8-11), so they are not accessible.

But with the help of your link I found out that the I2C pins are SDA 41 and SCL 42. After finding out that these correspond to GPIO33 (pin 41) and GPIO34 (pin 42) - which is a bit confusing - the sensor was recognized by the board.

1 Like

Looking around the forum I found this post :

Whereby on a different board someone was able to adjust the SPI pin designations ? Has anyone seen this and tried a combination that works ?