Open Drain Bus Clock Stretching Basics for Hardware Integrators
Clock stretching allows open-drain targets to hold SCL low, forcing host timing compliance through physical line sensing and hardware timeouts.

Wire
Serial communication buses operating on open-drain architecture rely on passive pull-up resistors to establish logic high levels across shared signal lines. An open-drain driver consists of an internal N-channel Metal-Oxide-Semiconductor Field-Effect Transistor (NMOS) whose drain connects directly to the external bus trace while its source connects to ground.
When any device on the network asserts a logic low signal, its internal transistor turns on, creating a low-impedance path to ground that pulls the line voltage down below the input low voltage threshold (VIL). When all connected devices release the line, their output transistors enter a high-impedance state, allowing the external pull-up resistor (Rpullup) to draw current from the supply rail (VDD) and charge the parasitic capacitance (Cb) of the bus trace, connector pins, and IC packages back up above the input high voltage threshold (VIH).

Open Drain Transistor Topologies
Integrated circuits driving open-drain networks utilize specialized low-side switches engineered for predictable current sinking. The physical interface omits p-channel high-side transistors entirely, preventing power supply contention when two nodes attempt to drive opposite logic states simultaneously.
This wired-AND configuration guarantees that if a single node pulls the line low, the entire bus remains at ground potential regardless of how many other nodes attempt to release the line to a high-impedance state. Node hardware driver stages incorporate protective ESD diodes connected between the pin and ground, though high-side clamping diodes connected to VDD are frequently omitted or modified to allow multi-voltage bus operation without back-powering supply rails.

Current Sink Limits and Voltage Thresholds
Logic state transition times depend directly on the physical balance between the pull-up resistor value and the total lumped bus capacitance. The fall time (tf) is driven by the internal NMOS transistor driving capability, which must sink the current passing through Rpullup in addition to discharging Cb. Industry standard specifications for I2C and SMBus establish a maximum output low voltage (VOL) of 0.4 V while sinking a nominal current (IOL) of 3 mA for Standard-mode (100 kHz) and Fast-mode (400 kHz) operation.
A total bus capacitance of 400 pF limits open-drain rise time to 1000 ns when operating with a 2.2 kΩ pull-up resistor.
The minimum pull-up resistance (Rpullup,min) is governed by the supply voltage and maximum allowable sink current, ensuring the voltage drop across the conducting NMOS device does not exceed VOL,max:
Rpullup,min = fracVDD – VOL,maxIOL
Calculating the maximum pull-up resistance (Rpullup,max) requires balancing the target bus operating frequency against the allowable signal rise time (tr). The RC time constant dictates the exponential charging curve of the bus capacitance through the pull-up resistor. For Fast-mode operation where tr,max is restricted to 300 ns, Rpullup,max is determined by the total bus load:
Rpullup,max = fractr0.8473 × Cb
- Minimum pull-up resistance sets current consumption limits and prevents low-side transistor saturation when driving the line.
- Maximum bus capacitance limits trace length, pin counts, and total package count on a bus segment.
- Output low voltage threshold determines the ground noise margin needed for reliable low-state detection over temperature changes.
- High-impedance leakage current sums across all connected target pins, producing a DC drop across the pull-up resistor that reduces VIH noise margins.
Exceeding driver sink current limits results in marginal voltage swings, causing intermittent logic errors across temperature extremes.

Delay
Clock stretching operates as a hardware-level flow control mechanism inherent to open-drain clock networks. Because the serial clock line (SCL) uses an open-drain structure identical to the serial data line (SDA), any target peripheral on the bus can independently hold SCL low even after the host master device has released its own clock driver.
During a standard transaction, the host master generates clock pulses by pulling SCL low for a defined duration (tLOW), releasing the line, and waiting for it to float high for the clock high period (tHIGH). If a target peripheral requires additional time to process an incoming command, fetch data from internal flash memory, perform an analog-to-digital conversion, or service an interrupt, it turns on its low-side NMOS transistor during the SCL low period. When the host master releases SCL, the line remains at ground potential because the target driver continues sinking current.

Master Synchronization and Target Pause Mechanics
Hardware serial controllers in the host master incorporate continuous feedback monitoring on the SCL pin. When the host clock generator releases SCL to transition high, an internal counter begins monitoring the actual voltage on the physical SCL line. If the line does not rise above VIH due to a target pulling low, the host timing logic halts its internal tHIGH counter and freezes the serial engine in its current state.
The target retains control of the transaction timing for the duration of its internal processing task. Once the target finishes its operation, it releases its NMOS transistor, allowing the pull-up resistor to charge the bus capacitance. As SCL crosses the VIH threshold, the host master detects the logic high state, starts its tHIGH timer, and continues the serial transmission sequence seamlessly without losing synchronization.

