Page 1 of 1

Very wrong pin usage in ESP32 SPI Slave examples.

Posted: Thu Aug 09, 2018 7:47 pm
by AndreiC
This one cost me about 3 hours today:

In the README.md file for the SPI slave examples, as well as in the example code, there is:

Code: Select all

Please run wires between the following GPIOs between the slave and master to make the example function:

Signal	Slave	Master
Handshake	GPIO2	GPIO2
MOSI	GPIO12	GPIO12
MISO	GPIO13	GPIO13
SCLK	GPIO15	GPIO15
CS	GPIO14	GPIO14
According to the reference manual, module diagrams, and running code, MOSI and MISO are reversed, as are SCLK and CS.

The proper settings are:
MOSI GPIO13
MISO GPIO12
SCK GPIO14
CS GPIO15

Andrei

Re: Very wrong pin usage in ESP32 SPI Slave examples.

Posted: Thu Aug 09, 2018 9:56 pm
by kolban
Howdy Andrei,
Can you elaborate ... I looked at the code but am not seeing what you are seeing. I think you are saying that

MOSI is 13
MISO is 12

while the documentation is saying

MOSI is 12
MISO is 13

But yet when I read here:

https://github.com/espressif/esp-idf/bl ... app_main.c

and

https://github.com/espressif/esp-idf/bl ... app_main.c

it sure does feel like MOSI is 12 and MISO is 13.