Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By alguti2000
#65301 Please note that each device will need its own CS line to be connected to a pin. SPI selects the target device by pulling the CS line low.

The ESP8266 is VERY limited in GPIOs, and some of these have special uses, such as GPIO0 and 15 that have to be at a given state during boot. The best way is to add an I/O spander, and use it to control the CS line for many devices.

In my case, I have two devices connected to the SPI bus. However, the SD card will have the CS line high, which I have connected to GPIO15. This caused the ESP-12E to not boot at all. I tried GPIO0, the only other pin available that I have, and that was worst, since the ESP-12E will keep rebooting.

After trial and error, I finally found a solution. I connected the SD card's CS to GPIO15, as normal. But, then I added a BC547 NPN transistor. The base is connected via a diode 1N4148. The collector is connected to GND. Finally, the Emitter is connected back to to GPIO15 via a 10K resistor. Now I can boot the device, without having to disconnect the SD card CS line, first.
User avatar
By dgbat2
#70739 For GPIO 15 I think you can just use a pull-down resistor to make it low at boot, then you can use it like a normal digital pin. As long as it's connected to GND through a resistor works fine for me.