I was wondering how I could overcome the next issue;

My ESP8266 12E is connected as follows:

  • GPIO0 ground if needed to program, vcc otherwise
  • GPIO2 vcc
  • GPIO15 ground

Bootmodes explained in the this schematic

I also want to connect a MCP3002 to my ESP. However to use SPI I also need the GPIO15 pin to be connected to the Chip Select pin.

MCP connections explained in this article

I tried connecting the GPIO15 pin from the ESP to the CS pin of MCP3002 and connecting ground in between. This did not work though, should I switch/remove the ground after boot somehow? (Or should I connect it differently?)


1 Answer 1


The io 15 is SS if esp8266 is slave. If esp8266 is SPI master, you can choose any free pin as CS of the slave.

The esp8266 arduino boards package SPISlave library examples have a solution for master if esp8266 is slave.

The state of the boot pins is required only at boot. You should wire boot pins over a 10 kOhm resistor to create a pull-up/pull-down which can be override by pin output state to use the pins for devices which are OK with or need pull-up or pull-down, for example momentary switches (buttons).

  • I suppose my ESP8266 is the Master and my MCP3002 is the Slave? This means I can connect the MCP3002 CS to any other available pin of the ESP8266?
    – Revils
    Commented Jul 10, 2019 at 8:23
  • Thank you, I will try it tonight and will give feedback what it does!
    – Revils
    Commented Jul 10, 2019 at 8:35
  • the libraries you use are old and I don't see how to change the CS pin. I would try to use some other Arduino MCP3002 library with the standard SPI library of esp8266 boards package
    – Juraj
    Commented Jul 10, 2019 at 8:36
  • I have no idea what you are talking about. This question is about wired connections and has nothing to do with libraries. The links are only a reference for wires, not for libraries what so ever,..
    – Revils
    Commented Jul 10, 2019 at 9:31
  • 1
    SPI is a bus. on master you need so many pins CS pins as many devices you attach to it. this CS pins are not handled by the MCU's SPI peripheral, but by the library. if SPI peripheral of the MCU is in slave mode it must use the dedicated pin. it is true for ATmega MCUs and for esp8266. but some other MCU can map different pins to peripherals. and as other exception the SPI peripheral on the esp8266 has a strange mode of overlapping SPI which can use only dedicated CS pins in master mode to share with other devices the SPI interface dedicated to flash memory.
    – Juraj
    Commented Jul 10, 2019 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.