Hi all.
I'm working with multiple SPI devices and I'm wondering if it's possible to use additional pins for MOSI, or if I'm limited to just one. I realize that it's possible to control multiple devices daisy-chained, but that does not seem the most straightforward solution if I can have more than one MOSI pin.
Thanks for your insight.
I wouldn't think so. SPI is a hardware controlled transport, it is physically configured to the appropriate pins on the arduino.
You don't daisy-chain. You parallel them up. How many devices did you have in mind? Each slave keeps the MISO pin high-impedance until it is selected. As for MOSI each one "listens" to it when selected. There is no real limit on the numbers apart from the number of SS lines you can find.
However the hardware does have a second set of SPI pins using the USART in SPI mode.
Awesome, that solves it quite nicely.
I was thinking of having a common SS with different MOSI as was suggested in the switch documentation and my devices can be put in serial as the value on the descending edge of SCK is passed on to the next device.
But this looks great, and if it's 3 mus/byte I'll be able to update all 80 switches well within my desired 25 ms.
Keep in mind, in addition to the hardware SPI controller, and the SPI Master mode of the USART, SPI can be done with any set of digital pins by "bit-banging" them. It's a very simple transport protocol to emulate by toggling a pin high/low for clock, and reading/writing digital pins for MISO/MOSI. The only compromise is speed.