I²C moves bytes between one or more controllers and many targets over two open-drain wires, SCL (clock) and SDA (data). Everything about the bus follows from that physical choice: the pull-up resistors, the slow rising edges, the wired-AND that makes ACK, clock stretching and arbitration possible, and the timing rules that keep a data change from being mistaken for a START or STOP. This page builds the bus up from the transistor, then walks real transactions bit by bit.
Terminology follows the current NXP specification and TI's guide: controller (formerly master) and target (formerly slave). Primary references: NXP UM10204 Rev. 7 [1] and TI SBAA565, A Basic Guide to I2C [2], whose DAC80501 and ADS1115 transactions are the worked examples below.
Philips introduced I²C in 1982 for talking between chips on one board; it has been licence-free since 2006 [2]. It trades speed for wiring: two lines serve any number of devices, each with a 7-bit (or 10-bit) address, and the same bus carries writes, reads, acknowledgements and flow control. Typical users are sensors, EEPROMs, PMICs, DAC/ADC configuration, camera and display control, fan controllers and board-management telemetry.
| Mode | Max bit rate | Max tr (30→70 %) | Max Cb | Sink current at VOL | Notes |
|---|---|---|---|---|---|
| Standard-mode (Sm) | 100 kbit/s | 1000 ns | 400 pF | 3 mA @ 0.4 V | The original bus |
| Fast-mode (Fm) | 400 kbit/s | 300 ns | 400 pF | 3 mA @ 0.4 V (6 mA @ 0.6 V) | Adds 50 ns spike filter, input hysteresis, minimum fall time |
| Fast-mode Plus (Fm+) | 1 Mbit/s | 120 ns | 550 pF | 20 mA @ 0.4 V | Stronger drivers allow small Rp |
| High-speed (Hs) | 3.4 Mbit/s | 10–80 ns | 100–400 pF | — | Entered with a controller code; current-source pull-up on SCL |
| Ultra Fast-mode (UFm) | 5 Mbit/s | — | — | push-pull | Write-only, no ACK; a different bus in practice |
Each SDA and SCL pin contains an NMOS pull-down and a Schmitt-trigger input. Turning the NMOS on drives the line low; turning it off releases it, and the pull-up resistor Rp charges the line high. No device ever drives a line high. The line is therefore low if any device pulls it low and high only when all release it: a wired-AND.
That one property is what makes the protocol work. A target acknowledges by pulling SDA low during the ninth clock; a slow target stretches the clock by holding SCL low; two controllers can start together and sort out who wins without damage. A push-pull bus (SPI, for example) cannot do any of this, because two drivers fighting each other short the supply [2].
Rise is an RC exponential: \(V(t)=V_{\text{DD}}(1-e^{-\text{t}/\text{R}_{\text{p}}\text{C}_{\text{b}}})\). Slow, and set by the board, not by the chip.
Fall is set by the driver's sink current, typically 10–50 ns. Fast and clean, which is why I²C waveforms look like sawteeth with sharp falls and rounded rises.
Rp has a floor and a ceiling [2][3]. The floor comes from the drivers: the weakest device must be able to pull the line below VOL while sinking the pull-up current. The ceiling comes from the rise-time limit, which the specification measures between 30 % and 70 % of VDD.
For the ceiling, the line crosses 0.3·VDD at \(t_{1}=-RC\cdot \ln 0.7=0.3567\cdot RC\) and 0.7·VDD at \(t_{2}=-RC\cdot \ln 0.3=1.2040\cdot RC\), so
Worked numbers. A Fast-mode bus at 3.3 V with three devices and 15 cm of trace has roughly 3 × 10 pF + 15 pF trace + 20 pF for the controller pin and test point ≈ 65 pF; call it 100 pF with margin. \(R_{\text{p}(\max )}=300\ \text{ns}/(0.8473\times 100\ \text{pF})=3.5\ \text{k}\Omega\), \(R_{\text{p}(\min )}=967\ \Omega\). A 2.2 kΩ pull-up gives \(t_{\text{r}}=186\ \text{ns}\) and 1.3 mA when low. The usual 1–10 kΩ range [2] is a starting point; the calculation tells you which end.
The whole protocol rests on one rule: SDA may change only while SCL is low. While SCL is high, SDA must be stable and is read as a data bit. A change of SDA while SCL is high is not data; it is a bus condition [1]:
Frames. After START, every transfer is a sequence of 9-clock frames: 8 data bits, most significant bit first, then one acknowledge bit. The first frame is the address byte: a 7-bit target address followed by the R/W bit (0 = write, 1 = read). So target 48h becomes 90h for a write and 91h for a read on the wire.
ACK and NACK. On the ninth clock the transmitter releases SDA and the receiver pulls it low (ACK) to say "byte received, continue". If SDA stays high (NACK), either no target recognised the address, the target can't accept more data, or (when the controller is receiving) the controller is telling the target that this was the last byte it wants. The controller must NACK the final byte of a read; otherwise the target would keep driving SDA and could block the STOP.
| Event | When it happens | Who acts | Why |
|---|---|---|---|
| Data launch (SDA changes) | After SCL falls, during the low period, no earlier than tHD;DAT | Transmitter (controller or target) | Gives the receiver a stable value for the whole high period |
| Data valid / sampled | SDA must be stable tSU;DAT before SCL rises and for the whole high period; receivers latch on or shortly after the rising edge | Receiver | SCL high = "the bit is now valid" |
| ACK/NACK | Driven after the 8th SCL falling edge, sampled on the 9th SCL rising edge | Receiver drives, transmitter samples | Handshake per byte |
| START / Sr | SDA falls while SCL is high | Controller | Illegal as data, so unambiguous |
| STOP | SDA rises while SCL is high | Controller | Illegal as data, so unambiguous |
| Clock stretch | Target holds SCL low after the controller releases it (any low period) | Target | Wired-AND on SCL; controller waits until it sees SCL high |
First byte 11110 A9 A8 W, then the low eight bits A7–A0, each acknowledged. For a read, write both bytes, send Sr, then repeat only the first byte with \(R=1\). Rare in practice.
Not part of I²C itself, but nearly universal: the first byte after the address is a register pointer (command byte); data follows. Many devices auto-increment the pointer after each byte, so multi-byte reads stream consecutive registers.
Every I²C transfer is built from the same few parts. Point at any part of the transaction below (or tap it on a touch screen) to see what it is, who drives SDA, which edge matters and the timing it has to meet. Click to keep a part selected, and use the arrow keys to step through. The buttons name each part and also cover things that are not in every transaction, such as clock stretching and arbitration.
Timing values are minimums or maximums for Standard-mode / Fast-mode / Fast-mode Plus, from UM10204 Table 10 [1]. The ADS1115 and DAC80501 transactions are the examples from TI SBAA565 [2], also used in §06.
The same job, reading one register from a sensor, drawn as message sequences. Solid arrows carry data from whoever is driving the line; dashed arrows are acknowledgements. I²C needs a START, the target address, a write of the register pointer, a repeated START, a second address and an acknowledgement after every byte. SPI replaces the address with a chip-select line, has no acknowledgements, and moves a byte in each direction on every 8 clocks. See the SPI primer for the waveform.
The diagram below is generated from the bytes you choose. It starts with the DAC80501 write from TI's guide [2]: the controller sets the DAC output to 1.5 V by writing the 16-bit code 4CCDh to register 08h of the target at address 49h. Select the ADS1115 presets to see a configuration write and a register read with a repeated START, where the target drives SDA.
How to read it: shading on SDA shows who is driving the line (teal for the controller, amber for the target). The number above each SCL high period is the bit the receiver samples at the dashed line, the SCL rising edge. Rising edges are drawn as RC curves because they are made by the pull-up; falling edges are steep because a transistor makes them.
On a scope the transaction is \(4\times 9=36\) clocks plus START and STOP: about 95 µs at 400 kHz for 16 bits of payload. The ADS1115 read shows the other half of the protocol: after Sr and the read address 91h, the target drives the data bits (amber) and the controller drives the ACK after the MSB and the NACK after the LSB.
All timing is referenced to the 30 % and 70 % points of VDD (the VIL and VIH limits). The figure zooms into a START, a 1, a 0, a STOP and the bus-free time before the next START.
| Symbol | Parameter | Sm | Fm | Fm+ | What it protects |
|---|---|---|---|---|---|
| fSCL | Clock frequency | 0–100 kHz | 0–400 kHz | 0–1 MHz | No minimum: I²C is fully static |
| tHD;STA | Hold after (repeated) START, before first SCL fall | ≥ 4.0 µs | ≥ 0.6 µs | ≥ 0.26 µs | Every target sees START before the clock begins |
| tLOW | SCL low period | ≥ 4.7 µs | ≥ 1.3 µs | ≥ 0.5 µs | Time for SDA to change and rise |
| tHIGH | SCL high period | ≥ 4.0 µs | ≥ 0.6 µs | ≥ 0.26 µs | Time to sample |
| tSU;STA | Setup for repeated START | ≥ 4.7 µs | ≥ 0.6 µs | ≥ 0.26 µs | SCL high long enough before Sr |
| tHD;DAT | Data hold after SCL fall | ≥ 0 ns | ≥ 0 ns | ≥ 0 ns | Plus ≥ 300 ns internal hold in transmitters (see §08) |
| tSU;DAT | Data setup before SCL rise | ≥ 250 ns | ≥ 100 ns | ≥ 50 ns | SDA settled before sampling |
| tVD;DAT, tVD;ACK | SCL low to SDA valid (data, ACK) | ≤ 3.45 µs | ≤ 0.9 µs | ≤ 0.45 µs | Transmitter is quick enough |
| tr | Rise time, 30→70 % | ≤ 1000 ns | 20–300 ns | ≤ 120 ns | Set by Rp·Cb |
| tf | Fall time, 70→30 % | ≤ 300 ns | 20·(VDD/5.5 V)–300 ns | 20·(VDD/5.5 V)–120 ns | Minimum limits EMI and ringing |
| tSU;STO | Setup for STOP | ≥ 4.0 µs | ≥ 0.6 µs | ≥ 0.26 µs | SCL high before SDA rises |
| tBUF | Bus free between STOP and START | ≥ 4.7 µs | ≥ 1.3 µs | ≥ 0.5 µs | All devices see the bus idle |
| tSP | Spike suppressed by input filter | — | 0–50 ns | 0–50 ns | Glitches and ringing ignored |
| Cb | Capacitive load per line | ≤ 400 pF | ≤ 400 pF | ≤ 550 pF | Sets Rp range |
Values from UM10204 Rev. 7, Table 10 [1]. Note that 1/(tLOW,min + tHIGH,min) is above the nominal rate (e.g. \(1/(1.3+0.6\ \text{µs})=526\ \text{kHz}\) in Fm); the frequency limit and the period limits must both be met, and real controllers usually run tLOW longer than tHIGH.
I²C is slow, so it is easy to treat it as immune to signal-integrity problems. It isn't. Its failures just look different from those of push-pull buses: they come from slow, load-dependent rising edges, very fast falling edges, and the fact that SDA and SCL are two separate RC networks that do not track each other.
When the transmitter sends a 1 it releases SDA some time after SCL falls; SDA then has to climb through the pull-up and be above VIH tSU;DAT before SCL starts to rise. That gives a budget for the low period:
For Standard- and Fast-mode the published limits close this budget exactly, which is how the specification was derived. Exceed tr and the budget goes negative: the receiver samples SDA while it is still climbing through the undefined region and reads a 0 or a 1 at random. The failures are data-dependent (only 0→1 transitions fail) and temperature-dependent, which makes them look intermittent.
SCL rises through the same kind of RC. A controller that implements clock synchronization correctly starts counting tHIGH only when it sees SCL above its own VIH, so every period grows by roughly 1.2·RpCb. A "400 kHz" bus with a 2.2 kΩ pull-up and 200 pF actually runs near 330 kHz. This is benign, but it surprises people comparing scope captures with register settings. The calculator in §03 shows the effect.
A 20 mA Fm+ driver discharging a lightly loaded line can fall in a few nanoseconds. That edge excites ringing on longer traces and cables, couples into neighbours, and radiates. Fm and Fm+ set a minimum fall time of 20 ns × (VDD/5.5 V) for this reason, and devices implement slope-controlled outputs. On a board, 33–100 Ω in series with each pin slows the edge and limits ESD current; keep it small enough that the series drop at IOL plus VOL stays below VIL at the far end.
SDA and SCL rarely have equal RpCb. SDA may connect to more pins (an extra device, a test point, a level translator), use a different pull-up, or run on a longer route. Skew matters at two points in every bit:
A fast neighbour (an SPI clock, a switching node, a motor PWM line) coupling a few-nanosecond spike onto SCL can add a clock edge; on SDA while SCL is high it can create a false START or STOP. Fm and Fm+ inputs must reject spikes shorter than 50 ns (tSP), which handles short coupled spikes and moderate ringing, but not slow ground bounce or long cable pickup. Route SDA and SCL as a pair away from aggressors with an unbroken reference plane underneath; the pair does not need length matching, because the timing margins are in hundreds of nanoseconds.
Clock stretching. A target that needs time (to fetch data, finish an EEPROM write, wake from sleep) holds SCL low after the controller releases it. Because SCL is wired-AND, the controller sees SCL still low and waits. The I²C specification sets no time limit; SMBus does (35 ms) [2]. Every controller must support stretching, but some (certain SoC hardware blocks, Raspberry Pi's older BCM2835 controller, bit-banged drivers that never read SCL back) do not, and fail with stretched targets.
Clock synchronization. With several controllers clocking at once, SCL's low period is the longest of their low periods and its high period the shortest of their high periods: each controller counts its low time from when SCL falls and its high time from when SCL actually goes high. Arbitration then happens on SDA, bit by bit. A controller that transmits a 1 but reads back a 0 has lost; it releases SDA and becomes a receiver for the rest of the transfer. The winner never sees the conflict, so no data is lost [1][2]. Lower addresses win, since 0 dominates.
Because thresholds scale with each device's own VDD, mixed-voltage buses fail in specific ways [2]:
The robust fix is a translator with separate pull-ups on each side. The classic discrete version is one N-channel MOSFET per line [4]:
PCA9306, TCA9406 and the discrete FET add almost no delay but share capacitance: both sides' Cb must be charged through whichever pull-up is active, so size Rp for the combined load. The FET's Ron adds to VOL.
TCA9517, TCA9617, PCA9515 isolate capacitance (each side gets its own 400 pF budget) and translate levels, at the cost of delay and, in some parts, a static offset on one side that forbids putting two such sides back to back.
TCA9548A-style switches connect one of several downstream segments, solving duplicate addresses (eight identical sensors) and splitting capacitance. Each downstream channel needs its own pull-ups.
Beyond a board, capacitance and noise dominate. Use differential extenders (PCA9615), current-mode buffers (P82B715) or move to a bus designed for cables (CAN, RS-485). Keep I²C off long harnesses where possible.
| Symptom | Likely cause | Check / fix |
|---|---|---|
| SDA stuck low after reset or a brown-out | Controller reset mid-read; target is still mid-byte, driving a 0 and waiting for clocks | Bus recovery: clock SCL up to 9 times until the target releases SDA, then send STOP [1]. Do this at every boot. Some targets also have a reset pin or SMBus timeout. |
| Bus pulled low or stuck when one device is powered off | Back-powering: the unpowered device's ESD diode to its VDD clamps the bus to ~0.6 V | Use parts with fail-safe (powered-off high-impedance) I/O, put the pull-ups and all devices on the same switched rail, or isolate with a switch/buffer. |
| Every address NACKs | Wrong address format (8-bit vs 7-bit confusion: a datasheet's "0x90" means 48h), missing pull-ups, device in reset, wrong supply | Scope SDA and SCL; check idle level is VDD. Shift datasheet 8-bit addresses right by one. |
| Intermittent wrong bits, mostly 0→1 | Rise time too slow for the clock rate (too much Cb or Rp) | Measure 30→70 % rise; recompute Rp; lower fSCL. |
| False START/STOP, transfers abort | Hold-time violation at SCL falling edge; glitch on SDA during SCL high; crosstalk | Verify ≥ 300 ns data hold; look for ringing on SCL falls; add series R; reroute. |
| Two devices ACK the same address | Address strap collision | Re-strap or use a switch/mux. |
| Transfers hang with a particular target | Controller doesn't support clock stretching | Check the controller's SCL readback; use a hardware controller or a different target mode. |
| VOL sits at 0.5–0.8 V | Rp too small for the sink current, or a buffer offset | \(R_{\text{p}}\ge R_{\text{p}(\min )}\); follow buffer offset rules. |
| I²C | SMBus / PMBus | I3C (MIPI) | |
|---|---|---|---|
| Clock range | 0–1 MHz (3.4 Hs) | 10–100 kHz (1 MHz in SMBus 3.x) | up to 12.5 MHz SDR |
| Drivers | Open-drain | Open-drain | Push-pull data, open-drain only for arbitration |
| Timeout | None (stretch forever) | 35 ms clock-low timeout resets the device | Defined |
| Thresholds | Proportional to VDD | Fixed levels (low-power variant) | Proportional |
| Extras | — | Packet error checking (CRC-8), SMBALERT#, address resolution; PMBus adds a power command set | Dynamic addressing, in-band interrupts, HDR modes; backward compatible with I²C targets on the same bus |
Also seen: TWI (Atmel/Microchip naming for I²C, usually without START byte or Hs mode), DDC (display EDID over I²C), IPMB in server management [2].
Sampled while SCL is high, effectively at the rising edge (it must be valid tSU;DAT before SCL rises and remain stable for the whole high period). It may change only while SCL is low, after the falling edge plus the hold time. A change during SCL high is a START or STOP.
Its VIH is \(0.7\times 5\ \text{V}=3.5\ \text{V}\), above the 3.3 V the pull-up can reach. Use a level translator, or a target with fixed (TTL-like) thresholds.
\(R_{\text{p}(\min )}=2.9\ \text{V}/3\ \text{mA}=967\ \Omega\). \(R_{\text{p}(\max )}=300\ \text{ns}/(0.8473\times 250\ \text{pF})=1.42\ \text{k}\Omega\). A 1.2 kΩ resistor works, with \(t_{\text{r}}=254\ \text{ns}\).
(1Dh « 1) \(|\,1=\text{3Bh}=0011\ 1011\).
A target that gets an ACK prepares to send the next byte and drives its first bit on SDA. If that bit is 0, SDA is held low and the controller cannot create the STOP (SDA rising while SCL is high). The NACK tells the target to release SDA.
Devices' input thresholds sit anywhere between 30 % and 70 %, so during the SCL fall (up to 300 ns) some receivers still see SCL high. If SDA changed immediately, they would decode a START or STOP. Holding SDA ≥ 300 ns bridges that undefined region.
Configure SCL as GPIO, toggle it up to nine times while watching SDA; once SDA is high, generate a STOP (SDA low → SCL high → SDA high), then re-enable the I²C peripheral.