Build an X68000 keyboard protocol analyser with a Pico

The Sharp X68000 keyboard speaks a proprietary serial protocol, so its traffic cannot be captured correctly by treating the connector like a modern USB or AT keyboard. A Raspberry Pi Pico can sit beside the machine, observe the data line and any clock line, and preserve each transition as a timestamped record. That turns an opaque cable into evidence you can compare, decode and reuse when diagnosing keyboard faults, testing emulators or studying the platform’s hardware.

A useful X68000 keyboard protocol analyser has two layers: hardware that samples the interface without disturbing it, and software that recognises framing, scan-code values and modifier or release states. The Pico handles the first layer particularly well, while a small Python program can turn raw captures into readable key events. This split also keeps the experiment open to revision, because a questionable timing assumption can be corrected without recapturing every key press.

Why the keyboard link needs its own analyser

Start by confirming what the interface actually is. The X68000 keyboard and its connected pointing device use a legacy serial exchange, with the keyboard controller presenting codes rather than exposing a simple row-and-column matrix. That makes a general keyboard sniffer useful for raw bits but insufficient for finished events. The proprietary frame boundaries, electrical levels and code meanings must be established from the machine’s documentation and observed behaviour.

Capturing this traffic solves practical problems. A replacement keyboard may appear dead while still producing valid codes; an emulator may expect slightly different release or modifier semantics; a home-built interface may work intermittently because its clock and data timing are marginal. The analyser lets you compare those cases without replacing good hardware. The related trackball interface project is a useful example of treating an X68000 input peripheral as a measurable protocol rather than a black box.

Keep the first goal modest: capture identical raw traces for a known key and a known non-key state. Once that is repeatable, decoding becomes a controlled task. Trying to label every value immediately encourages assumptions borrowed from PC/AT keyboards, which is precisely where many diagnostic dead ends begin.

Map the interface without guessing

Photograph the plug, note every pin orientation, and consult a service manual or continuity-tested documentation for the keyboard board. Identify ground, the keyboard’s supply and the serial data or clock lines rather than relying on a crowd-sourced pin drawing. The mouse path may share the same cable, so trace it too if your experiment includes pointer input.

A low-cost logic analyser is valuable during this stage because it shows idle levels, frame shape and transitions without requiring the Pico firmware to be correct first. Make a test capture at several time bases, then compare it with a keyboard known to work on the X68000. If the analyser cannot see the signal, check common ground, probe reference voltage and input thresholds before suspecting the protocol.

Never feed an unknown voltage into a Pico GPIO. The RP2040’s GPIO is not 5-volt tolerant, while the X68000’s keyboard circuitry may use 5-volt logic. Use a divider or a buffer explicitly rated for the input voltage and 3.3-volt output, with a common ground between the keyboard and Pico. For an initial low-speed capture, a 10-kilohm resistor from the signal to the GPIO and a 20-kilohm resistor from the GPIO to ground can bring 5 volts to the Pico’s safe range, but verify it against the measured signal.

Prepare the Pico and capture clean timing

The Pico needs few parts: the board, a data-capable USB cable, a small breadboard, short jumper leads, a suitable level translator, and a reference keyboard plus access to an X68000 or emulator. A push button can trigger captures, while a status LED can show the armed state. Keep firmware, decoding scripts, wiring diagrams and sample traces in version control so another hobbyist can reproduce the instrument. Never use a Pico power pin to substitute for the keyboard’s supply.

Australian distributors such as element14 Australia, RS Components and Mouser can supply common logic parts, while Australian eBay listings and specialist salvage dealers may help with obsolete connectors; allow more time and budget for Japanese-market replacements. On a typical Australian desk, a USB charger or power bank with a suitable data cable can conveniently power the Pico, but never substitute it for the X68000’s own supply.

For timing-sensitive work, program the RP2040 Pico SDK in C or C++. PIO state machines can sample selected lines and move data through DMA, leaving the processor to package events with timestamps. A USB CDC interface can accept commands such as arm, start, stop and dump, then export a compact CSV or binary file. Keep the capture in RAM only long enough to transfer it, and monitor for overflow; a silent buffer wrap would corrupt the very timing evidence you need.

Simpler MicroPython experiments are fine for learning the protocol, but interrupt jitter and host scheduling make them weaker as definitive timing tools. Use them to validate a hypothesis, then confirm critical results with Pico firmware. Record the firmware version, Pico clock settings, sample rate and decoder version with every capture; otherwise a trace cannot be reproduced reliably.

Compare the practical decoding options

Several instruments can reveal the serial exchange, but each answers a different question and changes the cost of interpretation. Choose the tool by whether you need raw timing, decoded X68000 codes or a repeatable low-cost platform.

Instrument Timing visibility X68000-specific decoding Main advantage Main limitation
Pico with custom firmware Good, subject to firmware and buffer design Through your own decoder Cheap, flexible and reusable Requires embedded development and careful capture design
Entry-level logic analyser Usually excellent for short bursts Usually manual Immediate view of signal shape Few portable controls; long captures may need special software
Commercial protocol analyser Varies by model Often generic serial only Strong triggering and export features Cost may exceed a hobby project
Oscilloscope Best electrical detail Manual or scripted Shows rise time, noise and analogue integrity Slow for exploring many key events

