SlideShare a Scribd company logo
1 of 21
I2C bus
Inter Integrated circuit bus
Written By:- Rishu
History
• When connecting multiple devices to a microcontroller, the
address and data lines of each device were conventionally
connected individually. This would take up precious pins on
the microcontroller, result in a lot of traces on the PCB, and
require more components to connect everything together.
This made these systems expensive to produce and
susceptible to interference and noise.
• To solve this problem, Philips developed Inter-IC bus, or I2C,
in the 1980s. I2C is a low-bandwidth, short distance protocol
for on board communications. All devices are connected
through two wires: serial data (SDA) and serial clock (SCL).
Overview
 Used for moving data simply and quickly from one
device to another
 Serial Interface
 Synchronous
 Bidirectional
Overview
 I2C is a Synchronous protocol
 The data is clocked along with a clock signal(SCL).
 The clock signal controls when data is changed and when it
should be read.
 Since I2C is synchronous, the clock rate can vary, unlike
asynchronous (RS-232 style) communications.
Overview
 I2C is a Master-Slave protocol
 The Master device controls the clock (SCL).
 The slave devices may hold the clock low to prevent data
transfer.
 No data is transferred unless a clock signal is present.
 All slaves are controlled by the master clock
Overview
 I2C is a Bidirectional protocol
 Data is sent either direction on the serial data line (SDA)
by the master or slave.
Overview
 I2C is a Serial Interface of only two signals:
 SDA Serial Data
This line transfers data to or from the master.
 SCL Serial Clock
This controls when data is sent and when it is read.
The master controls SCK.
Features
I2C has many important features worth mentioning
• It supports multiple data speeds:
- standard (100 kbps)
- fast (400 kbps)
- high speed (3.4 Mbps) communications.
• Built in collision detection
• 7 bit or 10-bit unique Addressing
• Multi-master support (arbitration)
• Data broadcast (general call).
• two-wired bus
• data transfers: serial, 8-bit oriented, bi-directional
• master/slave relationships with multi-master option (arbitration)
• master can operate as transmitter or receiver
• device count limit: max. capacitance 400 pF
Sample I2C implementation
• Regardless of how many slave units are attached to the I2C bus,
there are only two signals connected to all of them
• All devices must have a unique address to identify it on the bus.
• Slave devices have a predefined address, but the lower bits of
the address can be assigned to allow for multiples of the same
devices on the bus.
Theory of operation
I2C has a master/slave protocol. The master initiates the
communication. The sequence of events are
1. The Master device issues a start condition. This condition
informs all the slave devices to listen on the serial data
line for instructions.
2. The Master device sends the address of the target slave
device and a read/write flag.
3. The Slave device with the matching address responds with
an acknowledgement signal .
4. Communication proceeds between the Master and the
Slave on the data bus. Both the master and slave can
receive or transmit data depending on whether the
communication is a read or write. The transmitter sends 8-
bits of data to the receiver which replies with a 1-bit
acknowledgment
5. When the communication is complete, the master issues a
stop condition indicating that everything is done
Standard Mode Wires And Signal
 Two-wired bus
– serial data line (SDA)
– serial clock line (SCL)
• Voltage levels
– HIGH 1
– LOW 0
– not fixed, depends on associated level of voltage
• Bit transfer (level triggered)
– SCL = 1 SDA = valid data
– one clock pulse per data bit
– stable data during high clocks
– data change during clocks low
Wired-AND connection
 bus is free SDA and SCL are high
– by pull-up resistors
 device output is ANDed with signal on bus
Frame
start condition (S)
– SDA 10 transition when SCL = 1
• stop condition (P)
– SDA 01 transition when SCL = 1
• repeated start (Sr)
– start is generated instead of stop
• bus state
– busy … after S and before next P
– free … after P and before next S
Masters and Slaves
• Master device
– controls the SCL
– starts and stops data transfer
– controls addressing of other devices
• Slave device
– device addressed by master
• Transmitter/Receiver
– master or slave
– master-transmitter sends data to slave-recevier
– master-receiver requires data from slave-transmitter
Data Transfer
data bits are transferred after start condition
• transmission is byte oriented
• byte = 8 bits + one acknowledge bit
• most significant bit (MSB) first
• slave address is also datum
– first byte transferred
– during the first byte transfer:
master is transmitter
addressed slave is receiver
– next bytes: depends on the last bit in address byte
Data Transfer - SCL
• master sets SCL = 0 and generates pulse for each data bit
• 8 pulses for data bits are followed by one pulse for ack. bit
• after ack.
– master tries to generate next byte’s first pulse
– slave can hold SCL low master switches to wait state
Data Transfer - SDA
• data bits are generated by transmitter as SCL pulses
• 9-th pulse:
– transmitter releases SDA
– receiver must hold SDA low in order to ack. received data
– slave must release SDA after ack. bit (allows master to end frame)
Multiple Masters
 More bus controllers can be connected
 Several masters can start frame at once
 Synchronization needed on SCL
 Arbitration needed on SDA
 Using wired-AND connection to SCL/SDA
