What You'll Learn
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.
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).
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.
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.
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.
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).
SDA: ‾\___/‾‾‾ ← Sr
↑ ↑
Start Repeat
4. ACK (Acknowledge)
Receiver pulls SDA LOW during the 9th clock pulse to confirm receipt of a byte.
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.
7-bit Addressing Scheme
The first byte after START contains the slave address (7 bits) + R/W flag (1 bit).
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)
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.
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
Post a Comment