SPI is a low-cost, four-wire full-duplex synchronous serial communication interface used between integrated circuits with slow peripheral devices. It operates in a master-slave relationship and uses three registers and four signals. It is commonly used for temperature sensors, flash memory, and encoders. Multiple slaves can be connected to a single master by separate SSn signals.
A peripheral serial interface (SPI) is a low-cost four-wire full-duplex synchronous serial communication data stream interface that operates in a master-slave relationship. Data transfer in serial devices occurs one bit at a time, making SPI a low-speed interface. It is commonly used as a link between integrated circuits with onboard slow peripheral devices that are accessed intermittently. It competes with parallel data transmission devices, but as SPI increases in efficiency, the advantage of the former diminishes. SPI is sometimes referred to as “microwire”, although this is considered a subset protocol of SPI.
Data transfers from a serial peripheral interface are done via full duplex protocol. Data is transferred and received simultaneously in both directions. Applications using SPI get a lot of efficiency in this mode; one such application is between an encoder-decoder (codec) and a digital signal processor (DSP). Other applications include temperature and pressure sensors as well as flash memory.
Whenever two serial peripheral interface devices communicate, one device is referred to as the “master” while the other device is the “slave”. The master device initiates all communications by transmitting signals to the slave device. A serial peripheral interface bus can connect multiple slave devices to a single master.
Serial peripheral interface devices use three registers – control register (SPCR), status register (SPSR), and data register (SPDR) – in sending data, along with four different signals. The first signal is called serial clock (SCLK), which generates only the master device. This is followed by master-out slave-in (MOSI), master-in slave-out (MISO), and slave select (SSn), where “n” is the number of slave devices that the master device is connected to.
In a typical single-slave configuration, an engineer looking to use a serial peripheral interface would plug SCLK into the input of a slave device. MOSI then carries the data from the master device to the slave device while MISO transfers the data from the slave to the master. To determine which device is master and which slave, the former connects Master SSn to Slave SSn and generates a generic discrete input/output signal to the latter.
To connect multiple slaves to one master in a serial peripheral interface, separate SSn signals are connected from the master device to separate slaves. For example, SS1 is connected to Slave 1, SS2 is connected to Slave 2 and so on. Similar to the single slave configuration, SCLK is connected from the master device to multiple slaves. MOSI master to slave, as well as MISO slave to master are connected.
Protect your devices with Threat Protection by NordVPN