Home | Projects | Notes > MCU Peripheral Drivers > Introduction to I2C

Introduction to I2C

 

Inter-Integrated Circuit (I2C) Protocol

 

I2C Terminology

 

Difference Between SPI and I2C

 

i2c-2-pins

 

 

SDA & SCL Signals

 

i2c-pin-configuration

 

 

I2C Modes

ModeData RateNotes
Standard modeUp to 100 KbpsSupported by STM32F4xx
Fast modeUp to 400 KbpsSupported by STM32F4xx
Fast mode +Up to 1MbpsSupported by some STM32F4xx (check the reference manual)
High speed modeUp to 3.4 MbpsNot supported by STM32F4xx

bps: bits per second

Standard Mode

Fast Mode

 

I2C Protocol

 

i2c-protocol-sda

 

START & STOP Conditions

 

i2c-bus-protocol

 

ACK

 

i2c-ack-nack

 

Data Validity

Good source of interview question!

 

i2c-data-validity

 

Repeated START

I2C Protocol Example

 

i2c-bus-protocol-2

 

 

Block Diagram

 

i2c-block-diagram

 

 

I2C Serial Clock (SCL) Control Settings

 

 

Clock Stretching

 

Pull-Up Resistance (Rp) Calculation

 

 

i2c-characteristics-of-the-sda-and-scl-io-stages

 

i2c-characteristics-of-the-sda-and-scl-bus-lines-for-standard-fast-and-fast-mode-plus-i2c-bus-devices

 

Rise (tr) and Fall (tf) Times

 

i2c-high-pull-up-resistance-issue

 

 

I2C Bus Capacitance (Cb)

Exercise

 

 

I2C Master & Slave

Services Provided by I2C Master & Slave

Master

 

Slave

 

 

 

I2C Interrupts

 

i2c-interrupt-requests

 

i2c-interrupt-mapping-diagram

 

 

I2C ISR Handling

 

I2C Errors

I2C driver should be able to catch the following errors and notify the application. Then, it is the application's reponsibility to take necessary action.