Chris Collins

Tools · embedded

Peripheral protocols, simulated

Compose PS/2 keyboard and mouse traffic, WS2812 pixel data, IR remote codes (NEC, RC5, RC6, Sony), DMX512 packets, MIDI bytes and Centronics printer handshakes, and step through the timing diagram bit by bit — with error injection, decoders for pasted captures and Flipper/IRremote files, VCD export and a hand-off to the logic analyser.

Added

Works with

How to use it

Six of the protocols that hang peripherals off a microcontroller or an old PC, each drawn as a timing diagram you can walk through one bit at a time. Every step says what the wire is doing and why: which side drives the line, when the other side samples it, what the parity or check byte is for. Break something on purpose with Inject and see what the receiver makes of it.

How to use it

Pick a tab, set what to send in Compose, and the diagram redraws. Play walks through it at the chosen speed; Step ▶ / ◀ Step move one bit (or one phase — switch bits / phases). Click any part of the diagram to jump to it, scroll or use + − to zoom, drag to pan, double-click to fit. Export VCD saves the waveform for PulseView or GTKWave; Open in logic analyser carries it to the logic analyser, where the UART decoder picks up the MIDI and DMX lines by itself.

Decode a capture takes what you paste or open — bytes, a list of pulse timings, a VCD, or an IR file — and tells you what a receiver would make of it.

PS/2 keyboard and mouse

  • Click a key on the keyboard to see its make and break codes in scan code set 1, 2 or 3, including the E0 extended keys, Print Screen and Pause (E1, which has no break code). Tick hold the key to add typematic repeats at the delay and rate you choose.

  • LEDs and typematic plays the host-to-device round trips: 0xED and the LED byte, 0xF3 and the rate/delay byte. Host-to-device frames show the inhibit (CLK held low for 100 µs), the request-to-send, the device generating the clock, and the ACK bit.

  • Mouse builds 3-byte packets, IntelliMouse (wheel) and Explorer (wheel and buttons 4/5) 4-byte packets, and the 200-100-80 sample-rate "knock" that switches the wheel on.

  • Errors: bad parity, bad start or stop bit, no ACK, a clock outside 10–16.7 kHz.

  • Decoding: paste scan-code bytes to get key presses and releases, mouse bytes to get movement, or a VCD with CLK and DATA to get every frame in both directions.

WS2812 and SK6812 addressable LEDs

  • Choose the chip (WS2812B, the newer WS2812B-V5 with its 280 µs reset, SK6812 RGB and RGBW, WS2811) and up to eight pixel colours; the diagram shows GRB(W) bytes, MSB first, with the T0H/T1H windows from the datasheet.

  • The strip under the colours shows what the LEDs display after the frame — so a stretched T0H that lands in the T1H window, a reset that is too short to latch, or an interrupt that stalls the line mid-frame (and makes the strip latch early) is visible on the LEDs too.

  • SPI encoding shows the 3-bits-per-bit trick at 2.4 MHz (100 = 0, 110 = 1) or 4 bits at 3.2 MHz, the bytes for pixel 0, the buffer size, and whether the timings are inside the windows.

  • Timer PWM + DMA works out the auto-reload and the two compare values for a timer clock, and the DMA buffer length including the reset slots.

  • Frame rate vs LED count gives the frame time and fastest refresh on one data pin. For power injection and layout, use the LED strip and pixel planner.

IR remotes

  • NEC (with repeat codes and the 16-bit-address extended form), Philips RC5 and RC5X (Manchester, toggle bit), RC6 mode 0 (leader, double-width trailer bit) and Sony SIRC 12, 15 and 20-bit, each at its carrier (38, 36 or 40 kHz). Tick draw the carrier to see the modulation itself.

  • Copy the timings as IRremote sendRaw() code, or download a Flipper Zero .ir file (parsed or raw).

  • Decoding imports Flipper .ir files (every signal in the file, parsed or raw), IRremote raw dumps (+9000,-4500 … and rawData[] = {…}), LIRC mode2 output, learned Pronto hex codes, and plain lists of microseconds. Compose from this loads a decoded signal into the composer.

DMX512 and RS-485

  • Break, mark-after-break, start code and slot bytes at 250 kbaud with two stop bits; the packet time and refresh rate for any number of slots, padded to the 1204 µs minimum.

  • Errors: a break under 88 µs, a MAB under 8 µs, a framing error in a slot.

  • The RS-485 calculator checks termination and fail-safe biasing: the idle voltage across the pair against the ±200 mV receiver threshold, the load the driver sees against 54 Ω, and the unit loads on the line.

MIDI

  • Type messages in hex or pick a preset; running status drops repeated status bytes (and the diagram says which data byte rode on the last status). The receiver panel decodes the wire back into messages. The 5-pin DIN current loop is explained below the diagram.

  • Errors: a framing error, a lost status byte, a sender at the wrong baud rate.

  • To watch and play real devices, use the MIDI monitor.

Centronics parallel port

  • Bytes (text with \x1B and \n escapes, or hex) go out with nSTROBE, BUSY and nACK at the set-up, strobe, hold, busy and ACK times you choose; ESC/POS commands in the bytes are named.

  • Status lines: out of paper, off line and fault hold BUSY and stop the host.

  • Errors: a strobe under 0.5 µs, data changing too soon after the strobe, a host that strobes while the printer is busy.

  • For real ESC/POS printing see the receipt printer, and for the DB-25 and 36-pin pin-outs the connector pinouts.

Sources

Scan codes follow Andries Brouwer’s Keyboard scancodes and Adam Chapweske’s PS/2 notes; LED timings are from the Worldsemi and Opsco datasheets; IR timings from the protocol descriptions by San Bergmans (SB-Projects); DMX512 from ANSI E1.11 timing tables; MIDI from the MIDI 1.0 electrical specification (including the 2014 3.3 V update). The values are typical datasheet numbers — real parts are often more forgiving, and occasionally less.

Browser support

Any current browser. Nothing here talks to hardware; it is all simulation.

Privacy

Everything runs in your browser. Pasted captures and opened files are read locally and never uploaded. Open in logic analyser passes the waveform through your browser’s local storage.

Runs entirely in your browser; nothing you type leaves this page.