I am trying to get both a SPI LED matrix display and an NRF24L01 to both work on the same Arduino Pro Micro. I know they both want to use the clock pin but how do I get them to share? Can I use the CS pin to turn off one device while trying to use the other? The display does can be set only when something needs to change so it's not always running.
-
"isp led matrix" was meant to read "SPI LED matrix" right?– timemageMar 15, 2021 at 2:00
-
Yes sorry I fixed it– Ben CrawfordMar 15, 2021 at 2:04
-
You can indeed use different CS (chip select) lines to address individual SPI devices on a single bus run by an SPI “master”. The MOSI, MISO and SCLK lines can be reused and shared between perpiheral devices, as long as only one device is actively being addressed at any point in time.– StarCatMar 15, 2021 at 7:08
1 Answer
It is indeed possible and supported to use different CS (chip select) or SS (“slave select”) lines to address individual SPI devices on a single bus run by an SPI “master”.
Many SPI TFT Touch displays need this to address the display controller and the touch controller as individual SPI devices and/or an integrated SD Card interface (wich also uses SPI).
The MOSI, MISO and SCLK lines can be reused and shared between perpiheral devices, as long as only one device is actively being addressed at any point in time. I.e. only one SS/CS may be active at any time and the software must support such sharing of SPI resources.
-
1
-