Skip to the content
2 layers108.5 × 34.5 mmPCB board and schematic, the printed circuit board in 3D

PCB board and schematic

iceyaseen/fpga-bus-identifier

An I2C, UART, and 1-Wire identifier for unknown 3-4 pin components, built on a Tang Nano 9K FPGA and a Python host app. PCB design included.

Size
108.5 × 34.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
54
Pads
86
Tracks, vias
60, 0
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
30 Aug 2026
Updated
8 Sep 2026

Overview

PCB board and schematic is an open-source printed circuit board by iceyaseen, from the iceyaseen/fpga-bus-identifier repository on GitHub, published under the MIT licence. It is a 2-layer board of 108.5 × 34.5 mm with 19 parts on 54 nets, routed with 60 tracks and 0 vias.

Its parts include 8 resistors, 4 diodes, 3 connectors, 2 capacitors and 2 transistors. It belongs with the sensors and measurement and fPGA and programmable logic boards and the FPGA and CPLD boards of this library.

README

README.md

FPGA Bus Identifier

A tool for figuring out how an unknown chip talks before you know anything about it. The usual situation: you have a small component with 3 or 4 pins, no datasheet, and no idea which protocol it speaks or what each pin does. Instead of guessing, you hook it up to this board and look at what actually happens on the lines.

Status

  • Passive edge capture on two probe channels, timestamped against a free-running 27MHz counter, streamed to a Python host over a framed, checksummed, self-resynchronising UART protocol at 921600 baud.
  • I2C: an electrical pre-scan (own pull-up / needs ours / held low / floating, per channel, before any bus traffic), then a full address sweep (0x08-0x77) that reports every address that ACKs.
  • 1-Wire: reset pulse, presence detection, and a ROM read attempt if a device answers.
  • UART probe: send an arbitrary 1-16 byte sequence at any of 8 standard bauds (9600-921600) and listen for a reply. Three modes: single byte (including a full 0x00-0xFF sweep), a specific multi-byte sequence, or a built-in list of common device wake-up commands (AT-commands, NMEA queries, and similar). Tries both probe-pin orderings, since the host doesn't know which physical line is the target device's RX.
  • Host-side decoders and a ranked classifier for I2C, UART, 1-Wire, PWM, and analog (non-digital) signals, run against whatever is in the waveform view - live or loaded from a CSV.
  • A PySide6 + pyqtgraph host GUI: live or offline waveform view with pan/zoom/cursor/two draggable markers, a log-scale/zoomable pulse-width histogram, CSV export, decoded-transaction and classification panels, and a "protocol hint" panel that reads the dominant pulse width and reports the closest matching clock/UART baud/1-Wire pulse - timing arithmetic only, not protocol decoding.

What's verified on real hardware

  • I2C: the electrical pre-scan and address sweep found a real MLX90614 infrared thermometer at its documented address 0x5A, and a Raspberry Pi Pico test device at 0x42.
  • UART probe: single-byte sweep, multi-byte sequences, and the common-commands list, tried across all 8 standard bauds and both pin orderings, found the wake byte 0xA5 at 19200 baud on the Pico test device.
  • 1-Wire: reset and presence detection, verified both with a device connected and with nothing connected.
  • Host-side decoders and classifier for I2C, UART, and 1-Wire: tested against real captured waveforms, not just synthetic ones.

One thing worth stating plainly: the 1-Wire ROM read came back as all-FF every time in testing, which isn't a valid family code. Identification relies on presence detection, not on the ROM read returning usable data.

Host software

Requires Python 3, plus the packages in requirements.txt:

text
pip install -r requirements.txt

Then run:

text
python3 host/host.py [serial-port]

host/protocol.py holds the wire-format parser (framing, checksums, resync), host/hint.py the protocol-hint arithmetic, host/byteseq.py the UART probe's byte-sequence field parsing, and host/classify.py plus the host/decode_*.py files the decoders. All of these are plain Python with no GUI dependency, and each has a standalone test script (host/test_*.py) that runs without any hardware attached:

text
python3 host/test_frame_parser.py
python3 host/test_byteseq.py
python3 host/test_decoders.py
python3 host/test_hint.py


The app, disconnected. Sidebar on the left (connect, capture, protocol mode), waveform view top right, histogram/stats/hint/results bottom right.

The sidebar's Protocol dropdown switches between I2C, UART, 1-Wire, and Passive listen - each mode shows only the controls it needs. Results for whichever mode is active show up in the Protocol Results box, next to the histogram and hint.

Serial protocol

Every message from the FPGA is [MARKER][PAYLOAD][CHECKSUM], checksum being the 8-bit sum (mod 256) of the marker plus every payload byte. On a checksum mismatch the host resyncs by exactly one byte, not by skipping the frame's whole claimed length, so a real frame overlapping that window is never lost.

