0
\$\begingroup\$

I am planning to use ESP32 S3 for the communication with multiple SPI slave devices (10). According to the datasheet (https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf) the SPI bus I am planning to use (SPI2) has only 6 CS pins dedicated to SPI comms.

I know, it is possible to use any available pin on the MCU as CS by manually driving it low prior to communication.

Are there any disadvantages apart from loosing some microseconds? And, anything specific that needs to be configured from a routing perspective?

I am also considering using a multiplexer to switch between SPI devices by using the dedicated CS pins, e.g. 2 multiplexer devices one for each CS pin.

What is more suitable for ESP32 with higher number of SPI slaves - manually toggling CS lines from firmware or using a multiplexer IC?

Also, I am considering using SPI line drivers

SN74LVC2G34 for CLK and MOSI at master SN74LVC1G17 or SN74LVC1G125 for CS at master SN74LVC1G17 or SN74LVC1G125 for MISO at slave

OR

2 SN74LVC244A for CLK, MOSI and CSs at master

Do these make sense?

\$\endgroup\$
5
  • \$\begingroup\$ You need to trade-off the number of GPIO pins needed, board space, and cost of more parts. We don't have all the information to make the decision for you. I would be more concerned with driving 10 data and clock lines. \$\endgroup\$ Commented Jun 5 at 7:18
  • \$\begingroup\$ User146... How fast? Or, put another way, do you expect to use the peripheral or can you bit-bang? Are you using an external crystal at 40 MHz, for example? Or the PLL CLK that can get up around 320 to 480 MHz? Are you willing to write assembly code (as this will dramatically impact your bit-bang speeds?) \$\endgroup\$ Commented Jun 5 at 7:48
  • \$\begingroup\$ If possible up to 75 MHz. \$\endgroup\$ Commented Jun 5 at 11:47
  • \$\begingroup\$ Writing assembly code is not problem too \$\endgroup\$ Commented Jun 5 at 11:55
  • \$\begingroup\$ Driving the #CS signal manually isn't anything special. Just make sure you're driving #CS before writing data to the transmit buffer. And keep it driven until the frame has been fully transmitted (possibly using TX completed interrupt). \$\endgroup\$ Commented Jun 5 at 12:55

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.