0% found this document useful (0 votes)
284 views16 pages

I2C Protocol Overview for IoT

i2c protocol studies in IOT

Uploaded by

vikram420shergil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views16 pages

I2C Protocol Overview for IoT

i2c protocol studies in IOT

Uploaded by

vikram420shergil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

I2C Protocol Study

Kshitij Rajan Sheth [ 2GI22SCS01 ]


For M.Tech [SCS] at Gogte Institute of Technology, Belagavi

Date: 01/08/23 Subject : IOT


The I2C Protocol
The I2C name stands for “Inter - Integrated Circuit Bus”

A Small Area Network connecting ICs and other electronic systems Developed by Philips in late 1980s.

This protocol is a popular communication protocol used for connecting multiple devices together on a single
bus allowing them to communicate and exchange data efficiently.

This allows communication between Micro Controllers And peripheral devices with fewer wires making it
ideal for embedded systems and other applications that require low cost and low speed communication.

The I2C circuit is synchronous, multi-master, multi-slave, packet switched, and single-ended.

Protocol allows for efficient communication and data transfer between multiple devices in a system enabling
seamless integration and intraoplability.

Classifies devices into slave and master, and Allows multiple masters to be attached to the same bus.
The I2C Protocol Attributes
Features:

• Low current consumption


• High noise immunity
• Wide supply voltage
• Wide operating temperature range

Originally intended for operation on :


• One single board / PCB
• Synchronous Serial Signal
• Two wires carry information between
 A number of devices
 One wire use for the data
 One wire used for the clock

Today, a variety of devices are available with I2C Interfaces such as


Microcontroller, Electronically Erasable and Programmable ROM, Real-Timer, interface chips, LCD driver,
A/D converter.
I2C Bus Characteristics
Reduces Board Space and Cost By:
Allowing use of ICs with fewer pins and smaller packages
Greatly reducing interconnect complexity
Allowing digitally controlled components to be located close to their point of use.
Includes electrical and timing specifications, and an associated bus protocol.

• Two wire serial data & control bus implemented with the serial data (SDA) and serial clock lines (SCL).

• Unique start and stop condition

• Slave selection protocol uses a 7-Bit slave address. The bus specification allows an extension to 10 bits.

• Supports Bi-directional data transfer.

• Acknowledgement [ACK] after each transferred byte.

• No fixed length of transfer.


I2C Bus Definitions
Master:
• Initiates a transfer by generating
• start and stop conditions
• Generates the clock
• Transmits the slave address
• Determines data transfer direction

Slave:
• Responds only when addressed
• Timing is controlled by the clock line

If master wishes to write to the slave,


 then it repeatedly sends a byte with the slave sending an ack bit.
 In this situation the Master is in transmit mode and slave is in receive mode.
 If the master wishes to read from the slave then it repeatedly receive a byte from slave.
 The master is sending an acknowledgement bit after every byte expect the last one.
I2C Diagram Descriptions:
In I2C communication the master device
initiates communication and controls the
bus while the slave device corresponds to
commands and provide data,
Allowing for efficient and synchronised
data transfer between devices.

Signal Components :
I2C data transfer consists of 5 signal
components:
(a) Start (S)
(b) Stop (P)
(c) Repeated Start (R)
(d) Data
(e) Acknowledge (A)

[A] Start Condition :


 Used to indicate that a device would like to transfer data on the I2C bus
 Represented by the SDA line going low when the clock (SCL) signal is high
 Will initialize the I2C bus.
Signal Components and Conditions :

[B] Stop Condition :


A condition that a device wants to release the I2C bus.
 Is represented by the SDA signal going high when the SCL signal is high
 Once the stop condition is complete, both the SCL and SDA signals are high.
 This is the idle bus.

[C] Repeated Start (R) Condition :


- A Start signal generated without first generating a Stop condition to terminate the communication.
- Used by the master to communicate with another slave or change data transfer direction
without releasing the bus.
- Also referred to as Restart condition.

