📔
Notes
  • Embedded systems
    • GPIO concepts
    • 📈SPI protocol
    • 📈I2C Protocol
    • 📈UART Protocol
    • 📈CAN Protocol
    • 📈DMA
  • FreeRTOS / RTOS
    • Basics
    • Stm32 FreeRTOS setup
  • Interview Questions
    • Basic C
    • Electronics / mcu
  • Hardware design
  • C programming
  • C++ programming
    • Basics
  • Data structure and Algorithms
    • Data Structures in C
  • Design Patterns
  • Algorithms
  • OS concepts
  • VLSI
  • DSP
  • Motors and sensors
    • BLDC motor
  • Important/ intersting documents
Powered by GitBook
On this page
  • Introduction
  • configuration / connection
  • Details
  • Arbitration / handling multiple slaves from collision
  • Usage and limitations
  • References:
  1. Embedded systems

I2C Protocol

Notes on I2C prorocol

PreviousSPI protocolNextUART Protocol

Last updated 2 years ago

Introduction

  • Multi master multi slave communication , 128 devices maximum because of the data frame having a fixed bits for addresses

  • Maximum of 3mbps , synchronous data transfer protocol

  • has start and stop conditions , and a data frame format

configuration / connection

  • Multi master multi slave

  • SDA - Data line , SCL - Serial clock

  • Open drain / open collector configuration / pull up pull down is required

  • In open drain (above image) a pull up resistor is used for idle state and pulled low when required

  • uses 4.7kohm resisitor typically

Details

Communication:

  • start condition : SDA is pulled low keeping scl (clk) high (idle)

  • Master sends 7 bit (0-127) slave address first with read/write and waits for ACK/NACK from slave

  • slave pulls sda low to indicate ACK

  • Master sends or recieves a data frame 8 bit waits for ack or nack

  • slave ACK once recieved

  • Master stop condition is issued: SDA is high before SCL

Arbitration / handling multiple slaves from collision

  • In Multi master configuration SDA is monitored and if its low then devices wont send data

Usage and limitations

  • As the name suggests its a very low speed communication meant for chip to chip in a pcb

  • used in sensors , eeprom etc

  • 400kbps in the fast mode

References:

📈
TI i2c explanation
SPI vs I2C Protocol Differences and Things to ConsiderSaleae Articles
I2C Primer: What is I2C? (Part 1) | Analog Devices
Logo
Basics of the I2C Communication ProtocolCircuit Basics
I2C connection
Logo
Logo