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 (20)

SPI Bus Protocol
SPI Bus ProtocolSPI Bus Protocol
SPI Bus Protocol
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
Uart
UartUart
Uart
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Communication protocols
Communication protocolsCommunication protocols
Communication protocols
 
Rs232 485 fundamental
Rs232 485 fundamentalRs232 485 fundamental
Rs232 485 fundamental
 
UART
UARTUART
UART
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
I2 c protocol
I2 c protocolI2 c protocol
I2 c protocol
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
I2 c
I2 cI2 c
I2 c
 
UART
UARTUART
UART
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Unit II Arm 7 Introduction
Unit II Arm 7 IntroductionUnit II Arm 7 Introduction
Unit II Arm 7 Introduction
 
8251 USART
8251 USART8251 USART
8251 USART
 

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
 

More from Anurag Tomar

Network interface card(nic)
Network interface card(nic)Network interface card(nic)
Network interface card(nic)Anurag Tomar
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceAnurag Tomar
 
Valgrind debugger Tutorial
Valgrind debugger TutorialValgrind debugger Tutorial
Valgrind debugger TutorialAnurag Tomar
 
Software development process basic
Software development process basicSoftware development process basic
Software development process basicAnurag Tomar
 
Socket programming
Socket programmingSocket programming
Socket programmingAnurag Tomar
 

More from Anurag Tomar (6)

Network interface card(nic)
Network interface card(nic)Network interface card(nic)
Network interface card(nic)
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
Valgrind debugger Tutorial
Valgrind debugger TutorialValgrind debugger Tutorial
Valgrind debugger Tutorial
 
Software development process basic
Software development process basicSoftware development process basic
Software development process basic
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
Socket programming
Socket programmingSocket programming
Socket programming
 

Recently uploaded

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

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.