I2C Pull-Up Resistor Calculator
Try Change Bus capacitance Cbus (pF) from 53 to 400.
Observe Compare Safe pull-up range and Rise time with bus capacitance at 53 and 400 pF.
Explain Explain why increasing bus capacitance to 400 pF increases rise time for the same resistor.
Calculate
Reset
Technical boundaries. The range uses a fixed 0.4 V output LOW voltage and mode-specific sink current and maximum rise time. Rise time follows the stated RC formula; the table tests four resistor values.
viewof vdd = Inputs. range ([1.8 , 5.0 ], {
label : "Supply voltage VDD (V)" ,
step : 0.1 ,
value : 3.3
})
viewof cbus_pf = Inputs. range ([10 , 400 ], {
label : "Bus capacitance Cbus (pF)" ,
step : 5 ,
value : 53
})
viewof mode = Inputs. select (["Standard (100 kHz)" , "Fast (400 kHz)" , "Fast+ (1 MHz)" ], {
label : "I2C mode"
})
{
const vol = 0.4 ; // max output LOW voltage (V)
const isink = mode === "Fast+ (1 MHz)" ? 0.020 : 0.003 ; // UM10204 Table 10 IOL at VOL 0.4 V
const k = 0.8473 ; // RC factor for the 30%-to-70% VDD rise-time interval
const tr_max = mode === "Standard (100 kHz)" ? 1000e-9
: mode === "Fast (400 kHz)" ? 300e-9
: 120e-9 ; // Fm+
const r_min = (vdd - vol) / isink;
const cbus = cbus_pf * 1e-12 ;
const r_max = tr_max / (k * cbus);
const r_min_k = (r_min / 1000 ). toFixed (2 );
const r_max_k = (r_max / 1000 ). toFixed (2 );
const standard_vals = [1000 , 2200 , 4700 , 10000 ];
const rows = standard_vals. map (r => {
const tr_ns = (k * r * cbus * 1e9 ). toFixed (0 );
const ok = r >= r_min && r <= r_max;
return htl. html `<tr style="background: ${ ok ? '#e8f8f0' : '#fdecea' } ">
<td> ${ r >= 1000 ? (r/ 1000 ) + " kΩ" : r + " Ω" } </td>
<td> ${ tr_ns} ns</td>
<td> ${ ok ? "✓ OK" : "✗ Out of range" } </td>
</tr>` ;
});
return htl. html `<div style="font-family:Arial,sans-serif;padding:12px;background:#f8f9fa;border-radius:6px;border:1px solid #dee2e6">
<p><strong>Safe pull-up range:</strong>
<span style="color:#16A085;font-weight:bold"> ${ r_min_k} kΩ</span>
to
<span style="color:#16A085;font-weight:bold"> ${ r_max_k} kΩ</span>
</p>
<table style="width:100%;border-collapse:collapse;font-size:0.9em">
<thead><tr style="background:#2C3E50;color:white">
<th style="padding:6px;text-align:left">Resistor</th>
<th style="padding:6px;text-align:left">Rise time</th>
<th style="padding:6px;text-align:left">Status</th>
</tr></thead>
<tbody> ${ rows} </tbody>
</table>
<p style="font-size:0.85em;color:#7F8C8D;margin-top:8px">
Formula: t<sub>r</sub> = 0.8473 × R × C<sub>bus</sub> |
Max rise time: ${ mode === "Standard (100 kHz)" ? "1000 ns" : mode === "Fast (400 kHz)" ? "300 ns" : "120 ns" }
</p>
</div>` ;
}
Back to the chapter