Addressing by 7 bits
• the first byte transmitted by master:
– 7 bits: address
– 1 bit: direction (R/W)
0 … master writes data (W), becomes transmitter
1 … master reads data (R), becomes receiver
• data transfer terminated by stop condition
• master may generate repeated start and address another device
• each device listens to address
– address matches its own device switches state according to R/W bit
• address = fixed part + programmable part
– fixed part assigned by I2C committee
Frame Formats
master-transmitter
master-receiver (since second byte)
Benefits and Drawbacks
• Only two wires are required
• I2C is well suited for boards with many devices connected on
the bus.
• Reduce the cost and complexity of the circuit as additional
devices are added to the system.
• Due to the presence of only two wires, there is additional
complexity in handling the overhead of addressing and
acknowledgments .
• This can be inefficient in simple configurations and a direct-
link interface such as SPI might be preferred.

More Related Content

What's hot

Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceAnurag Tomar
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolAnkur Soni
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Dhaval Kaneria
 
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C ImplementationMIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C ImplementationMIPI Alliance
 
Spi master core verification
Spi master core verificationSpi master core verification
Spi master core verificationMaulik Suthar
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontrollerSiva Kumar
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolAditya Porwal
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfacesanishgoel
 

What's hot (20)

I2 c protocol
I2 c protocolI2 c protocol
I2 c protocol
 
I2C BUS PROTOCOL
I2C BUS PROTOCOLI2C BUS PROTOCOL
I2C BUS PROTOCOL
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
UART
UARTUART
UART
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
 
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C ImplementationMIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
 
Uart
UartUart
Uart
 
Spi master core verification
Spi master core verificationSpi master core verification
Spi master core verification
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
I2C
I2CI2C
I2C
 
Uart
UartUart
Uart
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
axi protocol
axi protocolaxi protocol
axi protocol
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
SPI Protocol in LPC2148
SPI  Protocol in LPC2148SPI  Protocol in LPC2148
SPI Protocol in LPC2148
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfaces
 

Similar to I2C Protocol

communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemsRaghunath reddy
 
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)PREMAL GAJJAR
 
I2C BUS
I2C BUSI2C BUS
I2C BUSp_ayal
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsMohamed Abdallah
 
UNI T 6- SPI_I2C_Lecture8.pptx
UNI                    T 6- SPI_I2C_Lecture8.pptxUNI                    T 6- SPI_I2C_Lecture8.pptx
UNI T 6- SPI_I2C_Lecture8.pptxnaveen088888
 
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay DeshmukhI2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay DeshmukhTejas Shetye
 
Inter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocolInter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocolRevathi Subramaniam
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networkingArul Kumar
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptxSKUP1
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingBhargav Kakadiya
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptxsauryakumar3
 
USART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaUSART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaPallav Shukla
 
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOL
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOLINTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOL
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOLkarimzidan7474
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLIJMER
 

Similar to I2C Protocol (20)

communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
I2C PRESENTATION.PPT
I2C PRESENTATION.PPTI2C PRESENTATION.PPT
I2C PRESENTATION.PPT
 
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)
 
I2C BUS
I2C BUSI2C BUS
I2C BUS
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
 
COM_BASIC.pptx
COM_BASIC.pptxCOM_BASIC.pptx
COM_BASIC.pptx
 
I2 c bus
I2 c busI2 c bus
I2 c bus
 
UNI T 6- SPI_I2C_Lecture8.pptx
UNI                    T 6- SPI_I2C_Lecture8.pptxUNI                    T 6- SPI_I2C_Lecture8.pptx
UNI T 6- SPI_I2C_Lecture8.pptx
 
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay DeshmukhI2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
 
Inter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocolInter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocol
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacing
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptx
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
USART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaUSART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav Shukla
 
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOL
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOLINTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOL
INTRODUCTION TO INTER INTEGRATED CIRCUIT PROTOCOL
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDL
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

