Hi ,guys,two or more SPI modules how to connect to an Arduino? I have studied this question for a long time, but can't solve it. I knew that Arduino had one SPI connector,but if more SPI modules I want to connect to Arduino. How to connect? How to solve the problem of chip select? Thank you in advance!
Normally, only a seperate ChipSelect is needed for each device. An SPI chip should have the other signals not active as long as the ChipSelect is not active.
However, some SPI chips don't like to share the signals. The I2C bus is well defined, but the SPI bus is whatever a manufacturer wants to do with it.
SPI - Arduino Reference (look for the word "multiple")
If the slave select on each SPI device works as it should, they should be compatible. You can change the mode, bit order, and speed on the fly to accommodate each device.
Be careful about the voltage of each device. If the Arduino is 5v and the SPI device is 3.3v (or the other way around), it will probably require a logic level converter. Some have one on the board.
I have found as long as the device is SPI, and not a "serial" device, they will work together. Like Erdin said tho, they must have separate slave select pins.
If you want info on specific devices, you should post links to the devices.
edit: Here is a post that shows how to change the settings on the fly.
If you feel like majenko does in that thread, then just call me a jerk and I will quit responding.
Bring the slave select line low for one device at a time.