I know the basic of I2C and SPI communication. As both are synchronous protocol. I wanted to know that what makes SPI faster than I2C. If I am not wrong using I2C we can go used 400kbps while in SPI we can achieve 10mbps also. Does it because of hardware change? This question was asked to me in one of the interview.. Please make me correct if I am wrong.
There is an important hardware difference which limits the speed on I2C.
SPI: all lines are driven by the transmitter both high and low. This minimizes the time required for the wire to change states.
I2C: all lines are open-collector which means that the transmitter only drives the line low. When the transmitter releases the line, a resistor connected to Vcc (supply voltage) pulls the light high. However, due to capacitance of the wire and the components, the wire goes to high voltage relatively slowly. Because of this, the clock speed must be reduced to allow time for the lines to "drift" high.