Clock Stretching Operational Sequence
Diagnosing timing violations requires following the exact physical sequence on the open-drain clock line during stretching.
- Host clock driver assertion pulls the SCL line to ground potential, initializing the standard low period counter tLOW within the primary controller hardware.
- Target internal processing trigger causes the peripheral serial engine to activate its low-side open-drain transistor, clamping SCL to ground independently.
- Host driver release occurs when the master finishes its pre-programmed tLOW period and enters high-impedance mode to allow SCL to rise.
- Line voltage hold persists as physical SCL remains held below VIL by the target open-drain transistor despite host release.
- Master synchronization pause engages inside the host bus controller, suspending the tHIGH execution clock and freezing serial shift registers.
- Target task completion prompts the peripheral controller to disable its low-side driver, releasing its physical hold on the serial clock trace.
- Bus RC rise transition charges trace capacitance through Rpullup until line voltage safely crosses the VIH input logic threshold.
- Master timer resumption detects logic high on SCL, initiates the tHIGH clock cycle, and latches serial data lines accurately.
Specification UM10204 mandates that clock stretching targets release the clock line within the maximum low period defined for the active speed mode.

How Do Multi-Master Arbitration Disputes Trigger Unexpected Clock Hold Times?
Multi-master configurations introduce layered interactions during clock stretching events. When two masters attempt to drive the bus simultaneously, each master senses the SCL line to synchronize its internal clock generator with the slower device. If one master asserts a longer low period while another device or target stretches the clock, all masters pause their clock counters until the physical line floats high.
This synchronization mechanism ensures that the clock high period across the entire bus equals the shortest tHIGH among all active masters, while the clock low period equals the longest tLOW asserted by any single host or target device.
| Bus Speed Mode | Max Clock Frequency | Min Clock Low Time (tLOW) | Min Clock High Time (tHIGH) | Max Allowable Bus Capacitance (Cb) |
|---|---|---|---|---|
| Standard-mode (Sm) | 100 kHz | 4.7 µs | 4.0 µs | 400 pF |
| Fast-mode (Fm) | 400 kHz | 1.3 µs | 0.6 µs | 400 pF |
| Fast-mode Plus (Fm+) | 1.0 MHz | 0.5 µs | 0.26 µs | 550 pF |
Unexpected serial communication halts frequently stem from undocumented internal processing delays during sensor EEPROM writes.

State
Firmware integration problems emerge when host serial drivers assume fixed-duration clock cycles and lack robust timeout mechanisms. Standard hardware serial peripheries on many microcontrollers support clock stretching automatically in hardware. However, if a target device enters an unrecoverable internal crash, experiences an Electrostatic Discharge (ESD) strike, or suffers supply voltage dip while holding SCL low, the host serial peripheral will halt indefinitely waiting for SCL to release.
Software architectures relying on blocking functions or un-budgeted while-loops inside serial driver calls risk systemic lockup. When the hardware serial engine freezes while waiting for SCL to float high, execution threads hanging on bus status flags cease execution, stalling host application logic and potentially knocking out supervisory watchdogs.

Bus Hang Mechanisms and Stuck-Low Faults
Stuck bus conditions typically occur in two distinct electrical modes: SCL stuck low due to indefinite clock stretching, or SDA stuck low due to an interrupted read sequence. If a host master encounters a hardware fault or is reset mid-transaction while a target is outputting a logic zero bit on SDA, the target remains waiting for additional clock transitions on SCL. The target continuously asserts SDA low, preventing any subsequent START condition from being generated by the master.
Dedicated hardware timers bound maximum wait states to prevent full system deadlocks.
To resolve SDA stuck-low conditions without power-cycling the board, host firmware drivers execute a manual bus recovery sequence. The host configures the SCL pin as a general-purpose output (GPIO) and toggles the clock line up to nine times while leaving SDA in input mode, forcing the target peripheral to shift out its remaining data bits until it releases SDA.

