

For ACK bit, SDA is set to low by master or slave at 9 th clock cycle. This ACK bit is generated by either slave or master depending upon the situation.

After each byte either sent or received, ninth clock cycle is held for the ACK/NACK (acknowledged/not acknowledged). R/W bit indicates the direction of transmission of following bytes, if it is HIGH means the slave will transmit and if it is low means the master will transmit.Įach bit is transmitted on each clock cycle, so it takes 8 clock cycles to transmit a byte. So rising edge of SDA stops the transmission. In the same manner, rising edge of SDA stops the transmission which is shown as ‘STOP’ condition in above diagram, where the master leaves SCL high and also releases SDA to go HIGH. After this all devices on the same bus go into listening mode. The falling edge of SDA is the hardware trigger for the START condition. Initialization of transmission begins with a falling edge of SDA, which is defined as ‘START’ condition in below diagram where master leaves SCL high while setting SDA low. There are some set of conditions which frame a transaction. In this case voltage shifters are used to match the voltage levels between two I2C buses. But what if two devices which are running on different voltages, need to communicate using I2C? A 5V I2C bus can’t be connected with 3.3V device. I2C communication is flexible, means the device which is powered by 5v volt, can use 5v for I2C and the 3.3v devices can use 3v for I2C communication. The voltage levels of I2C are not predefined. This way we can use the same bus to communicate with multiple devices. When addressed only the slave with that particular address will reply back with the information while the others keep quit. Since there is more than one slave in the bus, the master has to refer to each slave using a different address.
TWO WIRE INTERFACE ARDUINO SERIAL
Serial Data (SDA): Sends the data to and from between the Master and slave.Īt any given time only the master will be able to initiate the communication. Serial Clock (SCL): Shares the clock signal generated by the master with the slave The complete communication takes place through these two wires namely, Serial Clock (SCL) and Serial Data (SDA). The advantage of I2C communication is that more than one slave can be connected to a Master. Communication should and will always occur between two a Master and a Slave.

Here one device is called a master and the other device is called as slave. As said earlier it has two wires, these two wires will be connected across two devices. I2C communication was first introduced by Phillips. It has only two wires to share information out of which one is used for the cock signal and the other is used for sending and receiving data. I2C is a synchronous communication protocol meaning, both the devices that are sharing the information must share a common clock signal. It is normally denoted as I2C or I squared C or even as 2-wire interface protocol (TWI) at some places but it all means the same. The term IIC stands for “ Inter Integrated Circuits”.
