0% found this document useful (0 votes)
75 views22 pages

Aktu PPT 10

Uploaded by

Priyanshu Yadav
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)
75 views22 pages

Aktu PPT 10

Uploaded by

Priyanshu Yadav
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/ 22

DR.

APJ ABDUL KALAM TECHNICAL UNIVERSITY

Branch - All Branches


Embedded System
(KOE-062)
Lecture – 10

Inter-Integrated Circuit (I2C)


By

Tukur Gupta
Assistant Professor
Department of Electronics & Communication Engineering
Ajay Kumar Garg Engineering College, Ghaziabad
INTER-INTEGRATED CIRCUIT
(I2C)
• I2C is a serial communication protocol, so data is transferred
bit by bit along a single wire (the SDA line).

• Like SPI, I2C is synchronous, so the output of bits is


synchronized to the sampling of bits by a clock signal shared
between the master and the slave. The clock signal is always
controlled by the master.
INTER-INTEGRATED CIRCUIT
(I2C)
• I2C combines the best features of SPI and UARTs.
• With I2C, you can connect multiple slaves to a single master
(like SPI) and you can have multiple masters controlling
single, or multiple slaves.
• This is really useful when you want to have more than one
microcontroller logging data to a single memory card or
displaying text to a single LCD.
LINES USED IN I2C
Like UART communication, I2C only uses two wires to transmit
data between devices.

 SDA (Serial Data) – The line for the master and slave
to send and receive data.
 SCL (Serial Clock) – The line that carries the clock
signal.
HOW I2C WORKS?
• 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:
MESSAGE IN I2C
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.

Stop Condition: The SDA line switches from a low voltage level to a high
voltage level after the SCL line switches from low to high.

Address Frame: A 7 or 10 bit sequence unique to each slave that identifies


the slave when the master wants to talk to it.
MESSAGE IN I2C
Read/Write Bit: The address frame includes a single bit at the end that
informs the slave whether the master wants to write data to it or receive data
from it. If the master wants to send data to the slave, the read/write bit is a
low voltage level. If the master is requesting data from the slave, the bit is
a high voltage level.

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.
ADDRESSING IN I2C
• I2C doesn’t have slave select lines, so it needs another way to
let the slave know that data is being sent to it, and not another
slave.
• It does this by addressing. The address frame is always the
first frame after the start bit in a new message.
• The master sends the address of the slave it wants to
communicate with to every slave connected to it.
• Each slave then compares the address sent from the master to
its own address.
• If the address matches, it sends a low voltage ACK bit back
to the master. If the address doesn’t match, the slave does
nothing and the SDA line remains high.
DATA FRAME
• After the master detects the ACK bit from the slave, the first data
frame is ready to be sent. The data frame is always 8 bits long,
and sent with the most significant bit (MSB) first.
• Each data frame is immediately followed by an ACK/NACK bit
to verify that the frame has been received successfully. The ACK
bit must be received by either the master or the slave (depending
on who is sending the data) before the next data frame can be
sent.
• After all of the data frames have been sent, the master can send a
stop condition to the slave to halt the transmission.
• The stop condition is a voltage transition from low to high on
the SDA line after a low to high transition on the SCL line, with
the SCL line remaining high.
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 line from
high to low.
DATA TRANSMISSION
2. The master sends each
slave the 7 or 10 bit
address of the slave it
wants to communicate
with, along with the
read/write bit.
DATA TRANSMISSION
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
slave leaves the SDA line
high.
DATA TRANSMISSION
4. The master sends or
receives the data frame.
DATA TRANSMISSION
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.
DATA TRANSMISSION
6. To stop the data
transmission, the master
sends a stop condition to
the slave by
switching SCL high
before switching SDA
high.
I2C CONFIGURATION
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 solve 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.
I2C CONFIGURATION
• 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.
ADVANTAGES OF I2C
• Only uses two wires: A particular strength of I2C is the capability
of a microcontroller to control a network of device chips with just
two general-purpose I/O pins and software.
• Supports multiple masters and multiple slaves.
• ACK/NACK bit gives confirmation that each frame is transferred
successfully.
• Hardware is less complicated than with UARTs.
• Well known and widely used protocol.
DISADVANTAGES OF I2C
• Slower data transfer rate than SPI
• The size of the data frame is limited to 8 bits.
• More complicated hardware needed to implement
than SPI.
APPLICATIONS OF I2C
• Appropriate for peripherals where simplicity and low
manufacturing cost are more important than speed.
Common applications of the I2C bus are:
• Describing connectable devices via small ROM
configuration tables to enable plug and play operation,
such as in Serial Presence Detect (SPD) EEPROMs
on dual in-line memory modules (DIMMs), and Extended
Display Identification Data (EDID) for monitors
via VGA, DVI and HDMI connectors.
• System management for PC systems via SMBus.
• Accessing real-time clocks and NVRAM chips that keep
user settings.
APPLICATIONS OF I2C
• Accessing low-speed DACs and ADCs.
• Changing contrast, hue, and color balance settings in
monitors (via Display Data Channel ).
• Changing sound volume in intelligent speakers.
• Controlling small (e.g. feature phone) OLED or LCD
displays.
• Reading hardware monitors and diagnostic sensors, e.g.
a fan's speed.
• Turning on and turning off the power supply of system
components.
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy