0
\$\begingroup\$

I'm trying to connect an MCP3008 to an ESP07 through the SPI interface. (A bidirectional level 5V - 3.3V is used in between but it doesn't matter)

However this is not working because: The CS pin is the pin 15 of ESP07 which needs to be GND otherwise it doesn't boot. The MCP3008 CS is on HIGH.

I'm trying to connect several analogue sensors to the ESP. Is there an workaround? What is to be done? Am I missing something? enter image description here enter image description here

\$\endgroup\$
1
\$\begingroup\$

The MCP3008 CS is on HIGH

This statement does not make sense. CS pin of MCP3008 is an input. It cannot be "on HIGH". It can only be at whatever level you connect it to.

The GPIO15 works as HSPI_CS pin only in HSPI mode, i.e. with ESP8266 as slave.

In your schematics ESP8266 is a master. You can use pretty much any pin to control MCP3008 CS. Normally GPIO0 is used for this.

UPDATE

If your board has external flash chip then SPI is used for that. In this case you can try using HSPI interface. Connect GPIO15 to GND with 10k pull-down resistor. This will ensure correct boot. After boot you can initialize and use HSPI in master mode.

\$\endgroup\$
  • \$\begingroup\$ Well I measured it and although is input it was on HIGH. Do you have a link to an example of how is the spi used on esp? thanks! \$\endgroup\$ – Mihai Ionuţ-Cosmin Sep 5 '18 at 18:20
  • \$\begingroup\$ Did you measure it while connected to ESP? Because in that case you'll see the output of GPIO15 or its internal pull-up, not the MCP3008 CS pin. Anyway, I updated the answer with an option to use HSPI interface. Google for "ESP8266 SPI" and you'll find hundreds of examples like this one \$\endgroup\$ – Maple Sep 5 '18 at 20:22
  • \$\begingroup\$ pins 12,13,14 are HSPI. SPI pins are not lead out. they are connected to flash memory inside the module \$\endgroup\$ – Juraj Nov 3 '18 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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