Heres a quick primer on sending data over the SPI bus from one microcontroller to another. The data is this case consists of 10-bit readings from, say, an A/D converter. This shows another advantage of SPI, which is that the data width is not fixed. No matter whether you send 8, 10, 12 or 16 bits, the procedure is always the same. If the only objective were to connect two microcontrollers together, it would actually be less effort to use an asynchronous serial interface with the TXD and RXD lines. The SPI bus, by contrast, is better for controlling and communicating with external hardware. Here our main purpose is to illustrate the transmission protocol.
 

Inter-Microcontroller Traffic
Inter-Microcontroller Traffic.

Besides MOSI and MISO, the schematic shows that a third line is involved in this case the chip select line /CS. The slash (/) means that the signal on this line is active Low. /CS allows you to connect several slave devices to a single master. In that case they share the data and cl...