Skip to main content

I2C Protocol Fundamentals

I2C Protocol Fundamentals


Understanding the Two-Wire Interface

Part 1 of 5: SystemVerilog I2C Master Design

What is I2C?

I2C (Inter-Integrated Circuit) is a synchronous, two-wire serial communication protocol designed by Philips (now NXP) for low-speed, short-distance communication between chips. It's one of the most widely used bus protocols in embedded systems, IoT devices, and semiconductor testing.

Why I2C? Uses only two wires (SCL = clock, SDA = data) with pull-up resistors to manage multiple masters and slaves on the same bus. Simple, flexible, and proven in production for decades.

Common I2C Applications

  • Microcontroller communication: MCU to sensor (temperature, humidity, pressure)
  • Audio/Video: HDMI/DDC, display control interfaces
  • Power Management: Battery management systems, voltage monitors
  • Memory access: EEPROM read/write
  • FPGA/ASIC testing: Boundary scan, test data loading

Physical Layer: Pull-up Logic

I2C uses an open-drain (open-collector) output architecture. Each device drives the line LOW or releases it (HIGH-impedance).

Pull-up Resistor Circuit (Simplified):
Vdd
|
R (4.7k–10k ohm)
|
SCL/SDA ––┬––
|
[NMOS] (device drives LOW)
|
GND

How It Works

  • IDLE state (line = HIGH): All devices release their output (high-impedance). The pull-up resistor pulls the line to Vdd.
  • ACTIVE drive (line = LOW): A device activates its NMOS transistor to ground the line.
  • Bus arbitration: If two devices try to drive the line, the one pulling it LOW wins. This enables collision detection.
Simulation Tip: In testbenches, model pull-ups as: assign scl = (scl_out==0) ? 0 : 1; This mimics the wired-AND behavior without explicit resistor models.

Key Bus Conditions

1. START Condition

Initiates communication. Master pulls SDA LOW while SCL is HIGH.

SCL: ________
SDA: ‾‾‾‾\___ ← START
↑
Transition

Significance: Wakes slave devices; all slaves latch their bus and prepare to listen.

2. STOP Condition

Terminates communication. Master releases SDA while SCL is HIGH.

SCL: ________
SDA: ____/‾‾‾ ← STOP
↑
Transition

Significance: Releases bus; all slaves return to idle listening mode.

3. Repeated START

Master sends START without sending STOP first. Used for multi-phase transactions (e.g., write address, then read data without releasing the bus).

SCL: _|‾|_|‾|___
SDA: ‾\___/‾‾‾ ← Sr
↑ ↑
Start Repeat

4. ACK (Acknowledge)

Receiver pulls SDA LOW during the 9th clock pulse to confirm receipt of a byte.

Bits: 1-7 (data) 9
SDA: ‾‾\__/‾‾\__ ← ACK
SCL: _|‾|_|‾|_ ← 9 pulses

5. NACK (No Acknowledge)

Receiver releases SDA (stays HIGH) during the 9th clock pulse, signaling it cannot/will not receive more data.

Critical Difference: ACK = SDA pulled LOW by receiver during clock pulse 9. NACK = SDA released (stays HIGH) during clock pulse 9. Master uses NACK to signal end of read transaction.

7-bit Addressing Scheme

The first byte after START contains the slave address (7 bits) + R/W flag (1 bit).

[A6] [A5] [A4] [A3] [A2] [A1] [A0] [R/W]
Slave Address (7 bits) 0=Write
1=Read

Example: Addressing Slave at 0x50

Operation First Byte Sent Hex
Write to 0x50 0101_0000 0xA0
Read from 0x50 0101_0001 0xA1

Address Space

  • 0x00 – 0x07: Reserved (general call, START byte, CBUS, etc.)
  • 0x08 – 0x77: General-purpose slave addresses (112 usable addresses)
  • 0x78 – 0x7F: Reserved (10-bit addressing, future expansion)

Timing Requirements

Standard Modes

Mode Speed SCL Period Use Case
Standard 100 kHz 10 µs Legacy devices, general-purpose I/O
Fast 400 kHz 2.5 µs Modern sensors, displays
Fast+ 1 MHz 1 µs High-bandwidth applications (rare)

