Is there a limit to how many slaves you can control with a Arduino board using the SPI bus as long as you do not run out of pins?
Uno, for example, has 14 digital I/Os. So theoretically, I could have 11 slaves if I wanted to since MISO, MOSI and SCLK will be shared and there would be 11 different CS pins. I was wondering if anyone would run into any practical problems long before controlling 11 slaves. ( Although I will not use MISO )
I plan on controlling six 12 bit DACs for a project using UNO using the SPI bus. Is there something I need to be aware of?
Answer
The number of SPI slaves is not limited. In fact, you can add digital muxes (multiplexors) and control more slave devices than you have digital pins on the Arduino.
However, the SPI was design for communication over short distances within a box. So, the physical size of the bus can become a problem (bus capacitance, EMI). If you have to make a long-distance ruggedized SPI, there are application notes on the subject: Extending the SPI bus for long-distance communication.
No comments:
Post a Comment