Briefing- SPI
SERIAL PERIPHERAL INTERFACE
Developed by Motorola (low cost and simple interface, ease of use, uses less hardware and system resources).
Full form is Serial Peripheral Interface. Importance of interfacing in consumer electronics.
Full form is Serial Peripheral Interface. Importance of interfacing in consumer electronics.
SPI Bus is used to send data between microcontrollers and peripherals like EEPROM, ADC, DAC, RTC, Sensors, SD Card, RFID, Wireless Tx/Rx, etc.
It is a serial communication protocol.
It is a synchronous data bus as the master or slave is synchronized on the edges of the clock.
The maximum speed goes over 10 Mbps.
The maximum speed goes over 10 Mbps.
It is a simple bus having 4 wires for data communication-
SCLK : Serial Clock used for all data communication
MOSI : Master out slave in - Output data line is from master
MISO : Master in slave out - Input data line is for master coming from a slave
SS/CS : Slave select or Chip select - used to select a slave
It is a simple master communication protocol where one device initiates the communication with slaves. Means master is one, slave is many.
It is full-duplex (both master and slave can send data at same time through MOSI and MISO lines respectively).
SCLK should be produced by the Master only.
It is normally used for short-distance communication means communication within same circuit board or between the devices on the same PCB.
It support single master means here one device is considered the master (microcontroller or processor) and all other devices (peripheral or other microcontroller or processor) and all other devices (peripherals or other microcontrollers) are considered as slaves. Slaves takes instruction from master.
For every slaves there is one SS lines so it occupies space where more slaves are added. It is the disadvantage.
It is preferrable where large amount of high speed data is not transferred. (therefore, 10Mbps is limit)
Here any no. of bit can be sent or reieved in a continuous stream is the advantage (Some protocols support fixed data width).
It does not have any START or STOP bit. So, simple in communication.
Note- For Communication, SS='0' or low
To Stop Communication SS='1' or High (default)
Note- Generally MISO will be taken for data read and MOSI for data write
Methods of Communication happens in SPI are-
1. Independent Chain Configuration 2. Daisy Chain Configuration
SPI Modes of Operation:-
Depending upon Clock Priority (CPOL) and Clock Phase (CPHA) values:-
Suppose sending the data= 10101010
1. Mode 0- CPOL=0 & CPHA=0 (means at rising edge when it go to 0 to1 then data will be sent)
2. Mode 1- CPOL=0 & CPHA=1 (data transmission takes place at falling edge of clk)
3. Mode 2- CPOL=1 & CPHA=0
4. Mode 3- CPOL=1 & CPHA=1

.jpeg)

.jpeg)
Comments
Post a Comment