I2C Protocol

  • 1. I2C bus Inter Integrated circuit bus Written By:- Rishu
  • 2. History • When connecting multiple devices to a microcontroller, the address and data lines of each device were conventionally connected individually. This would take up precious pins on the microcontroller, result in a lot of traces on the PCB, and require more components to connect everything together. This made these systems expensive to produce and susceptible to interference and noise. • To solve this problem, Philips developed Inter-IC bus, or I2C, in the 1980s. I2C is a low-bandwidth, short distance protocol for on board communications. All devices are connected through two wires: serial data (SDA) and serial clock (SCL).
  • 3. Overview  Used for moving data simply and quickly from one device to another  Serial Interface  Synchronous  Bidirectional
  • 4. Overview  I2C is a Synchronous protocol  The data is clocked along with a clock signal(SCL).  The clock signal controls when data is changed and when it should be read.  Since I2C is synchronous, the clock rate can vary, unlike asynchronous (RS-232 style) communications.
  • 5. Overview  I2C is a Master-Slave protocol  The Master device controls the clock (SCL).  The slave devices may hold the clock low to prevent data transfer.  No data is transferred unless a clock signal is present.  All slaves are controlled by the master clock
  • 6. Overview  I2C is a Bidirectional protocol  Data is sent either direction on the serial data line (SDA) by the master or slave.
  • 7. Overview  I2C is a Serial Interface of only two signals:  SDA Serial Data This line transfers data to or from the master.  SCL Serial Clock This controls when data is sent and when it is read. The master controls SCK.
  • 8. Features I2C has many important features worth mentioning • It supports multiple data speeds: - standard (100 kbps) - fast (400 kbps) - high speed (3.4 Mbps) communications. • Built in collision detection • 7 bit or 10-bit unique Addressing • Multi-master support (arbitration) • Data broadcast (general call). • two-wired bus • data transfers: serial, 8-bit oriented, bi-directional • master/slave relationships with multi-master option (arbitration) • master can operate as transmitter or receiver • device count limit: max. capacitance 400 pF
  • 9. Sample I2C implementation • Regardless of how many slave units are attached to the I2C bus, there are only two signals connected to all of them • All devices must have a unique address to identify it on the bus. • Slave devices have a predefined address, but the lower bits of the address can be assigned to allow for multiples of the same devices on the bus.
  • 10. Theory of operation I2C has a master/slave protocol. The master initiates the communication. The sequence of events are 1. The Master device issues a start condition. This condition informs all the slave devices to listen on the serial data line for instructions. 2. The Master device sends the address of the target slave device and a read/write flag. 3. The Slave device with the matching address responds with an acknowledgement signal . 4. Communication proceeds between the Master and the Slave on the data bus. Both the master and slave can receive or transmit data depending on whether the communication is a read or write. The transmitter sends 8- bits of data to the receiver which replies with a 1-bit acknowledgment 5. When the communication is complete, the master issues a stop condition indicating that everything is done
  • 11. Standard Mode Wires And Signal  Two-wired bus – serial data line (SDA) – serial clock line (SCL) • Voltage levels – HIGH 1 – LOW 0 – not fixed, depends on associated level of voltage • Bit transfer (level triggered) – SCL = 1 SDA = valid data – one clock pulse per data bit – stable data during high clocks – data change during clocks low
  • 12. Wired-AND connection  bus is free SDA and SCL are high – by pull-up resistors  device output is ANDed with signal on bus
  • 13. Frame start condition (S) – SDA 10 transition when SCL = 1 • stop condition (P) – SDA 01 transition when SCL = 1 • repeated start (Sr) – start is generated instead of stop • bus state – busy … after S and before next P – free … after P and before next S
  • 14. Masters and Slaves • Master device – controls the SCL – starts and stops data transfer – controls addressing of other devices • Slave device – device addressed by master • Transmitter/Receiver – master or slave – master-transmitter sends data to slave-recevier – master-receiver requires data from slave-transmitter
  • 15. Data Transfer data bits are transferred after start condition • transmission is byte oriented • byte = 8 bits + one acknowledge bit • most significant bit (MSB) first • slave address is also datum – first byte transferred – during the first byte transfer: master is transmitter addressed slave is receiver – next bytes: depends on the last bit in address byte
  • 16. Data Transfer - SCL • master sets SCL = 0 and generates pulse for each data bit • 8 pulses for data bits are followed by one pulse for ack. bit • after ack. – master tries to generate next byte’s first pulse – slave can hold SCL low master switches to wait state
  • 17. Data Transfer - SDA • data bits are generated by transmitter as SCL pulses • 9-th pulse: – transmitter releases SDA – receiver must hold SDA low in order to ack. received data – slave must release SDA after ack. bit (allows master to end frame)
  • 18. Multiple Masters  More bus controllers can be connected  Several masters can start frame at once  Synchronization needed on SCL  Arbitration needed on SDA  Using wired-AND connection to SCL/SDA
  • 19. Addressing by 7 bits • the first byte transmitted by master: – 7 bits: address – 1 bit: direction (R/W) 0 … master writes data (W), becomes transmitter 1 … master reads data (R), becomes receiver • data transfer terminated by stop condition • master may generate repeated start and address another device • each device listens to address – address matches its own device switches state according to R/W bit • address = fixed part + programmable part – fixed part assigned by I2C committee
  • 21. Benefits and Drawbacks • Only two wires are required • I2C is well suited for boards with many devices connected on the bus. • Reduce the cost and complexity of the circuit as additional devices are added to the system. • Due to the presence of only two wires, there is additional complexity in handling the overhead of addressing and acknowledgments . • This can be inefficient in simple configurations and a direct- link interface such as SPI might be preferred.