For most X68000 owners, the Pico becomes the long-term instrument, while a logic analyser remains the diagnostic mentor. The Pico can sit beside the computer, capture named sequences and integrate with scripts. That makes it easier to compare a bare-metal machine in a Melbourne garage with an emulator running on a laptop, or to gather a second trace from a keyboard restored in Brisbane.

Cost should include your time rather than only the bill of materials. An A$40 analyser that is understood today may be more useful than sophisticated hardware whose export format never fits the X68000’s code set. Likewise, a Pico program that logs only clean make events may be less informative than one that preserves every edge. Decide whether the artefact is a teaching tool, a fault finder or a research dataset, then optimise for that job.

Decode the proprietary keyboard stream

Begin decoding with a controlled sequence: idle, one unmodified key press, release, one modifier, a modified combination, a held key, then arrows, function keys and the numeric keypad. Capture each action twice. A repeat that differs between runs points to timing noise; a repeat that always differs points to a missing state or a mistaken clock assumption. Identify keys by their printed legends and positions because the X68000’s Japanese layout does not match an Australian PC keyboard.

From the traces, determine the idle state, whether a separate clock is used, where frame boundaries fall, bit order and whether parity or stop bits exist. Calculate the bit period and apparent baud rate rather than accepting a published value without comparison. The keyboard’s proprietary stream should not be forced into a standard UART or ASCII interpretation because a scan-code byte may happen to fall in printable range. Instead, group frames by stable boundaries, read the data bits, and list unique byte values with the action that produced each one. This is protocol reverse engineering: establish only what the captures support, then revise the decoder as evidence accumulates.

The X68000 scan-code set includes distinctions that matter to an emulator: a normal key can carry modifier information, while release may be encoded through a flag or a distinct returned value. Confirm those meanings by pressing and releasing keys in known combinations and by comparing with an emulator’s keyboard documentation. Publish a mapping with confidence notes, because an observed correlation is not yet proof of the controller’s original firmware semantics.

Build a repeatable test workflow

Turn the analyser into a diagnostic instrument rather than a one-off display. A Python utility can read Pico output, detect frames, print human-readable events and export JSON alongside the raw capture. A small mode that compares two traces can highlight changed bytes, extra delay or missing release codes. Naming each capture after the keyboard, firmware revision and test action makes later comparisons much faster.

Validate non-invasively wherever possible. The safest test arrangement observes the keyboard while the original controller also receives it. If you later build a keyboard emulator, disconnect the real keyboard and use a separate test rig before connecting an output line to the X68000. Two active drivers on one data line can create levels that neither device expects, and the symptom may look like random corruption rather than electrical contention.

Indicator lamps and other simple repairs deserve the same evidence-led approach. The careful component substitution documented in LED replacement mods for a Nikon Coolscan illustrates why checking the original circuit and LED type matters: a visually similar part can have different voltage, polarity or current requirements. For a keyboard status light, measure first and use a suitably rated replacement, especially when the original circuit is part of the preserved system.

Keep the analyser safe and useful

Keep the analyser read-only when working with an original machine, power the Pico from USB, and avoid connecting Pico outputs to keyboard inputs. In Australia, many imported Japanese X68000 units expect 100-volt mains, while the local supply is 230 volts at 50 hertz; verify the model’s rating and use a correctly sized, preferably isolating step-down arrangement rather than an improvised mains adapter. A product sold with mains power should meet Australian electrical safety and Regulatory Compliance Mark requirements, while spare parts sold online remain subject to the Australian Consumer Law. Electrical work deserves the same care as any other exposed mains project.

Capture synthetic text, never passwords, PINs or live personal correspondence. A keyboard trace can contain personal information, so store it as carefully as other personal data and consider the Privacy Act 1988 when publishing raw captures. Build the read-only capture rig, record a known sequence on your X68000, decode one frame completely, and publish the wiring, firmware and sample file on X68K.NET with clear documentation. That single verified frame becomes the foundation for every later keyboard repair, emulator adaptation and preserved protocol note.

Nereid-X Expansion Board

A personally-produced LAN+USB+Memory expansion board for Sharp X68000 series computers. Multiple production runs were offered, including a final batch and a later revival reproduction run.

Power Supply Repair

X68 power supply repair and modification services were offered by the site owner, with documentation shared through diary entries spanning 2001–2006.

Server & Networking

Notes on FreeBSD administration, ISP changes, server migration, and networking topics. The site itself ran on FreeBSD with the hns diary system and Namazu search integration.

A two-ink risograph print in muted slate-blue and charcoal on off-white paper, showing a stylized desktop computer monitor beside a circuit board with soft geometric trace lines, conveying a calm retro-computing workshop atmosphere. A two-ink risograph print in deep purple and dark grey on cream stock, depicting a compact expansion card with connector ports and subtle Japanese technical annotations, evoking a hobbyist electronics bench. A two-ink risograph print in teal and charcoal on warm white paper, showing a server rack silhouette with soft network-line motifs and a small weather icon, suggesting a personal server room corner.

Get in touch

X68K.NET connects Sharp X68000 enthusiasts through community links and shared projects. Reach out with questions about the Nereid project or X68 resources.