SPI Pin confustion

TheBrick
Posts: 8
Joined: Wed May 08, 2019 8:24 am

SPI Pin confustion

Postby TheBrick » Thu Jun 27, 2019 8:22 pm

Hi,

I am just trying to do a simple SPI interface to thermocouple probe MAX6675 and I am using the example spi master code as refference.

The documentation for SPI list the pins for HSPI as
such:
https://docs.espressif.com/projects/esp ... -and-iomux

Code: Select all

#define PIN_NUM_MISO 12 
#define PIN_NUM_MOSI 13 
#define PIN_NUM_CLK  14 
#define PIN_NUM_CS   15
but the example code list them completely different.
https://github.com/espressif/esp-idf/bl ... ple_main.c

Code: Select all

#define PIN_NUM_MISO 25
#define PIN_NUM_MOSI 23
#define PIN_NUM_CLK  19
#define PIN_NUM_CS   22
To add even further confusion the data sheet seems to give different pins again.
https://www.espressif.com/sites/default ... eet_en.pdf

A slap in the correct direction would be appreciated.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: SPI Pin confustion

Postby ESP_igrr » Thu Jun 27, 2019 9:37 pm

SPI peripherals can be connected to the pins either via the IOMUX or via the GPIO matrix. In the former case, the pins are fixed, but higher frequencies are possible. In the latter case, pin assignments are totally flexible, but the maximum frequency is lower and there are some considerations about setup/hold times. The driver knows about the IOMUX capable pins, so depending on the pin numbers you pass to the driver, it will either use the IOMUX (if the pins match) or the GPIO matrix (otherwise).
The documentation of the SPI driver you have linked to lists the correct IOMUX pins. The example however uses pins which do not match the IOMUX pins, so in that case the driver connects the SPI peripheral via the GPIO matrix.

TheBrick
Posts: 8
Joined: Wed May 08, 2019 8:24 am

Re: SPI Pin confustion

Postby TheBrick » Fri Jun 28, 2019 6:58 pm

That's the slap in the direct I needed thanks. I even read that section of the documentation last night but I think it went in one ear and out the other. Trying to work too late on things while too tired.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: SPI Pin confustion

Postby Ritesh » Sat Jun 29, 2019 6:20 pm

TheBrick wrote:
Fri Jun 28, 2019 6:58 pm
That's the slap in the direct I needed thanks. I even read that section of the documentation last night but I think it went in one ear and out the other. Trying to work too late on things while too tired.
Hello,

So issues seems to be resolved or still any confusion for SPI communication?
Regards,
Ritesh Prajapati

fabiobertolini
Posts: 4
Joined: Fri Feb 17, 2023 12:17 am

Re: SPI Pin confustion

Postby fabiobertolini » Fri Feb 17, 2023 3:59 pm

Hi,

I have the same problem but with ESP32-S3-32S AI Thinker, basically I saw on the documentation the following table::
"The IO_MUX pins for SPI buses are given below."
CS0: 10
SCLK: 12
MISO: 13
MOSI: 11
QUADWP: 14
QUADHD: 9

I use VS Code with PlatformIO extension, Arduino framework.

In file pins_arduino.h there are:

Code: Select all

static const uint8_t SS = 10;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 13;
static const uint8_t SCK = 12;
But my W5500 Ethernet is not working. I also tried physically changing the PIN on the breadboard and then on the file but it never works.
I tried to use the RESET pin of the w5500 by connecting it to the EN PIN of the ESP32-S3-32S AI Thinker but it doesn't work.
I tried to change SS/CS PIN and obviously also changing it in the code to the function "Ethernet.init(x);" but it does not work.

In short, I'm looking for someone who can tell me how to use SPI on ESP32-S3.

Thank you

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: SPI Pin confustion

Postby Ritesh » Sun Feb 19, 2023 2:35 pm

fabiobertolini wrote:
Fri Feb 17, 2023 3:59 pm
Hi,

I have the same problem but with ESP32-S3-32S AI Thinker, basically I saw on the documentation the following table::
"The IO_MUX pins for SPI buses are given below."
CS0: 10
SCLK: 12
MISO: 13
MOSI: 11
QUADWP: 14
QUADHD: 9

I use VS Code with PlatformIO extension, Arduino framework.

In file pins_arduino.h there are:

Code: Select all

static const uint8_t SS = 10;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 13;
static const uint8_t SCK = 12;
But my W5500 Ethernet is not working. I also tried physically changing the PIN on the breadboard and then on the file but it never works.
I tried to use the RESET pin of the w5500 by connecting it to the EN PIN of the ESP32-S3-32S AI Thinker but it doesn't work.
I tried to change SS/CS PIN and obviously also changing it in the code to the function "Ethernet.init(x);" but it does not work.

In short, I'm looking for someone who can tell me how to use SPI on ESP32-S3.

Thank you
Hello,

Would you please first of check that loopback is working or not means connect MISO with MOSI Pin and check Transmit and Receive are working fine.

If that is working, then check with simple LCD or any other simple SPI based Sensor and try to verify it.

If that is also working, then need to check configuration which you are using W5500 Ethernet.

So, Please try with that and let me know results for the same.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 99 guests