SPI vs I2C | Difference between SPI and I2C
This page compares SPI vs I2C and mentions difference between SPI and I2C in tabular format. It provides difference between based on various factors which include interface diagram, pin designations, data rate, distance, communication type, clock, hardware and software complexity, advantages, disadvanatages etc.
Following are the features of SPI Interface.
➨This serial bus standard is developed initially by Motorola. It has been later adopted by several silicon device manufacturers.
➨The figure-1 depicts SPI interface diagram. As shown there are four lines between master and slaves viz. MISO (Master In Slave Out), MOSI (Master Out Slave In), SCLK (Serial Clock), SS (Slave Select). Due to MISO and MOSI, communication is full-duplex and bi-directional between master and slave. SS (Slave Select) is used to select particular slave device before transmission begins. Moreover due to support of SCLK line, communication is synchronous in nature.
Refer SPI Interface>> for more detailed description.
Following are the features of I2C Interface.
➨This bus standard is developed by Philips initially to provide more hardware circuit efficiency and simplicity.
➨The figure-2 depicts I2C interface diagram. As shown there are two lines between masters and slaves viz. SCL (Serial Clock) and SDA (Serial Data). Hence it is known as "Two Wire Interface".
➨The I2C protocol supports multiple masters but usually there will be one master and more than one slaves. The master controls the clock signal and device which is addressed by it, is known as slave. There is 7 bit address used for slave device.
➨The I2C communication protocol is defined in figure-3. As shown, the data transmission or reception is marked by START and STOP condition. Each byte is being ACKed. Initially slave device address is being used in the packet, next Read or Write operation is indicated and later data is padded.
➨The figure-3 also depicts levels of SDA and SCL lines during START and STOP conditions.
Refer I2C Interface>> for more detailed description.
Following table summarizes difference between SPI and I2C interfaces.
|Number of Bus lines||Four ( SCLK, CS, MISO, MOSI)||Two ( SDA, SCL)|
|data rate||Higher, about 10 MHz or more||Lower, about 100 KHz or 400 KHz|
|Run current||Lower, about 200 µA at 4 Mbps, hence less power consumption||Higher, about 400 µA at 400 Kbps, hence more power consumption|
|Preferable application||Perform well in single master and single slave configuration||Perform well in multi-master and multi-slave configuration|
|Device addressing||Does not support||Support|
|Acknowledgement (ACK) mechanism||Does not have mechanism to support receipt of the data||It has mechanism to support receipt of the data using ACK|
|Overhead in point to point connection||Less||More|
|Application||applications requiring continuous data stream transmission||communication between devices which does not require continuous transmission i.e. requiring occasional communication|
what is difference between
difference between UART vs SPI vs I2C
Difference between 100Base-T1 and 1000Base-T1
CAN vs TTCAN
CAN vs TTP
RS232 vs RS422 vs RS485 interface
LIN vs CAN vs FlexRay vs MOST
Difference between MOST25,MOST50,MOST150