Professional Documents
Culture Documents
I2 Cgroup 2
I2 Cgroup 2
I2 Cgroup 2
Group 2
Introduction of I2C
I2C stands for Inter-Integrated Circuit. The inter-integrated circuit or I2C Protocol is
a way of serial communication between different devices to exchange their data
with each other. This is a type of synchronous serial communication protocol which
means that data bits are transferred one by one at regular intervals of time set by a
reference clock line. It is a half-duplex bi-directional two-wire bus system in which
data transmission takes place between Masters and Slaves. It was originally
designed by Philips Semiconductor in 1982. Recently, it is a widely used protocol for
short-distance communication.
Features
The following are some of the important features of I2C communication protocol:
• Only two common bus lines (wires) are required to control any device/IC on
the I2C network
Uses 7-bit addressing system to target a specific device/IC on the I2C bus
Each I2C device (Master/slave) is identified by its 7-bit or 10-bit unique address
known as device ID which is provided by device manufacturer only and can act as
a transmitter or receiver at a time, depending on the configuration of it. As we
know, the bus consists
The two common bus lines are Serial clock line or SCL and Serial data line or SDA.
It is also known as Two Wired Interface (TWI).
Master is the one which initiates a communication, generates a clock and
terminates the communication and Slave is the one which is handled by master
and acts according to the master command
Here SCL (serial clock line) is responsible for synchronizing the communication and
is controlled by Master and SDA (serial data line) is responsible for providing the
data bi-directionally and can be used by master or slave or both.
I2C networks are easy to scale. New devices can simply be connected to the two
common I2C bus linesOwing to its simplicity, it is widely adopted for
communication between microcontrollers and sensor arrays, displays, IoT devices,
EEPROMs etc.
I2C combines the best features of SPI and UARTs. Before I2C, different devices used
to communicate using UART and SPI protocols
Modes
There are mainly four modes which define the data rate of the I2C
communication system:
● Data is transferred between the master device and slave devices through a single
SDA data line, via patterned sequences of 0’s and 1’s (bits).With I2C, data is
transferred in messages.
● Messages are broken up into frames of data. Each message has an address frame
that contains the binary address of the slave, and one or more data frames that
contain the data being transmitted.
● The message also includes start and stop conditions, read/write bits, and
ACK/NACK bits between each data frame:
Start Condition
The SDA line switches from a high voltage level to a low voltage level before the SCL line
switches from high to low.Once a start condition is sent by the master device, all the slave
devices get active even if they are in sleep mode, and wait for the address bits.
Address frame
It comprises of 7 bits and are filled with the address of the slave device to/from which the
master device needs send/receive data. All the slave devices on the I2C bus compare
these address bits with their address.
Read/Write Bit
This bit specifies the direction of data transfer. If the master device/IC need to send data
to a slave device, this bit is set to ‘0’. If the master IC needs to receive data from the slave
device, it is set to ‘1’.
ACK/NACK Bit
Each frame in a message is followed by an acknowledge/no-acknowledge bit. If an
address frame or data frame was successfully received, an ACK bit is returned to the
sender from the receiving device.
Data Frames
It comprises of 8 bits and they are set by the sender, with the data bits it needs to transfer
to the receiver. This block is followed by an ACK/NACK bit and is set to ‘0’ by the receiver
if it successfully receives data. Otherwise it stays at logic ‘1’.
Stop Condition
After required data blocks are transferred through the SDA line, the master device
switches the SDA line from low voltage level to high voltage level before the SCL line
switches from high to low.
Dhuri Amey 184130010
STEPS OF I2C DATA TRANSMISSION
1. The master sends the start condition to every connected slave by switching the
SDA line from a high voltage level to a low voltage level before switching the SCL
2. The master sends each slave the 7 or 10 bit address of the slave it wants to
3. Each slave compares the address sent from the master to its own address. If the
address matches, the slave returns an ACK bit by pulling the SDA line low for one
bit. If the address from the master does not match the slave’s own address, the
5. After each data frame has been transferred, the receiving device returns
another ACK bit to the sender to acknowledge successful receipt of the frame:
6. To stop the data transmission, the master sends a stop condition to the slave by
Because I2C uses addressing, multiple slaves can be controlled from a single
master. As in I2C protocol the size of the address is upto 10 bits, there can be a
maximum of 1,024 (210) unique addresses. Hence a single master device can be
connected to upto 1024 peripheral slave devices. Since communication is always
initiated by the master there is no chance of collision of data. The master would
send the address of the slave it wants to communicate with, to all of the slave
devices simultaneously through the SDA line and only the slave whose address
matches would send an ACK signal.To connect multiple slaves to a single master,
wire them like this, with 4.7K Ohm pull-up resistors connecting the SDA and SCL
lines to Vcc:
MULTIPLE MASTERS WITH MULTIPLE SLAVES
Multiple masters can be connected to a single slave or multiple slaves. The problem
with multiple masters in the same system comes when two masters try to send or
receive data at the same time over the SDA line. To overcome this problem, each
master needs to detect if the SDA line is low or high before transmitting a message.
If the SDA line is low, this means that another master has control of the bus, and
the master should wait to send the message. If the SDA line is high, then it’s safe to
transmit the message. To connect multiple masters to multiple slaves, use the
following diagram, with 4.7K Ohm pull-up resistors connecting the SDA and SCL
lines to Vcc:
Rutika Shinde 184131052
There is a lot to I2C that might make it sound complicated compared to other
protocols, but there are some good reasons why we use I2C to connect to a
particular device:
ADVANTAGES OF I2C
Acknowledgement.
the slaves will not be able to understand any of the information. So to avoid
collision detection.
● I2C protocol is adaptable in the sense that it can work well with both slow
I2C communication doesn’t have too many disadvantages. The fact that the
protocol has been in use for over 30 years. However, it suffers from a few minor
limitations.
one line for communication between slave and master to transfer and
receive data
● Since only 7-bits (or 10-bits) are available for device addressing, devices
on the same bus can share the same address. Some devices can
configure the last few bits of the address, but this imposes a limitation of
APPLICATIONS OF I2C
I2C is a great option for applications that require low cost and simple
implementation rather than high speed. For example, common uses of the I2C