I2C and SPI

Good links on I2C (inter integrated circuit)
http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html
http://en.wikipedia.org/wiki/I%C2%B2C
(400 kbit/s Fast mode, 1 Mbit/s Fast mode plus or Fm+, and 3.4Mbits/s High Speed mode)


A master loses arbitration when it cannot get either SCL or SDA to go high when needed, this problem does not exist. It is the device that is sending the '0' that rules the bus. One master cannot disturb the other master's transmission because if it can't detect one of the lines to go high, it backs off, and if it is the other master that can't do so, it will behave the same.
This kind of back-off condition will only occur if the two levels transmitted by the two masters are not the same. Therefore, let's have a look at the following figure, where two MCUs start transmitting at the same time:


Good links on SPI (serial peripheral interface)
http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
ww1.microchip.com/downloads/en/devicedoc/spi.pdf
range of 1–70 MHz.
--------------------------------------------------------------------
SPI vs. I2C

Both SPI and I2C are good protocol for slow peripheral intermittent serial communication.But SPIs are better suited for data stream peripheral like DSPs or ADCs.On the other hand I2C is better for EEPROM kind of peripheral where addressing is much important.
SPI can achieve better data rates than I2C.Currently SPI support tens of megahertz.Due to its duplex functionality very suitable for application like codec DSP where data continuously move in and out

But SPI don't have inbuilt addressing , flow control and acknowledgement method in protocol.So slave addressing/selection comes from external hardware help only.So complexity increases than I2C.Though SPI is very simpler and fast in case of single master single.

Comments

Popular posts from this blog

Airtel Digital tv remote factory reset and reprogram

Tracking Linux kworker threads

Asynchronus I/O (AIO) in vxworks and Linux