Download Downloading - All IT eBooks

Transcript
Serial Peripheral
Interface – SPI
As we have already seen in the previous chapter, the I2C's similar features exist, and
one of them is the Serial Peripheral Interface (SPI). However, as opposed to the
I2C bus, this bus can transfer data at higher rates than I2C, and since it is full-duplex,
the data transfer can take place bidirectionally. Due to these features, the SPI bus is
normally used to implement an efficient data stream for multimedia applications
(LCDs/video), digital signal processing and/or telecommunications devices (Ethernet,
CAN, serial ports, and so on), and SD cards. However, despite this fact, it can be used
to communicate with standard sensors, ADC/DAC converters, and other similar
devices too.
In order to demonstrate the versatility of the SPI bus, in this chapter, we're going to
present a simple temperature sensor management using a thermocouple sensor and
a more complex device, such as a mini LCD display.
What is the SPI bus?
The SPI bus is a full-duplex, single master, multi-slave, synchronous serial interface;
as for the I2C bus, it is used for the on-board connection of sensor chips with the
main CPU. This bus requires at least (apart from the GND signal) three wires plus
one chip select signal per slave. This line is typically called Slave Select (SS) or Chip
Select (CS), and usually, it's active low (that is, the master must set it to 0 to enable
the desired slave chip).
[ 161 ]