Commands to the FPGA are single bytes, no framing needed (it's a low-rate trusted control channel):

CommandEffect
S / Xstart / stop capture
Rreset timestamp counter and overflow flag
Vrequest a status reply
A/a, B/bchannel A / B pull-up on / off
N / Wnormal / swapped SDA-SCL pin mapping
Erun the electrical pre-scan
Irun the I2C address sweep
O1-Wire reset (+ ROM read if a device answers)
K + 1 byteset the probe-UART baud rate (0-7, one of 8 standard rates)
U + length + datasend 1-16 bytes over the probe-UART, then listen for a reply
F / fswap / normal probe-UART TX-RX pin roles

E, I, O, and U are long-running: their ACK is deferred until the operation they kicked off actually finishes, not when the command byte arrived. Everything else acks immediately. Any unrecognised command, or a long-running command sent while another one is still busy, gets an ERROR reply instead of being silently dropped.

Hardware

A shield that sits on top of the Tang Nano 9K. It has two probe channels and a 4-pin socket for the device under test.

Each part on the probe lines is there for a specific reason:

  • 220 ohm series resistor on each probe line. The tool is meant to connect to devices whose voltage and drive strength are unknown, so the series resistor limits current if something unexpected is being driven.
  • Schottky clamp diodes (1N5819) to 3.3V and GND on each probe line, so an over-voltage device can't reach the FPGA pin directly. Schottky specifically, not an ordinary diode: an ordinary diode clamps around 4.0V, which is already too high for this FPGA's inputs.
  • 4.7k pull-ups switched by P-channel MOSFETs (IRF4905). This is the part that needs explaining: finding out whether an unknown device already has its own pull-up means disconnecting ours first and seeing what the line does on its own. A fixed pull-up would make that measurement impossible, so it's switchable instead.
  • 10k gate-to-source resistors on those MOSFETs, so they stay off during the few milliseconds after power-up while the FPGA is still loading its bitstream and its pins are floating.

The KiCad schematic itself uses generic library symbols for these (a plain diode symbol, a generic P-MOSFET symbol) rather than naming the exact parts - 1N5819 and IRF4905 are what's actually populated on the board, not what the schematic's own value fields say.

Pin assignments

From tangnano9k.cst:

Tang Nano 9K pinSignalNotes
52clk27MHz input clock
3btn1active low
4btn2active low
17uart_txto host (USB-serial RXD)
18uart_rxfrom host (USB-serial TXD)
54ctrl_bactive low. Pulling low turns on channel B's pull-up MOSFET
55ctrl_aactive low. Pulling low turns on channel A's pull-up MOSFET
56probe_aprobe channel A
57probe_bprobe channel B
10, 11, 13, 14, 15, 16led[0..5]status LEDs

Active low on ctrl_a/ctrl_b because they drive P-channel MOSFETs, which turn on when their gate is pulled low.

Using it

Plug the unknown device into the 4-pin socket. A 4-pin device fills all four positions. A 3-pin device leaves probe_a empty.

Building and flashing the FPGA side

Built with the OSS CAD Suite toolchain (Yosys, nextpnr-himbaechel, Apycula's gowin_pack, openFPGALoader) against a Sipeed Tang Nano 9K (GW1NR-9C).

text
yosys -p "read_verilog rtl/*.v; synth_gowin -top top -json top.json"
nextpnr-himbaechel --device "GW1NR-LV9QN88PC6/I5" -o family=GW1N-9C -o cst=tangnano9k.cst --json top.json --write top_pnr.json
gowin_pack -d GW1N-9C -o top.fs top_pnr.json
openFPGALoader -b tangnano9k -f top.fs

Device utilisation for the current design (from the same toolchain, this build):

ResourceUsedAvailable
LUT431348640 (36%)
DFF13016480 (20%)
BSRAM226 (7%)
DSP (ALU54D / MULT*)010 (0%)

Zero DSP blocks used is deliberate, not incidental - the design avoids every runtime multiply/divide (a known Apicula/Gowin toolchain issue), so nothing ever gets mapped onto a DSP block in the first place.

Running the simulations

Every testbench in sim/ runs standalone with Icarus Verilog, no hardware needed:

text
iverilog -g2012 -o sim.vvp sim/edge_capture_tb.v rtl/*.v && vvp sim.vvp
iverilog -g2012 -o sim.vvp sim/i2c_scan_tb.v rtl/*.v && vvp sim.vvp
iverilog -g2012 -o sim.vvp sim/uart_probe_tb.v rtl/*.v && vvp sim.vvp
iverilog -g2012 -o sim.vvp sim/uart_tb.v rtl/*.v && vvp sim.vvp

I2C scanning

Click Scan I2C in the host app. It runs two steps automatically:

  1. Electrical pre-scan - before any bus traffic, each channel is classified purely by watching pull-up behaviour: has its own pull-up (reads high with ours off), needs ours (low/floating with ours off, clean high once ours switches on), held low (still low even with our pull-up on - a device driving it, or a short), or floating (unstable with no pull-up at all - nothing connected).
  2. Address sweep - START, address + write bit, check for ACK, STOP, for every address 0x08-0x77. Every address that ACKs gets reported; an empty result is reported as "No devices found", not left ambiguous.

Which probe is SDA and which is SCL is not auto-detected - it's a host-side toggle (SDA/SCL mapping: Normal / Swapped). If a scan against a known-good device finds nothing, flip the mapping and scan again.


A real scan against a device at 0x42.

UART probe

Set a baud (there's no default - the dropdown starts on "Select baud..." so a probe run can't silently happen at the wrong rate), pick a probe type, and click Start Probe. Single byte mode can sweep all 256 values; multi-byte mode needs an exact sequence typed in (hex, quoted ASCII, or a mix) - it is not brute-forced, since two bytes is already 65,536 combinations per baud. Every attempt tries both pin orderings and logs whether the reply's framing looked valid, so a reply from listening at the wrong baud (broken framing) isn't confused with a real one.


A single-byte sweep at 19200 baud, two hits found.

1-Wire

Click Reset in the 1-Wire mode. Sends a reset pulse, checks for a presence pulse, and attempts a 64-bit ROM read if something answers. In testing, the ROM read has come back as all-FF rather than a real code - presence detection is what identification relies on here, not the ROM read.


A reset against a real device: presence detected, ROM code read back as all-FF.

Known limitations

  • Only single-ended protocols are in scope. CAN and RS-485 are differential and need a transceiver, so they're not supported.
  • A completely unpowered unknown chip can't be identified from the outside. This tool only works on devices that respond when probed.
  • There are two probe channels, so SPI (which needs more lines) isn't reachable.
  • The protocol hint only measures timing. A 100 kHz clock could be I2C or SPI - the hint says "consistent with", it does not identify the protocol.
  • Multi-byte UART commands are not brute-forced. Two bytes is 65,536 combinations per baud, three is 16 million - only the exact sequence typed in (or picked from the built-in common-commands list) is tried.


The Tang Nano 9K wired up on a breadboard while testing against a real MLX90614.

Parts

19
QtyValueFootprintReferences
4DDiode_THT:D_A-405_P7.62mm_HorizontalD1, D2, D3, D4
2100ΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR7, R8
210KΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR5, R6
2220ΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR3, R4
24.7KΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R2
2Q_PMOS_GDSPackage_TO_SOT_THT:TO-220-3_VerticalQ1, Q2
1100nFCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC1
110µFCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC2
1TangoNano9k_bottomSideConnector_PinSocket_2.54mm:PinSocket_1x24_P2.54mm_VerticalJ2
1TangoNano9k_topSideConnector_PinSocket_2.54mm:PinSocket_1x24_P2.54mm_VerticalJ1
1TheSensorConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ3

Similar boards

  • 2 layers43.9 × 27.7 mmTcd1304-4v, the printed circuit board in 3D

    Tcd1304-4v

    OpnTec/open-spectrometer-hardware

    Open source VIS spectrometer

    19 parts1.5k
  • 2 layers50 × 60 mmDebate Device, the printed circuit board in 3D

    Debate Device

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    19 parts915
  • 2 layers102.9 × 96.7 mmISA adapter, the printed circuit board in 3D

    ISA adapter

    polpo/picogus

    Emulation of ISA sound cards and CD-ROM on Raspberry Pi Pico (GUS, SB/Adlib, MPU-401, Tandy, CMS, Panasonic CD-ROM) with USB mouse/joystick support

    19 parts805
  • 2 layers60 × 39 mmPs2usb, the printed circuit board in 3D

    Ps2usb

    rasteri/HIDman

    Adapting USB devices to work on old computers

    19 parts432
  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers80 × 80 mmGB BRK CPU G1, the printed circuit board in 3D

    GB BRK CPU G1

    Gekkio/gb-hardware

    Game Boy -related custom hardware by gekkio

    19 parts379CC-BY-4.0
  • 2 layers25.4 × 25.4 mmIna169, the printed circuit board in 3D

    Ina169

    Ardumower/ardumower

    Develop an open source robotic lawn mower (HW+SW reference platform)

    19 parts282
  • 2 layers58.4 × 28.6 mmNew rele, the printed circuit board in 3D

    New rele

    zmaker/arduino_cookbook

    gli sketch del nuovo progetto Arduino Cookbook e dei video di YouTube

    19 parts269

Questions

How big is the PCB board and schematic PCB?

It measures 108.5 × 34.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PCB board and schematic use?

19 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the PCB board and schematic KiCad files?

From the iceyaseen/fpga-bus-identifier repository on GitHub, at the commit this page was made from: the board is PCB/PCB_board_and_schematic/PCB_board_and_schematic.kicad_pcb and its schematic PCB/PCB_board_and_schematic/PCB_board_and_schematic.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the PCB board and schematic design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).