Key Timing Parameters (Standard Mode @ 100 kHz)

  • tLOW: SCL LOW time = 4.7 µs (minimum)
  • tHIGH: SCL HIGH time = 4.0 µs (minimum)
  • tSU (SDA): SDA setup time before SCL rise = 250 ns
  • tHD (SDA): SDA hold time after SCL fall = 300 ns
  • tRISE: Signal rise time (pull-up dependent) = 1000 ns (max)
SystemVerilog Modeling: For a 10 MHz system clock with 100 kHz I2C: CLK_DIV_100K = 50 (generates 100 kHz SCL) For 400 kHz: CLK_DIV_400K = 12.5 ≈ 12

Key Takeaways

  • I2C is a two-wire, synchronous protocol using open-drain outputs and pull-up resistors.
  • START, STOP, and Repeated START are defined by specific SDA transitions while SCL is HIGH.
  • ACK/NACK is signaled by the receiver on the 9th clock pulse.
  • 7-bit addressing with R/W flag enables up to 112 slave devices per bus.
  • Timing constraints are tight; simulators must account for clock dividers and setup/hold times.
  • Multiple speed modes (100 kHz, 400 kHz, 1 MHz) coexist on the same bus.

What's Next?

In Part 2, we'll dive into the I2C Master Controller FSM—how to design the 6-state machine that generates START, STOP, data transmission, and ACK handling in SystemVerilog.

Ready to design the master controller? Check back tomorrow!

About the author: Upalparna is a VLSI engineer and design verification specialist with expertise in functional verification, UVM testbenches, and protocol design. She runs The Silicon Stack, a VLSI education platform, and teaches embedded systems and semiconductor design.

Questions or feedback? Drop a comment below or connect on LinkedIn.

Series Navigation:
Part 1: Protocol Fundamentals (You are here) →
Part 2: Master Controller FSM
Part 3: Slave Responder & Pull-up Logic
Part 4: Testbench Design & Test Cases
Part 5: Interview Prep & Optimization

Comments

Popular posts from this blog

Module 1 — SystemVerilog Basics

