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

User avatar
By SomeGuy
#84759 I want to connect a OLED panel & 4 SPI devices to a NodeMCU ESP8266 board. The OLED panel is connected to the SDA(GPIO 4) and SCL(GPIO 5) pins. The data line(GPIO 12) and clock line(GPIO 14) are common. I see the possible choices for chip select pins to be the other free GPIO pins.

1) GPIO 15

2) GPIO 16

3) GPIO 0

4) GPIO 2

5) GPIO 13

6) GPIO 3

7) GPIO 1

Now with these options laid out, how do we choose which of these pins can be used as a chip select. The SPI device I am using is the MAX31855 thermocouple amplifier.
User avatar
By schufti
#84912 ??? spi-controller does not know about CS at all, spi library has to be told which gpio to use.
One can use SPI totally w/o CS if there is only a single device on the bus.
Every free (not otherwise used) gpio can be used as CS. ... s.html#spi
User avatar
By eriksl
#84969 False. Depending on what SPI controller you're using ("SPI" or "HSPI") you can have the controller control the CS line (or not, it's optional). The HSPI controller (which we are most likely to use, because it doesn't interfere with flash access) only offers one CS line (fixed). The SPI controller offers three. If one of these doesn't suit your needs, you can always choose to not use the controller-controlled CS lines and control them yourself.