SPI slave pinout

Squonk
Posts: 6
Joined: Sat Oct 25, 2014 1:04 am

SPI slave pinout

Postby Squonk » Mon Nov 30, 2015 5:57 pm

I would like to use the PSI slave mode to connect the ESP8266 to an SPI host CPU, the idea is to have faster than UART mode transfer if possible.

However, I am confused regardingf the pinout: if I take the pin definitions from both the latest 0A-ESP8266__Datasheet__EN_v4.4.pdf datasheet and the 0B-ESP8266__Hardware_User_Guide__EN_v1.1.pdf hardware guides, I read the following pinout in Section 2.1. Pin Definitions:
  • Pin 18: SDIO_DATA_2 I/O Connect to SD_D2 (Series R: 200Ω); SPIHD; HSPIHD; GPIO9
  • Pin 19: SDIO_DATA_3 I/O Connect to SD_D3 (Series R: 200Ω); SPIWP; HSPIWP; GPIO10
  • Pin 20: SDIO_CMD I/O Connect to SD_CMD (Series R: 200Ω); SPI_CS0; GPIO11
  • Pin 21: SDIO_CLK I/O Connect to SD_CLK (Series R: 200Ω); SPI_CLK; GPIO6
  • Pin 22: SDIO_DATA_0 I/O Connect to SD_D0 (Series R: 200Ω); SPI_MSIO; GPIO7
  • Pin 23: SDIO_DATA_1 I/O Connect to SD_D1 (Series R: 200Ω); SPI_MOSI; GPIO8
Please not the typo on pin 22 (SPI_MSIO should read SPI_MISO instead).

However, when looking at the SPI slave schematic on the last page of same 0B-ESP8266__Hardware_User_Guide__EN_v1.1.pdf, I see:
  • Pin 18: SD_D2, NC
  • Pin 19: SD_D3/SPI_CS
  • Pin 20: I/O Connect to SD_CMD (Series R: 100Ω); SD_CMD/SPI_MOSI
  • Pin 21: I/O Connect to SD_CLK (Series R: 100Ω); SD_CLK/SPI_CLK
  • Pin 22: I/O Connect to SD_D0 (Series R: 100Ω); SD_D0/SPI_MISO
  • Pin 23: I/O Connect to SD_D1 (Series R: 100Ω); SD_D1/SPI_INT
In other words, SPI_MOSI is on pin 20 vs. pin 23, and SPI_CS is on pin 19 vs. pin 20, and SPI_INT is on pin 23 vs. undefined.

Which source should I trust?

Also, please confirm that it is setting GPIO0 low during bootstrap that selects the SPI slave mode, while GPIO15 (MTDO) low selects UART0 download mode, and GPIO15 (MTDO) high or floating boots normally from SPI flash on MTMS/MTDI/TCK/MTDO SPI master pins.

EDIT: from the datasheet, it looks like the first pinout is the one defined in Section 3.3.1. General SPI (Master/Slave), whereas the second one is the one defined in Section 3.3.2. SDIO / SPI (Slave), so my question is: what is the difference between these 2 modes, and which one should I use?

Squonk
Posts: 6
Joined: Sat Oct 25, 2014 1:04 am

Re: SPI slave pinout

Postby Squonk » Tue Dec 08, 2015 2:04 pm

Bump

Any halp?

Espressif_Kelly
Posts: 140
Joined: Mon Oct 27, 2014 10:40 am

Re: SPI slave pinout

Postby Espressif_Kelly » Mon Dec 14, 2015 11:14 am

Dear Sir,

If you need to use ESP8266EX as SDIO/SPI slave, you can refer to "8H-ESP8266__Interface_SDIO_SPI_Mode " for details.

And below is the interface definition.

1.png


Any more questions, please let us know.

Thanks.

Who is online

Users browsing this forum: No registered users and 12 guests