SPI Questions


I was wondering if anybody could help me with some SPI questions. I know how to use SPI, but I don't really know about SPI.

I'm looking to use a remote control to wirelessly control a robot. I know arduino somewhat well, but the (school) project requires I use a TI MSP430 Launchpad as well.

My idea is to use a USB host shield to have an arduino translate a PS4 controller commands and send them to the MSP430 using the 2.4 GHz nrf24lu1+ module. However, the USB host uses SPI to communicate with the USB device. I know the arduino uno has the ICSP header and can also use some of the digital IO pins, but it looks like it's an "or" not an "and." Can somebody explain to me the difference in pins / usability here of the two?

And if it's not possible with that method, does anybody have a suggestion?

On the Uno, digital pins 11-13 are wired to the ISP header. These are the same pins; the same wires. It makes no difference electrically which one you use.

I was afraid of that.

Do you have any suggestions on using 2 SPI devices on one arduino?

The whole point of SPI is that you can connect a bunch of things to it. They will all share the same CLK, MISO, and MOSI pins. Each one gets its own SS pin. Whichever SS pin you have pulled low, that's the one you're talking to at the moment.

I assume SS is like a chip select? Can you explain the "SS"? I'd like to learn as much as I can while working on this :D

Slave Select?

SS is slave select. Same purpose, different name.

Did you know that AVR serial ports are capable of master-mode SPI?

Or that SPI is bi-directional, it reads bits even as it sends bits. Mostly that's not used but if you chained output shift registers with as many input (parallel to serial) registers you could read the inputs as you send the outputs. Hard to say what it's good for but it can be done.

The Mega2560 has 3 extra serial ports.

SPI inside and out covers making an AVR slave device and more.


I did not know that. I've only used SPI enough to get an MCP4921 DAC running, but my professor didn't go into too much detail otherwise so I wanted to dig into it for my final project.

I appreciate the link. It looks like a good read, thanks!