VLSI Verification  •  SystemVerilog Series Module 1 — SystemVerilog Basics A complete, example-driven walkthrough of SystemVerilog fundamentals: data types, variables vs nets, arrays of every flavor, strings, enums, structs, unions, and typedef — the building blocks every verification engineer needs before UVM. 🧩 Beginner → Intermediate ⏱ ~25 min read 💻 Code Examples Included 📑 Table of Contents Introduction to SystemVerilog Verilog vs SystemVerilog Data Types: 2-State vs 4-State Logic Variables and Nets Arrays: Packed vs Unpacked Dynamic Arrays Queues Associative Arrays Strings Enumerations Structures Unions Typedef 1 Introduction to SystemVerilog SystemVerilog (IEEE 1800) is a unified hardware description and verification language (HDVL). It extends Verilog (IEEE 1364) with powerful constructs for design (interfaces, always_comb/always_ff, enhanced d...

Clock Domain Crossing (CDC): A Complete Beginner's Guide to Metastability, Synchronizers & Safe Data Transfer

Clock Domain Crossing (CDC): A Complete Beginner's Guide to Metastability, Synchronizers & Safe Data Transfer Modern System-on-Chip (SoC) designs rarely operate with a single clock. Instead, different modules such as CPUs, GPUs, memory controllers, communication interfaces, and peripherals often run at different clock frequencies or even use completely independent clock sources . When data moves from one clock domain to another, timing uncertainty can cause serious problems such as metastability , data corruption , and unpredictable system behaviour . This challenge is known as Clock Domain Crossing (CDC) . CDC is one of the most important topics in ASIC Design , RTL Design , ASIC Verification , FPGA Design , and SoC Architecture . Every modern chip—from smartphones to automotive processors—uses CDC techniques to ensure reliable communication between multiple clock domains. In this article, we'll explore CDC fundamentals, metastability, synchronization techniques, asynchro...

GPU Memory System & Interconnect: How Data Travels Inside a Modern GPU

GPU Memory System & Interconnect: How Data Travels Inside a Modern GPU Modern GPUs deliver incredible computing power by processing thousands of operations simultaneously. While compute cores often receive the spotlight, the real performance of a GPU depends heavily on how efficiently data moves between memory and compute units. A GPU memory system is designed to provide extremely high bandwidth while keeping latency as low as possible. This is achieved through a collection of specialized hardware components working together, including the Memory Controller, HBM/GDDR memory, Crossbar, Network-on-Chip (NoC), DMA Engine, PCIe Interface, and NVLink. In this article, we'll explore each component in detail and understand how they collectively enable high-performance parallel computing. Why Does GPU Memory Matter? Every GPU application—from gaming and graphics rendering to AI model training and scientific simulations—requires continuous movement of enormous amounts of data. For examp...

AXI Verification Interview Questions and Real-World Debugging

AMBA Protocol Series · Part 10 of 10 AXI Verification Interview Questions and Real-World Debugging Common protocol violations, how to read them off a waveform, and a curated set of interview questions with concise, correct answers — the capstone of the core 10-day series. AMBA Protocol Series: From APB & AHB to AXI — A Complete Guide for VLSI Engineers This wraps up the core 10-day series. Everything here draws directly on Days 1–9 — if any answer below feels unfamiliar, that's a good signal for which earlier post to revisit. (If you want to go further, see the 20-day extended list at the end of this post.) In This Article Common Protocol Violations Debugging From a Waveform Interview Questions and Answers Series Recap Extending the Series 1. Common Protocol Violations VALID deasserted before handshake — a source drops VALID before READY ever went high (violates the Day 8 stabi...

Timing Basics in Static Timing Analysis (STA): Delay Models, Sequential Timing, and Wire Delays

Timing Basics in Static Timing Analysis (STA) Static Timing Analysis (STA) is one of the most important verification techniques used in modern VLSI design. Before a chip is manufactured, engineers must verify that every signal reaches its destination within the required clock period. Even if a design passes functional simulation, it may still fail after fabrication because of timing violations. Unlike simulation, Static Timing Analysis mathematically analyzes every timing path without applying input test vectors. This makes STA significantly faster and capable of analyzing millions of timing paths efficiently. Table of Contents What is Static Timing Analysis? Why STA is Required Propagation Delay Contamination Delay Cell Delay Models Combinational Gate Delay Sequential Timing Setup Time Hold Time Wire Delay RC Delay Model PVT Corners Worked Examples Interview Questions Key Takeaways What is Static Timing Analysis? Static Ti...

Cache Basics and Cache Mapping Techniques

  Cache Basics and Cache Mapping Techniques  Modern processors execute billions of instructions every second. However, processor speed has increased much faster than main memory (RAM) speed. This difference, known as the memory wall , creates a performance bottleneck because the CPU often has to wait for data from slower memory. To solve this problem, computer systems use cache memory —a small, high-speed memory located between the CPU and the main memory. In this article, we will understand the fundamentals of cache memory, the principle of locality, cache organization, and the three major cache mapping techniques. What is Cache Memory? Cache memory is a small, high-speed memory that stores copies of frequently accessed data from the main memory. Since accessing cache is much faster than accessing RAM, the CPU first checks whether the required data is available in the cache. If the data is found in the cache, it is called a cache hit . Otherwise, the CPU fetches the dat...

CMOS Power & Scaling Explained: Dynamic Power, Leakage Power, Short-Circuit Power & Technology Scaling

  CMOS Power & Scaling Explained: Dynamic Power, Leakage Power, Short-Circuit Power & Technology Scaling Day 6 | CMOS Design Fundamentals | The Silicon Stack As integrated circuits continue to become smaller, faster, and more powerful, power consumption has emerged as one of the biggest challenges in modern VLSI design. While early digital circuits primarily focused on functionality and speed, today's processors, AI accelerators, smartphones, and IoT devices must deliver high performance while operating within strict power and thermal limits. A modern System-on-Chip (SoC) may contain billions of CMOS transistors , each switching billions of times per second. Even a tiny amount of power consumed by each transistor adds up to significant energy consumption across the entire chip. Excessive power not only drains batteries but also generates heat, reduces reliability, and limits performance. Understanding where CMOS power comes from and how it can be reduced is therefore ...