# Share CS pin for SD and EHT on ESP32

**URL:** <https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627>\
**Category:** General Guidance\
**Created:** [January 16, 2026, 1:48pm UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627 "2026-01-16T13:48:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shummi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/shummi/32/1126438_2.png) [@Shummi](https://forum.arduino.cc/u/Shummi)\
**Post date:** [January 16, 2026, 1:48pm UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/1 "2026-01-16T13:48:48Z")

</div>

Is it possible to share CS pin ? I am using library:  
Ethernet at version 3.3.5  
Networking at version 3.3.5  
FS at version 3.3.5  
SD at version 3.3.5

I have a of SD connected and a W5500 EHT shield, like on the shield with SD and ETH for UNO/MEGA. I know one of the CS pin then have to be inverted.

It is working now with 2 pins, but i wold like to spare a pin.

Also, what is the reason for Enable?, it is not used on UNO/MEGA, but it needs to be defined in ESP32. I have set it to 0 in the sketch, and connected it to EN on ESP32, and it works fine.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [January 16, 2026, 2:00pm UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/2 "2026-01-16T14:00:23Z")

</div>

in general you can share the SPI pins (MISO, MOSI, SCLK) between devices but separate CS (chip select) is required  
if you are low on GPIO pins consider using a port expander, e.g. [MCP23017](https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/tree/master)

---

<div class="post-metadata">

**Author:** ![Shummi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/shummi/32/1126438_2.png) [@Shummi](https://forum.arduino.cc/u/Shummi)\
**Post date:** [January 17, 2026, 10:02am UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/3 "2026-01-17T10:02:08Z")

</div>

Thanks, but I was just curious if it was an easy fix, to svare one pin.

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [January 17, 2026, 11:12am UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/4 "2026-01-17T11:12:58Z")

</div>

> [@Shummi](#):
>
> I have a of SD connected and a W5500 EHT shield, like on the shield with SD and ETH for UNO/MEGA. I know one of the CS pin then have to be inverted.

If that are the only SPI devices, it could IN THEORY work, however I expect that the libraries are not prepared for this. Furthermore I also expect possible side effects as one of the two devices will be constantly selected and if the devices need different SPI settings e.g. phase of CLK than the selected device might see that as a first pulse.

_In theory there is no difference between theory and practice, however in practice there is._

---

<div class="post-metadata">

**Author:** ![Shummi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/shummi/32/1126438_2.png) [@Shummi](https://forum.arduino.cc/u/Shummi)\
**Post date:** [January 17, 2026, 11:43am UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/5 "2026-01-17T11:43:29Z")

</div>

Thanks.

I am aware that one of the lib. Need a change and I need an inverter, but it is done on the w5100 shield 😀.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 16, 2026, 11:44am UTC](https://forum.arduino.cc/t/share-cs-pin-for-sd-and-eht-on-esp32/1425627/6 "2026-07-16T11:44:31Z")

</div>

Closed on July 16, 2026, 11:44am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
