The Serial Peripheral Interface (SPI) bus was put together by Motorola (Freescale/NXP/Qualcomm) in the 1980s for communicating between a processor and one or more external peripherals. SPI is intended for short distance communication, typically between chips on the same board.
SPI is similar to the I2C bus and it has advantages, drawbacks, and similarities:
- Higher speed
- No addresses
- No pullup resistors
- Transmit and receive simultaneously
- More pins necessary
- There are at least 4 ways to set them up
Similarities between SPI and I2C:
- Need to send out dummy data to retrieve results
- Reduced pin count and smaller packages compared to parallel buses
- Might require an oscilloscope to check the signal timing
The topology of the SPI circuit is a bus consisting of a master and one or more slaves. The signals on the bus are called Master Out Slave In (MOSI), Master In Slave Out (MISO), Clock, and Select.
In the following figures I show two typical implementations of SPI with one and three slave peripherals. (A uP is a microprocessor.)