Understanding SPI
SPI is a bus system that has a controller and one or many devices. The controller selects a device that should send data to the controller, or that is going to receive data from the controller.
Devices on an SPI bus can also be daisy chained together. A daisy chain is a wiring scheme in which you put multiple devices together in a row.
SPI communication between two devices uses the following four pins:
- CS: ChipSelect selects which device on the bus should receive or send data.
- CLK: Clock sets the frequency of the transfer (DO) and receive (DI) wires.
- DO: DataOut or DigitalOut transmits data to the receiving device.
- DI: DataIn or DigitalIn receives data from the controller.
The following diagram shows the one-to-one connection of an SPI controller and an SPI device:
The following diagram shows the SPI connection of one controller and two devices. Here, we are using two...