I'm trying to build an app that uses both the SD card and the MCP23s17. Each is initialized with a separate chip select pin.
Since they share the SPI.h library, do the chip select pins have to be the same?
If yes, what is, or how do I find the address of the SD card so I can set the MCP23s17 addresses not to conflict?
Thanks in advance!
Cannibal
SPI shares SCK, MOSI, MISO among devices. (connected in parallel).
Each device needs a unique chip select pin.
There is no addressing as there is with I2C. The chip select does it all.
Ok,
The MCP23s17 is a little different, has three address pins that allow up to 8 devices on the same chip select line if properly enabled.
I just didn't know if the SPI library could accommodate more than one CS.
Sounds like it can.
Many thanks.
Cannibal
cannibalrobot:
Ok,
The MCP23s17 is a little different, has three address pins that allow up to 8 devices on the same chip select line if properly enabled.
I just didn't know if the SPI library could accommodate more than one CS.
Sounds like it can.
Many thanks.
Cannibal
I think you are confusing /CS with the address pins. the 23s17 only has one chip select line.