5
\$\begingroup\$

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?

asked Jul 24, 2012 at 22:21
\$\endgroup\$

2 Answers 2

7
\$\begingroup\$

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.

answered Jul 24, 2012 at 22:47
\$\endgroup\$
4
\$\begingroup\$

How fast do you want to run? In terms of the protocol, no, so long as you have enough IO pins to toggle the individual slave selects. Even then, you could go with a fancy scheme like a 3-8 decoder and have even more chip select lines (8) based on the combination of the input lines (3).

The only issue I can think of here might be fanout - that is when you have many devices connected to an output (MOSI pin in this case). It is possible that each extra slave device connected could contribute to some minor capacitive loading - perhaps enough could have some effect. I am not an expert here but it could warrant some investigation if we're talking about real extremes here (dozens or hundreds of devices..?)

answered Jul 24, 2012 at 22:52
\$\endgroup\$
3
  • \$\begingroup\$ I am thinking about dozens, not hundreds. between 6- 11 to be exact. \$\endgroup\$ Commented Jul 24, 2012 at 23:41
  • \$\begingroup\$ @EnderWiggins, Technically not dozens. Probably OK to do, you could always test empirically. \$\endgroup\$ Commented Jul 25, 2012 at 0:49
  • \$\begingroup\$ I've gone up to 5 without problem. \$\endgroup\$ Commented Jul 25, 2012 at 3:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.