Electronic – SPI with chip select to ground

spi

If you have a SPI bus with only one device can you connect chip select to ground?

I'm new to electronics, tinkering with a custom split keyboard design. I have a micro controller in the one half and a MCP23S17 IO expanded in the other. I have a five strand cable to connect the two. I think I need MOSI, MISO, SCK, Ground and 5v+. Do I need a dedicated chip select, or can I connect chip select to ground (pulled low?) if the only spi device on the spi bus in the IO expander?

Best Answer

Most SPI devices use the CS as a framing signal as well as for bus sharing, so you can't get away with just tying it to GND. From a quick look at the datasheet this appears to be the case for the MCP23S17.

If you need to save pins, consider using the IC's I2C sibling MCP23017. If you need to save pins and absolutely must use the MCP23S17, you could probably contrive some circuit to set CS high (i.e. deasserted) when SCLK has been idle for a few microseconds at the end of a transaction. That would be a pretty ugly hack though, and it would be difficult not to violate timing requirements on the other end when it needs to assert CS at the start of the next transaction.