[D] Data :
Represents the transfer of eight bits [a Byte] of information.
 Data on the SDA line is considered valid only when the SCL signal is high.
 When the SCL signal is low, data is allowed to change.
 The eight-bit data may be a control code, an address, or data.
Signal Components and Conditions (continued):

[E] Acknowledge (ACK) Condition

 Data transfer needs to be acknowledged either positively (ACK) or negatively (NACK).


 A device acknowledges a byte it received positively by bringing the SDA line low
during the ninth clock pulse of SCL.
 If the device allows the SDA line to float high, it is transmitting a negative acknowledge (NACK).

Arbitration :
 In the event two or more master devices attempt to begin a transfer at the same time,
an arbitration scheme is employed to force one or more masters to give up the bus.
 Clock synchronisation is crucial in this communication as it ensures accurate data transfer
between devices by maintaining consistent timing and preventing data corruption .
I2C Addressing Methods :

A6 A5 A4 A3 A2 A1 A0 R/W

7-bit address
Figure 11.13a 7-bit I2C address

1 1 1 1 0 A9 A8 R/W A7 A6 A5 A4 A3 A2 A1 A0

10-bit address
Figure 11.13b 10-bit I2C address
I2C Addressing & Acknowledgements :

I2C protocol allows master devices to use either the 7-bit and 10-bit address to specify the slave device for
data communication.
 The 7-bit addressing uses the upper 7 bits of the address byte for address and the least - significant bit to
specify the data transfer direction.
 The 10-bit addressing uses two bytes to carry the address information.
 Master reads slave immediately after the first byte.
 A master may transfer some data to the slave and then generate a restart condition to read data from the
slave or send/read data to/from other slave.
 A transition of the data line while the clock line is high is defined as either a start or a stop condition.
 Both start and stop conditions are generated by the bus master.
 The bus is considered busy after a start condition, until a stop condition occurs.

SDA SDA
SCL SCL

Start Condition Stop Condition


Pin Description for I2C Protocol :
SIGNAL SIGNAL DEFINITION ACTIVE STATE
NAME DIRECTION
Clock Input Microprocessor N/A
clock
Reset Input System reset Active Low

Address Input Address bits reading N/A


and writing to
configuration and
data registers
Data Bi-directional Data bus N/A

RW Input 1 = RD
0 = WR

INTR Output Active Low

SDA Bi-directional I2C Data bus line N/A

SCL Uni-directional I2C Clock line N/A


Advantages of I2C Protocol

Sequential data transfer widely used for communication


mechanism Efficient communication between various devices
between interconnected sensors
actuators enabling
Seamless integration
and interoperability
Real-Time Clock (RTC) modules

Use cases :
essential for maintaining accurate time
and date information in devices like
embedded systems and IoT applications.

Interfacing Sensors
used to connect various sensors to
microcontrollers ; like temperature
sensors, humidity sensors, accelerometers,
gyroscopes, and proximity sensors often
utilize the I2C protocol due to its
implicity
Use cases
LCD Display and LEDs:
graphical and character LCD displays can Consumer Electronics
be interfaced using the I2C protocol,
used for communication between various
enabling straightforward control and
devices such as smartphones televisions
display updates. eg. Televisions, allowing
wearable devices and home appliances
fine-tuning of brightness and color
allowing them to exchange data and
settings for LEDs in various devices.
control signals efficiently and reliably .

EEPROM and Flash Memory System Management


for storing configuration data or small sed for system management and

amounts of non-volatile memory. configuration, allowing communication

and mainly to communicte with with embedded controllers responsible for

Electrically Erasable Programmable Read- power management, fan control, and other

Only Memory system monitoring tasks.


Summary

◘ The I2C protocol is a communication protocol that allows multiple devices to communicate with each other
it has been widely used in various industries such as customer electronics embedded systems and IOT
devices.

◘ I2C is a versatile and widely adopted protocol due to its simplicity, versatility, and the ability to connect
multiple devices on the same bus. However, it is not suitable for high-speed data transfer over long
distances, as it is intended for short-range communication within a circuit board or a localized area.
Thank You!

You might also like