I am interested in interfacing my Arduino to both:
- a 74HC595 shift register (via SPI), to control some LEDs
- and an SD-card (also via SPI)
Since they share the same SPI port, based on my understanding, I would need to Chip-select (CS) when speaking with one versus the other.
With the SD-card, this is simple because it has a CS pin.
But the 74HC595, according to the datasheet, doesn't have one (although it has an Output-Enable pin).
I want to ensure two things:
- that writing to the SD card won't randomly turn on and off various LEDs because of interfering SPI communication
- and likewise, that controlling desired LEDs via the shift-register won't cause weird activity on the SD-card because of interfering SPI (but I think I'm safe in this 2nd case, because the SD-card has chip-select).
What might be a way to accomplish this?(PS: I could bit-bang the 74HC595 but that would cost me extra pins that I could use for other things! Hence I'm using SPI.)