Software-Driven Bus Recovery Procedure
When physical hardware serial controllers enter lockup states caused by target clock stretching timeouts, host firmware executes a structured recovery algorithm to re-establish communications without rebooting the system.
- Disable internal peripheral bus logic inside the host microcontroller to release control of dedicated serial pins.
- Reconfigure host SCL and SDA pad multiplexers to operate as software-controlled GPIO outputs in open-drain configuration.
- Drive SDA high and verify pin state to identify whether the target holds data line low or clock line low.
- Pulse SCL from high to low and back high nine consecutive times at a frequency under 100 kHz.
- Sample SDA pin state after each positive SCL edge until target releases data line to high impedance state.
- Generate a valid manual STOP condition by driving SDA low while SCL is high, then releasing SDA to high-impedance mode.
- Re-enable dedicated internal hardware serial controller, restore standard bus operating parameters, and re-initialize peripheral registers.
Hardware watchdog isolation prevents software threads from hanging indefinitely during peripheral failure states. Microcontroller drivers utilize non-blocking bus drivers backed by dedicated hardware timers (such as SysTick or peripheral hardware watchdogs) set to abort transactions if clock stretching exceeds defined application limits (typically 25 ms for SMBus-compliant applications).
Engineers continue to debate whether hardware bus recovery logic ought to execute inside the primary serial interrupt routine or within an isolated supervisor thread.

Bench
Oscilloscope measurements provide absolute verification of open-drain signal integrity, clock stretch timing, and RC rise time parameters during board bring-up. Measuring clock stretch duration demands active differential or low-capacitance passive probing direct at the target device pins. Probing open-drain clock lines with high-capacitance passive scope tips introduces artificial signal distortion during rise-time measurements.
Standard 10x passive probes add 10 pF to 15 pF of parallel capacitance to the measurement node, distorting high-speed rise times on heavily loaded buses. When measuring rise times (tr) from 30% VDD to 70% VDD, total probe capacitance must be factored into observed values to prevent false pass/fail judgments during verification audits.

Waveform Characteristics of Clock Stretching
A typical clock stretching event appears on an oscilloscope as an asymmetrical elongation of the SCL low period. Under normal operation, SCL reflects a uniform square wave governed by the master internal clock divider. When a target asserts a clock stretch, the SCL waveform shows a standard falling edge, stays flat at VOL (typically
High-frequency ringing or inductive bounce on SCL traces during falling transitions can breach VIL input thresholds, causing target devices to falsely decode extra clock edges or miss release windows entirely. Inserting series damping resistors (10 Ω to 33 Ω) adjacent to driver pins absorbs reflection energy on high-speed traces without shifting DC logic levels significantly.
- Low-capacitance active probes under 2 pF preserve true rise-time characteristics during high-frequency Fast-mode Plus signal analysis.
- Ground spring adapters eliminate long ground leads that introduce parasitic inductance and false ringing on scope traces.
- Single-shot trigger acquisition captured on the rising edge of SDA during START conditions isolates intermittent target stretching events.
- Bus monitor logic analyzers decode protocol framing errors caused by timing budget overruns during maximum target clock holds.
Compliance testing against UM10204 Section 3.1.9 shifts hardware validation criteria by mandating continuous bus monitoring across maximum capacitive loads.

Stock
Selecting peripheral IC variants demands balancing hardware feature sets against software development overhead and overall unit bill of materials (BOM) cost. Silicon vendors offer identical sensing elements in multiple package and interface formats, ranging from simple unbuffered open-drain components to fully integrated modules featuring internal microcontroller units (MCUs) that manage communication buffering automatically.
Simple low-cost sensors lacking internal clock stretching hardware force firmware engineers to write complex timeout recovery drivers and non-blocking state machines on the main host processor. Conversely, higher-grade digital sensors incorporate dedicated hardware state machines, command FIFOs, and fixed SMBus clock timeout circuits (tTIMEOUT = 25 ms – 35 ms) directly on-chip. These integrated features prevent peripheral lockup states at the physical layer, drastically reducing host driver software complexity at the expense of higher component unit costs.

Make-or-Buy Interface Tradeoffs
Choosing an unbuffered sensor package incurs additional non-recurring engineering (NRE) costs spent writing, testing, and qualifying crash-recovery driver code. While a bare LGA-packaged sensor unit price may sit significantly lower than an integrated module variant, adding external bus buffers, specialized isolation components, or dedicated software recovery routines alters total project economics across high-volume production runs.
| Package Variant | Hardware Clock Stretching Support | Bus Lockup Protection | Relative Unit Price (10k units) | Firmware Driver Effort |
|---|---|---|---|---|
| Bare SMD (DFN/LGA) | Unbounded (Target controlled) | None (Host software recovery) | 1.0x | High (3 to 5 weeks) |
| SMBus Integrated SMD | Bounded (tTIMEOUT le 35 ms) | Hardware automatic reset | 1.3x to 1.5x | Low (1 week) |
| Buffered Module | Isolated (Internal MCU buffer) | Full active bus isolation | 2.5x to 4.0x | Minimal (Standard driver) |
Selecting sensor packages with hardware bus timeout circuitry reduces system integration time compared to managing software recovery routines on unbuffered silicon.




