Bus protocols, simulated
Type a transaction (bytes, addresses, read or write) for SPI, I²C, UART, 1-Wire, SD card SPI-mode init or JTAG and get a zoomable, animated timing diagram with every phase labelled. Step through it bit by bit with an explanation of each one, inject errors to see how a decoder reacts, or paste a capture and decode it.
Added
Works with
- Logic analyser IoT and embeddedopens any transaction generated here in the logic analyser, and its VCD export opens there too
How to use it
Pick a protocol, type what you want to send, and the page draws the waveform a logic analyser would capture, with each bit, byte, acknowledgement and bus condition marked. Next ▶ walks through it one step at a time and says what each line is doing and why; ▶ Play animates the whole transaction. Below the diagram, What a decoder sees runs a real protocol decoder over the same edges, so when you inject an error you can see what it does to the decoded data.
How to use it
-
Choose a protocol along the top and fill in the transaction:
-
SPI — mode 0–3 (the four small diagrams show CPOL and CPHA side by side; click one to use it), MSB or LSB first, the bytes the master sends on MOSI and the bytes the device answers on MISO (full duplex, one bit each way per clock), CS held for the whole transfer or toggled between bytes, and daisy chains of 2–4 devices, with the line between each pair of devices drawn.
-
I²C — a short script:
S 0x76 W 0xD0 Sr 0x76 R 0x60 Pis a register read (START, address with write, register number, repeated START, address with read, one byte back, STOP). Addresses above 0x7F are sent as 10-bit addresses;~40makes the slave stretch the clock for 40 µs. Bands on SDA show who is driving it, master or slave. Set the pull-up resistor and bus capacitance and the rising edges are drawn as the RC curves they really are, with a chart of rise time against pull-up value, the limits for 100 kHz, 400 kHz and 1 MHz from the I²C specification (UM10204), and the minimum pull-up for a 0.4 V low. Arbitration demo starts two masters at the same moment and shows the bit where one of them loses. -
UART — baud rate, 5–9 data bits, parity, 1, 1.5 or 2 stop bits, normal or inverted, and the text or hex bytes to send. The dots on the line are where the receiver samples. The Baud rate tolerance panel works out how much clock error the frame survives at 16× or 8× oversampling, and lists the divisor and error for every standard baud rate at your clock (16 MHz gives the familiar −3.5 % at 115 200 baud).
-
1-Wire — reset and presence, write-0/write-1 and read slots, ROM commands (Read ROM, Match ROM, Skip ROM), a DS18B20 temperature conversion and scratchpad read with its CRC-8 checked. Search ROM runs the binary search from Maxim application note 187 over the devices you list: each pass is drawn as a waveform (two read slots and one write slot per ROM bit), and a grid of the devices' ROM bits shows which devices drop out as you step through it.
-
SD card — the SPI-mode start-up a microcontroller does before it can read a card: 80 clocks with CS high, CMD0, CMD8, CMD55 + ACMD41 until the card is ready, CMD58 to read the OCR (and CMD16 for standard-capacity cards), with every command frame, its CRC-7, and the R1, R3 or R7 response explained. Choose an SDHC, SDSC or old version 1 card.
-
JTAG — one step per line:
RESET,IR 0xE/4(instruction and length),DR 32(shift 32 bits and read),TMS 0110,GOTO Pause-DR,IDLE 3. The TAP state machine is drawn beside it with the current state highlighted; click a state to add the shortest TMS path to it. Reading the IDCODE decodes its version, part number and JEDEC manufacturer.
-
-
Read the diagram. Scroll or pinch to zoom around the pointer, drag to pan, double-click to fit. Hover over a band or box for what it is. Click anything to jump to its step; the arrow keys step too, and space plays. With Follow on, stepping zooms to the bit being explained.
-
Inject an error to see what goes wrong and how a decoder reports it: a glitch on SCK, CS let go early, decoding SPI in the wrong mode; a missing ACK, a glitch on SCL, SDA changing while SCL is high; wrong parity, a framing error, a break, a glitch on an idle UART line (rejected) or a baud rate mismatch you set in per cent; no 1-Wire presence pulse, a corrupted bit that fails the CRC, a reset that is too short; a bad CRC on CMD8 or no card at all; a TMS glitch that derails the TAP, or TDO stuck high.
-
Export. Open in logic analyser hands the waveform to the logic analyser for cursors, measurements and its decoders (pick the SPI mode there if it isn’t 0). Export VCD saves a file that PulseView, GTKWave or the logic analyser open; Export SVG saves the diagram as you see it, for notes and datasheets.
-
Import (the last tab) does it the other way round: paste or open a VCD, Saleae or sigrok CSV, or raw bytes, choose the decoder and which channel is which (it guesses from the names), and the decoded events appear under the waveform.
The UART, I²C, SPI and 1-Wire decoding is the logic analyser’s own code, loaded from its page, so what this page shows as decoded is what the logic analyser would show. The SD command decoder and the JTAG TAP follower are this page’s own, and are covered by the same tests: each generated transaction is decoded back, directly and after a round trip through VCD, and must give the bytes that were typed.
Related tools: the I²C address finder plans which devices share a bus, Logic levels checks voltage levels and sizes open-drain pull-ups, the serial monitor talks to a real UART, the CRC calculator has CRC-7/MMC and CRC-8/MAXIM, and Modbus and CAN draws CAN frames with their stuff bits.
Works in any current browser, on a phone too. No hardware is needed.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.