How I2C works

Very basic 2-wire serial protocol for a bus with up to 127 nodes.
Post Reply
Go4IT
Pro
Posts: 611
Joined: 08 Feb 2019, 12:25

How I2C works

Post by Go4IT » 29 Dec 2019, 10:03

In this thread i try to cover the basics of the I2C communication as it is often used in automotive applications (e.g. serial EEPROMs). I will try do give a brief overview of how the most often used Master/Slave comm works. To those who need more indeepth information should start here https://en.m.wikipedia.org/wiki/I²C

I2C is made for short distance communication on a printed circuit board. It is designed as a master/slave bussystem, where each node have it's unique address. Only a master node can initiate a transmission, regardless of it will read from a slave or write to it. The slaves never start sending on their own. The roles are dynamic, but most often one device always acts as master and the other one as slave(s).

The basic data length is 8 Bit, and the node address uses usually has 7 Bit (Bit 7-1) for the ID and one Bit (Bit 0) to indicate if the master would send (write) to a slave, then the lowest Bit is set to 0, or if it receive (read) from it, where the Bit is set to 1.

The two signals are SCL for the clock and SDA for the data. Each I2C command initiated by master device starts with a START condition and ends with a STOP condition. For both conditions SCL has to be high. A high to low transition of SDA is considered as START and a low to high transition as STOP:
C552C657-04A3-4074-BFBD-018AF8CBBE8C.gif
After the START condition the bus is considered as busy until a STOP condition is raised. After the START condition the master can generate a "repeated Start". This is equivalent to a normal Start and is usually followed by the slave I2C address.
F15146AC-8B34-461E-A202-B0B8E6606ABF.gif
You do not have the required permissions to view the files attached to this post.

Post Reply