I2C Bus Not Working? Check the Pull-Ups and Rise Time
A flaky I2C bus is often a rise-time problem. Here is how to prove it with a scope, work back to the bus capacitance, count the pull-ups already fitted and pick a value inside the window the specification allows.
When an I2C bus fails or works only sometimes, scope SDA and SCL and measure the rise time from 30% to 70% of VDD. Above 1,000 ns in Standard-mode or 300 ns in Fast-mode, the pull-ups are too weak for the bus capacitance. The I2C Pull-Up Resistor Calculator then gives the allowed resistor window.
This post is the bench procedure: what the symptoms look like, how to measure the edge, how to turn one measurement into a bus capacitance, how to find pull-ups you did not know were there, and what else breaks a bus when the pull-ups are fine. Every limit comes from NXP UM10204, the I2C-bus specification, Rev. 7.0. Every example assumes a 3.3 V bus.
Symptoms that point at the pull-ups
- The bus works at 100 kHz and fails at 400 kHz. The rise-time limit drops from 1,000 ns to 300 ns between the two modes (UM10204 Table 11), so a marginal edge passes one and fails the other.
- It fails when you add a cable, a second board or one more breakout. Each one adds capacitance, and a breakout often adds its own pull-up resistors too.
- On the scope the edges rise as slow curves instead of sharp steps, and the high level is barely reached before the next falling edge.
- Errors depend on temperature, cable position or which units you test. A design with no margin fails on the unit with the most capacitance.
A worked example: a bus that fails at 400 kHz
The setup: a 3.3 V microcontroller board with 4.7 kΩ pull-ups on SDA and SCL, a few sensors on short wires. At 100 kHz everything answers. At 400 kHz reads fail. The scope, set to 30% and 70% reference levels, shows a 520 ns rising edge on SDA. Assumption: the 10x probe adds 10 pF; read the real figure from your probe's manual.
| Step | Value |
|---|---|
| Measured rise time, 30% to 70% | 520 ns |
| Capacitance, tr / (0.8473 x 4.7 kΩ) | 130.6 pF |
| Probe capacitance (assumed) | 10 pF |
| Bus capacitance without the probe | 120.6 pF, used as 120 pF below |
Now compare common resistor values on that 120 pF bus. The 4.7 kΩ edge at 478 ns explains the symptom exactly: legal for Standard-mode (1,000 ns), far too slow for Fast-mode (300 ns). A 10 kΩ pull-up would fail even Standard-mode; it reaches the 1,000 ns limit at 118 pF.
| Pull-up | Rise time at 120 pF | Fast-mode (300 ns max) | Largest Fast-mode bus |
|---|---|---|---|
| 1.6 kΩ | 163 ns | Passes | 221 pF |
| 2.2 kΩ | 224 ns | Passes | 161 pF |
| 3.3 kΩ | 336 ns | Fails | 107 pF |
| 4.7 kΩ | 478 ns | Fails | 75.3 pF |
| 10 kΩ | 1,017 ns | Fails | 35.4 pF |
| 20 kΩ (a weak internal pull-up) | 2,034 ns | Fails | 17.7 pF |
| Mode | Rise time max | Rp(min) | Rp(max) |
|---|---|---|---|
| Standard-mode, 100 kHz | 1,000 ns | 967 Ω | 9.84 kΩ |
| Fast-mode, 400 kHz | 300 ns | 967 Ω | 2.95 kΩ |
| Fast-mode Plus, 1 MHz | 120 ns | 145 Ω | 1.18 kΩ |
For Fast-mode the window is 967 Ω to 2.95 kΩ. Its geometric middle is 1,689 Ω, and the nearest E24 value is 1.6 kΩ: a 162.7 ns rise, 45.8% margin under the 300 ns limit, and 1.81 mA for the pin to sink while it holds the line at 0.4 V. With E12 parts, 1.8 kΩ gives 183 ns. Internal pull-ups, often in the tens of kilohms (read your microcontroller's datasheet), are far outside this window.
How do you measure I2C rise time with an oscilloscope?
- Use a 10x probe and its short ground spring, not the long ground lead. A 1x probe loads the line far more and slows the edge you are trying to measure.
- Probe SDA and SCL at the device that fails, not only at the controller. On a long bus the far end is where the edge is worst.
- Trigger on a rising edge and set the timebase so one edge fills most of the screen.
- Measure from 30% to 70% of VDD: 0.99 V to 2.31 V on a 3.3 V bus. UM10204 refers all Table 11 timing to these two levels.
- Check which levels your scope's automatic rise-time measurement uses. If it reads 10% to 90%, an RC edge reads 2.59 times longer: the 520 ns edge above would show as 1,348 ns. Change the reference levels or use cursors.
- Write down the pull-up value fitted when you took the reading. You need it for the next step.
How do you work back to bus capacitance?
A pull-up charging the bus capacitance is an RC curve. UM10204 section 7.1 derives the time from 30% to 70% of VDD as 0.8473 x RC, which is ln(0.7 / 0.3). Turn it around: Cb = tr / (0.8473 x Rp). That is how 520 ns with 4.7 kΩ became 130.6 pF above. Subtract the probe's capacitance and you have the bus.
Compare the result with an estimate before you trust either. Table 10 allows up to 10 pF per I/O pin, and a trace or cable adds very roughly 1 pF per cm. Five devices on 40 cm of wiring estimate to 90 pF. If the scope says 120 pF, the difference is connectors, breakout boards and wiring you did not count. The measurement wins.
Count the pull-ups already on the bus
Many sensor breakout boards carry their own pull-up resistors, and every one of them sits in parallel with yours. With the power off, an ohmmeter between SDA and VDD reads the combined value, plus any leakage paths through the chips, so treat it as a hint and confirm on the schematics. The table assumes the same 3.3 V, 120 pF, Fast-mode bus as above.
| Pull-ups fitted | In parallel | Rise time | Verdict |
|---|---|---|---|
| One 4.7 kΩ | 4.7 kΩ | 478 ns | Too weak for Fast-mode |
| 4.7 kΩ plus three 10 kΩ breakouts | 1.95 kΩ | 198 ns | Inside the window |
| Three 4.7 kΩ breakouts | 1.57 kΩ | 159 ns | Inside the window |
| Four 2.2 kΩ breakouts | 550 Ω | 55.9 ns | Too strong: 5.27 mA to hold 0.4 V |
| Two 10 kΩ breakouts | 5 kΩ | 508 ns | Too weak for Fast-mode |
Stacked pull-ups can fix a slow bus by accident, and they can also break it. Four 2.2 kΩ boards make 550 Ω, below the 967 Ω minimum: a pin would need to sink 5.27 mA to hold the line at 0.4 V, and the specification requires a pin to sink only 3 mA at that level. A pin rated at that minimum holds the low level above 0.4 V, which eats the noise margin, and zeros can be misread. Remove the extra resistors or open their solder jumpers.
Pick the value: the window between sink current and rise time
Two limits set the window, both from UM10204 section 7.1. The minimum is Rp(min) = (VDD - VOL) / IOL. Table 10 sets VOL at 0.4 V with 3 mA of sink current in Standard-mode and Fast-mode, and 20 mA in Fast-mode Plus. At 3.3 V that gives 967 Ω. The maximum is Rp(max) = tr / (0.8473 x Cb), with tr from Table 11. Pick a standard value near the middle so both limits keep margin.
At 2 V and below, Table 10 specifies the low level of Fast-mode and Fast-mode Plus parts as 0.2 x VDD at 2 mA instead, so a 1.8 V bus has Rp(min) = 720 Ω. There is no single value that always works: the window moves with supply, speed and capacitance.
A stronger pull-up costs current. Each line draws VDD / Rp while it is low: 2.06 mA with 1.6 kΩ, against 0.70 mA with 4.7 kΩ. Nothing flows while the bus idles high, so the average depends on how much traffic the bus carries. On a battery product, put that figure into the Battery Life Calculator; reducing power consumption in battery devices covers the rest of the budget.
When no resistor fits
On a 3.3 V Fast-mode bus a plain resistor runs out at 366 pF, where Rp(max) falls to Rp(min), even though Table 11 allows 400 pF. Table 10 note 4 says that driving the full bus load at 400 kHz needs 6 mA of sink current at 0.6 V. UM10204 section 7.2 lists the ways out: a lower clock, higher-drive Fast-mode Plus parts, a bus buffer that splits the bus into segments, or a switched pull-up. The I2C Pull-Up Resistor Calculator shows the window closing as you raise the capacitance.
Causes that are not the pull-ups
- Address clashes. Two copies of the same breakout share one address unless an address pin or jumper changes it. Both answer at once, and because the bus is a wired-AND, reads return a mix of both. Scan the bus with one device connected at a time.
- SDA held low after a reset. The controller reset in the middle of a read while a target was driving a zero. The target waits for clocks that never come, and the bus looks dead. The recovery is below.
- Level shifters. A typical MOSFET shifter between a 1.8 V and a 3.3 V side has pull-ups on both sides; size each side for its own voltage and capacitance, and measure the rise time on both.
- A missing or long ground. Boards joined by SDA and SCL alone, or by a thin shared ground in a long cable, see ground shifts that eat into the noise margin.
- Clock stretching. A target may hold SCL low to make the controller wait (UM10204 section 3.1.9). A controller or a bit-banged driver that does not check SCL before continuing reads garbage. The specification notes that most targets cannot stretch the clock, so check the datasheet of each target before you blame it.
How do you recover an I2C bus with SDA stuck low?
UM10204 section 3.1.16, Bus clear, says the controller should send nine clock pulses on SCL; the device holding SDA low should release it within those nine clocks. If SDA is still low, use the devices' hardware reset inputs or cycle their power. Once SDA is free, generate a STOP so every device sees an idle bus; that step is common driver practice, not part of the specification text. If SCL itself is stuck low, the specification goes straight to hardware reset or a power cycle.
Put the nine-clock recovery in the driver's initialization, before the first transfer, so a reset in the middle of a read never leaves the product with a dead bus. That kind of robustness work is part of firmware development.
The debugging checklist, in order
- Measure SDA and SCL with a meter while the bus idles. Both should sit at VDD. If SDA sits low, clear the bus with nine SCL clocks before anything else.
- Scope both lines at the device that fails, with a 10x probe and a short ground spring.
- Measure the rise time from 30% to 70% of VDD and compare it with 1,000 ns (Standard-mode), 300 ns (Fast-mode) or 120 ns (Fast-mode Plus).
- Work back to bus capacitance with Cb = tr / (0.8473 x Rp), minus the probe.
- Count the pull-ups in parallel: yours plus every breakout's. Check the combined value against the window.
- Check for address conflicts: scan the bus with one device at a time, then all together.
- Pick a standard value near the middle of the window, re-measure the rise time and the low level, and keep the scope captures with the design files.
Sources
- NXP UM10204, I2C-bus specification and user manual, Rev. 7.0, 1 October 2021: Table 10 for VOL, IOL and pin capacitance, Table 11 for rise time and capacitive load, section 7.1 for the pull-up equations and the 0.8473 factor (its text says the rise time is in Table 10; the value is listed in Table 11), section 7.2 for buses above the capacitance limit, section 3.1.16 for bus clear.
If you want a second engineer to look at your schematic and scope captures, book a design review.
Frequently asked questions
How do I measure I2C rise time with an oscilloscope?
Use a 10x probe with a short ground spring on SDA or SCL, trigger on a rising edge and measure from 30% to 70% of VDD, the levels UM10204 uses. If your scope's automatic measurement uses 10% to 90%, divide that reading by 2.59 to get the 30 to 70% figure on an RC edge.
Can too many pull-up resistors break an I2C bus?
Yes. Each breakout board brings its own pull-ups and they add in parallel. Four 2.2 kΩ boards make 550 Ω, and at 3.3 V a pin must then sink 5.27 mA to hold the line at 0.4 V, while the specification requires a pin to sink only 3 mA in Standard-mode and Fast-mode. Remove or disconnect the extras.
Why does my I2C bus work at 100 kHz but fail at 400 kHz?
The rise-time limit drops from 1,000 ns in Standard-mode to 300 ns in Fast-mode. A 4.7 kΩ pull-up on a 120 pF bus rises in about 478 ns: legal at 100 kHz, far too slow at 400 kHz. Fit a stronger pull-up inside the allowed window, or reduce the bus capacitance.
How do I find the capacitance of my I2C bus?
Measure the 30 to 70% rise time with a known pull-up fitted, then divide: Cb = tr / (0.8473 x Rp). A 520 ns edge with 4.7 kΩ gives 130.6 pF including the probe; subtract the probe's own capacitance. As a rough cross-check, count 10 pF per device pin plus about 1 pF per cm of wiring.
How do I recover an I2C bus with SDA stuck low?
UM10204 says the controller should send nine clock pulses on SCL, and the device holding SDA low should release it within those nine clocks. If not, use the devices' hardware reset or cycle their power. Generating a STOP after the clocks, so every device sees an idle bus, is common driver practice rather than a step the specification names.
What pull-up value should I use for I2C at 3.3 V?
There is no single value. At 3.3 V the minimum is 967 Ω in Standard-mode and Fast-mode, set by 3 mA at 0.4 V. The maximum depends on speed and capacitance: 2.95 kΩ for a 120 pF Fast-mode bus. Pick a standard value near the middle of the window; 1.6 kΩ fits that example.
How inteRFace R&D can help
Building something hardware-shaped?
We help hardware founders go from sketch to certified product. Bring the spec, or just the idea, to a free 30-minute call with a senior engineer. Prefer email? A senior engineer reads every one.
Related articles
Crystal Oscillator Not Starting? A Bring-Up Checklist
An MCU crystal that will not start, starts only sometimes or runs off frequency has a short list of causes. Here they are in the order to check them, with worked numbers for a 24 MHz and a 32.768 kHz crystal.
Embedded SystemsPWM to Analog Voltage: STM32 Timer and RC Filter Design
A PWM pin and one RC filter make a cheap DAC. Here is the full trade on an STM32G0 at 64 MHz: counts per period, ripple under one count, the settling time that buys, the load, and when a second stage or a real DAC wins.
Embedded SystemsHow to Estimate IoT Battery Life From a Duty Cycle
A worked example for a battery-powered sensor node: list every state with its current and time, sum the charge per reporting cycle, fold it into an average current, then derate the cell, add self-discharge and check the pulse the radio draws.