Is the SPI flash module's CS pin exposed on ESP-12E module?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by liudr » Wed Oct 18, 2017 11:11 pm

I am wondering if any one the GPIO pins on the ESP-12E module is the CS pin for the flash, such as GPIO11 (CS0). I'm interested in using SD card with the module and wonder if I can use any GPIO pins as CS. Thanks.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by Roberthh » Thu Oct 19, 2017 6:54 am

You can use any GPIO pin as CS. There is a SD card adapter board from Wemos, which cost about 1 $ and works nice.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by liudr » Thu Oct 19, 2017 3:21 pm

Roberthh wrote:
Thu Oct 19, 2017 6:54 am
You can use any GPIO pin as CS. There is a SD card adapter board from Wemos, which cost about 1 $ and works nice.

So any pin exposed can be used as CS? I'm just making sure I'm not accidentally using the CS for the internal flash and mass up a module.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by Roberthh » Thu Oct 19, 2017 3:27 pm

Any GPIO which is not used otherwise. The ESP-12E seems to expose CS of the internal flash on the small edge, labeleld CS. So do not use that one.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by liudr » Thu Oct 19, 2017 7:30 pm

Roberthh wrote:
Thu Oct 19, 2017 3:27 pm
Any GPIO which is not used otherwise. The ESP-12E seems to expose CS of the internal flash on the small edge, labeleld CS. So do not use that one.
Thanks again! So the small edge has the SPI pins. If I make my own board, the I should use GPIO 6,7, and 8 as SPI bus wires and another GPIO other than 11 as CS, correct?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by Roberthh » Thu Oct 19, 2017 8:10 pm

Use GPIO13 for MOSI, GPIO12 for MISO, GPIO14 for CLK and GPIO 2, 4 or 5 for CS. Since GPIO4 and 5 are typically used for I2C, you may choose GPIO2. GPIO2 is also used for boot control, so it must not be pulled low during boot. But using it as an output isOK.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by deshipu » Thu Oct 19, 2017 11:00 pm

You can't use pins 6-11, as they are used internally for the flash memory chip.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by liudr » Thu Oct 19, 2017 11:09 pm

Thanks guys. I am a circuit board designer. I'm trying to wrap my head around the new MCU. All these help a lot.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by liudr » Fri Oct 20, 2017 4:25 am

So the SPI_xx markings on this pin out diagram are for internal FLASH and the HSPI_xx markings are for interfacing with SPI devices such as sd cards? If that's the case, I understand why using "GPIO13 for MOSI, GPIO12 for MISO, GPIO14 for CLK and GPIO 2, 4 or 5 for CS."

Image

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Is the SPI flash module's CS pin exposed on ESP-12E module?

Post by deshipu » Fri Oct 20, 2017 1:20 pm

It's actually traditional to use gpio 15 for cs, as it's what used for cs when it's handled in hardware (of course, in our case we handle it ourselves, so you can use any pin, but since gpio 15 is already marked as cs...).

Post Reply