Overview of SPI
SPI is a simple protocol in nature used in applications where there is a relatively low amount of data transmission. Often the protocol is used for the communication between a microcontroller and sensor.
Take, for instance, a motion sensor light. When the sensor is activated it communicates with a processor that then turns the light on; this communication is likely happening over the SPI bus to almost instantaneously execute the command. Applications with Flash Programmers for 8-32 bit custom MCUs & SPI Flash Memory where there is a higher data transfer rate require a faster protocol such as USB or Ethernet to keep up with the higher volume of data.
SPI Theory of Operation
SPI is a serial protocol that requires the following four wires to operate:
1. SCLK (Serial Clock): The Serial Clock wire carries the clock signal from the master device to other devices on the serial bus.
2. MOSI (Master Output, Slave Input): The MOSI wire carries data output from the master device to the slave devices on the serial bus.
3. MISO (Master Input, Slave Output): The MISO wire carries data output from the selected slave device to the master device or microcontroller on the serial bus.
4. SS (Slave Select): On an SPI bus, there must be one master device, but there can be multiple slave devices. The master device can exchange data with all of the slave devices, but the slave devices can only send data to the master – not to each other. The master device uses the Slave Select wire to select which slave device on the bus it will be communicating with before sending a data transmission.