DevTools Logo

I2C & SPI Bus Timing Diagram

I²C & SPI Timing Diagram

Scan I²C addresses and visualize deterministic SPI bus timing locally

Add I²C device

SPI signal

SPI mode

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