The Pull-Up Window That Can Close
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
The Pull-Up Window That Can Close
The chapter’s bill of materials stacks two BME280s, a BH1750 light sensor, a CCS811 air-quality sensor, and an SSD1306 OLED onto one I2C bus with 2.2kΩ pull-up resistors, and its own key lesson warns that an incorrect pull-up value causes intermittent failures that are hard to debug. This audit asks the question that warning invites: with the OLED’s capacitance dominating the bus, does that 2.2kΩ value actually open a valid pull-up window at 100 kHz, or does the same bus make 400 kHz impossible no matter what resistor is chosen?
Companion to the chapter Protocol Diagnostics and Bus Design — every number here comes from that chapter.
Ada: The worked example concludes that 400 kHz is impossible on this bus but 2.2 kohm works at 100 kHz. That verdict rests on two limits squeezing from opposite sides. Let me recompute the window with full precision.
- Bus capacitance:
60 + 20 + 10 + 10 + 400 = 500 pF, dominated by the OLED’s 400 pF. - Upper limit (rise time), fast mode 400 kHz:
R_max = 300 ns / (0.8473 x 500 pF) = 708.1 ohm. - Lower limit (3 mA sink at V_OL 0.4 V):
R_min = (3.3 - 0.4) / 0.003 = 966.7 ohm. - The window is inverted:
R_max (708) < R_min (967), so no resistor satisfies both and 400 kHz cannot close. Confirmed. - Relax to 100 kHz (rise-time budget 1000 ns):
R_max = 1000 ns / (0.8473 x 500 pF) = 2360 ohm, opening the window to967 to 2360 ohm. A common 4.7 kohm sits outside it:4700 x 500 pF x 0.8473 = 1991 ns > 1000 ns(fails), while 2.2 kohm gives2200 x 500 pF x 0.8473 = 932 ns(passes) at3.3 / 2200 = 1.5 mA.
The pull-up must be small enough to pull the line high before the clock edge and large enough not to exceed the sink-current limit – two ceilings that both move with bus capacitance. Load the bus with a high-capacitance device and the fast-mode window shrinks until it inverts; the fix is then not a cleverer resistor but less capacitance or a slower clock.
Every number above is taken from the chapter’s own material and re-derived step by step.