DevTools Logo

I2C & SPI Bus Timing Diagram

I²C & SPI Timing Diagram

Scan I²C addresses, check spec timing and pull-up limits, and draw SPI modes 0 to 3. Everything runs in your browser.

Runs in your browser
Try an example

Bus inputs

Add I²C device

I²C bus

SPI signal

SPI mode

Analysis and diagram

Timing values are the minimums from the NXP UM10204 I²C-bus specification (rev. 7.0, Table 10). Check the datasheets of your devices: they may require more.

I²C address scan

  • OLED display 0x3C (7-bit)7-bit 0x3C · write 0x78 / read 0x79
  • Current sensor 0x40 (7-bit)7-bit 0x40 · write 0x80 / read 0x81

No address conflicts detected.

SPI mode 0 · CPOL 0, CPHA 0

Clock idles low; sample on rising edge, change on falling edge.

Maximum clock is peripheral-specific; short traces commonly support several MHz.

10100101CSSCLKMOSI

CS is active low. Dashed vertical lines mark the rising sampling edge of SCLK, with the sampled bit below. MOSI is dashed where the line is not driven for a valid bit.

I²C timing and pull-up

I²C timing minimums for Fast-mode
SCL clock (max)400 kHz
tLOW (min)1.3 µs
tHIGH (min)0.6 µs
tSU;STA (min)0.6 µs
tHD;STA (min)0.6 µs
tSU;DAT (min)100 ns
tSU;STO (min)0.6 µs
tBUF (min)1.3 µs
tr / tf (max)300 ns / 300 ns
Bus capacitance (max)400 pF
Shortest SCL period2.50 µs (tLOW + tHIGH + tr + tf)

1,800 Ω

Suggested range: 967–3,540 Ω

Rp must be between 967 and 3,540 ohm for VDD 3.3 V, Cb 100 pF and tr(max) 300 ns. The suggestion is the standard E12 value nearest the geometric middle.

About

Two embedded-bus checks in one tool. The I2C scanner normalizes device addresses between 7-bit and 8-bit (read/write shifted) notation so a sensor listed as 0x3C and a display expecting 0x79 are correctly recognized as the same wire address — and flags true conflicts. It also covers speed grades from Standard 100 kHz up to High-speed 3.4 MHz with practical pull-up resistor sizing that trades rise time against bus capacitance. The SPI panel explains all four CPOL/CPHA modes — when the clock idles and which edge samples data — and draws the resulting clock/MOSI waveform for your bit pattern so mode mismatches are easy to see. Peripheral datasheets remain authoritative for maximum speeds; the diagrams and calculations are deterministic and computed entirely client-side.

Examples

Normalize an 8-bit sensor address

Input
normalizeI2cAddress(0x79, "8-bit")
Output
{ sevenBit: 0x3c, write8Bit: 0x78, read8Bit: 0x79 }

The 8-bit read byte shifts down to 7-bit 0x3C with even write and odd read variants.

Catch an address clash

Input
scanI2cConflicts([{ address: 0x3c, name: "OLED" }, { address: 0x79, format: "8-bit", name: "sensor" }])
Output
[{ address: 0x3c, devices: [...] }]

The 8-bit 0x79 normalizes to 0x3C, so both devices collide on the same seven-bit address.

About this tool

I2C/SPI Timing Diagram normalizes bus addresses with normalizeI2cAddress(address, format): 7-bit values pass through while 8-bit display bytes shift right one bit, always returning { sevenBit, write8Bit, read8Bit } with the R/W bit split into write (<<1) and read (<<1 | 1).

Bus conflicts come from scanI2cConflicts(devices), which normalizes every entry (defaulting format to 7-bit) and groups devices sharing a seven-bit address — sorted numerically — while getPullupRecommendation(speed, capacitancePf) sizes SDA/SCL pull-ups between 1 kΩ and 10 kΩ from rise-time math.

SPI coverage uses SPI_MODES (modes 0–3 with CPOL/CPHA pairs) plus I2C_SPEED_MODES (Standard 100 kHz through High-speed 3.4 MHz), and bitsToSignals renders deterministic clock/data SVG polyline paths for any 0/1 bit string.

How to use this tool

  1. Normalize addresses

    Pass the datasheet address with 7-bit (default) or 8-bit format to get the seven-bit, write, and read bytes.

  2. Scan for conflicts

    Give scanI2cConflicts your device list — entries sharing a normalized address come back grouped.

  3. Size the pull-ups

    Call getPullupRecommendation with bus speed and capacitance to get ohms plus min/max bounds and rationale.

  4. Draw timing

    Feed bitsToSignals a bit string and SPI mode (0–3) for clock/data arrays and an SVG path.

Use cases

Wiring multiple I2C sensors

Confirm every breakout has a unique seven-bit address before soldering the bus.

Sizing pull-up resistors

Trade bus speed against capacitance to pick a pull-up inside the 1–10 kΩ window.

Documenting SPI transactions

Render clock/data waveforms for the correct CPOL/CPHA mode in datasheets and reviews.

Common mistakes

Mistake:Comparing raw 8-bit bytes for conflicts.

Fix:Normalize first — 0x79 (8-bit) and 0x3C (7-bit) are the same device, which scanI2cConflicts detects.

Mistake:Assuming SPI mode 3 idles low.

Fix:Mode 3 is CPOL=1 CPHA=1, so the clock idles high; check SPI_MODES before probing.

Frequently asked questions

What does this tool do?

It normalizes I2C addresses with normalizeI2cAddress, flags clashes with scanI2cConflicts, sizes pull-ups with getPullupRecommendation, and draws SPI waveforms with bitsToSignals for modes 0–3.

How do 7-bit and 8-bit addresses relate?

normalizeI2cAddress(0x79, "8-bit") gives seven-bit 0x3C with write 0x78 and read 0x79 — 8-bit display bytes shift right one bit.

Is my board design uploaded or stored?

No. Address math, conflict grouping, and timing paths run fully client-side.

Why was a conflict reported, or a mode rejected?

Devices sharing a normalized seven-bit address group into one conflict entry, and bitsToSignals only accepts SPI modes 0, 1, 2, or 3 with strict 0/1 data.

References & standards