7 Serial Interfaces 2 Flashcards
SPI ?
Serial Peripheral Interface
SPI created?
• SPI was developed by Motorola, it is also known as MicroWire, QSPI or “4-wire serial”
SPI overview details?
- It is a synchronous serial communication bus
- Primarily used for serial communication between a host processor and peripherals
- SPI works in a master-slave configuration, with the master being the host microcontroller, for example, and the slave being the peripheral device
SPI diagram?
SPI connections?
- Serial Clock(SCLK)
- Chip Select(CS)
- Serial Data In (SDI) / Master Out Slave In (MOSI)
- Serial Data Out(SDO) / Master In Slave Out (MISO)
Serial Clock (SCLK)?
Data is transferred synchronously to this clock, generated by the master device
Chip Select (CS)?
All data on the bus is ignored by the slave device unless it’s chip select pin is asserted (almost always active low)
Serial Data In (SDI) / Master Out Slave In (MOSI)?
Unidirectional data transfer port from the master device into the slave device
Serial Data Out(SDO) / Master In Slave Out (MISO)?
Unidirectional data transfer port from slave device into the master device
SPI Operation?
- There is only one master device, but there can be any number of slaves depending on the number of chip select lines of the master
- Operates up to about 2 MHz (but maybe more if you ignore the specs..)
- Master sends out clocks and chip selects. Activates the slaves it wants to communicate with, possibly multiple slaves!
- So we can write to multiple devices all at once
SPI Multi-Slave operation?
- The SPI port of each slave is designed to send out during the second group of clock pulses an exact copy of the data it received during the first group of clock pulses
- The whole chain acts as a communication shift register
- Such a feature only requires a single SS/CS line from the master, rather than a separate SS/CS line for each slave
How is transfer started in SPI?
Transfer started by the master pulling CS/SS low, data is then transferred according to the device data sheet
SPI timing diagram?
What is Bit-Banging?
Software that is written if there is no dedicated SPI hardware interface, to control each pin.
Advantages of SPI?
- Complete protocol flexibility for the bits transferred
- Not limited to 8-bit words
- Arbitrary choice of message size, content, and purpose
- Extremely simple
- No arbitration
- Slaves use the master’s clock, and do not need precision oscillators
- Slaves do not need a unique address
- Uses only four pins on IC packages, far fewer than a parallel interface
- Signals are unidirectional allowing for easy Galvanic isolation
- Specification not limited to any maximum clock speed