Very wrong pin usage in ESP32 SPI Slave examples.

AndreiC
Posts: 4
Joined: Fri May 11, 2018 6:39 pm

Very wrong pin usage in ESP32 SPI Slave examples.

Postby AndreiC » Thu Aug 09, 2018 7:47 pm

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

User avatar
kolban
Posts: 1665
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Thu Aug 09, 2018 9:56 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Available for ESP32 consulting.

Who is online

Users browsing this forum: No registered users and 1 guest