Build an X68000 USB Keyboard Adapter with a Raspberry Pi Pico
The Sharp X68000 remains one of the most interesting Japanese home computers of the late 1980s and early 1990s. Its distinctive tower case, capable custom hardware and excellent games attract collectors, preservationists and people who simply enjoy using old computers as working machines. A missing or unreliable keyboard, however, can make an otherwise healthy system difficult to operate.
A Raspberry Pi Pico offers an affordable way to connect a modern USB keyboard to an X68000. The board is inexpensive, widely available and powerful enough to read USB HID keyboard reports, translate key events and transmit the signals expected by the computer. The project also provides a useful bridge between contemporary electronics and period hardware.
This is not a matter of connecting USB wires to the X68000 keyboard socket. USB uses a host-and-device system, while the X68000 expects a proprietary keyboard interface with its own electrical levels, packet format and timing. The adapter must therefore perform three jobs: supply the keyboard, act as a USB host and emulate the original keyboard protocol.
Careful construction matters, especially when working with rare computers in Australia. A Pico, a small interface board and a salvaged keyboard can cost less than a replacement X68000 keyboard, but a wiring mistake can damage an irreplaceable machine. Work from measured signals and documented pinouts rather than relying on connector appearance.
Choosing The Right Adapter Architecture
The simplest design uses a Raspberry Pi Pico or Pico W, a USB host-capable firmware stack, a regulated 5-volt supply for the USB keyboard and a level-shifting interface for the X68000. The Pico reads standard USB HID reports, converts them into X68000 scan codes and sends the resulting bytes through the computer’s keyboard connector.
The Pico’s onboard USB connector is normally configured as a USB device. A USB keyboard is also a device, so the Pico cannot communicate with it by using an ordinary USB device connection. A host implementation such as a PIO-based USB host library is required, along with a suitable USB socket, VBUS supply and D-plus/D-minus wiring. Some builders use a second USB connector mounted on a small carrier board to make the host connection clearer and stronger.
A second design uses a dedicated USB host module or a small microcontroller that already supports host mode. This can simplify firmware, though it adds cost and another communication link. For a compact enthusiast build, the Pico remains attractive because its programmable I/O hardware can handle precise timing and its firmware can be updated without replacing a chip.
Understanding The X68000 Keyboard Interface
Before writing code, identify the exact keyboard protocol used by the target X68000 model. The keyboard connector carries power, ground and communication signals, but the pin arrangement and signalling details must be confirmed from reliable service information or measurements. Mini-DIN connectors can look similar while having completely different pin numbering conventions.
Many X68000 keyboard converters emulate an asynchronous serial keyboard link, with scan-code messages travelling between the keyboard and computer. The keyboard may also receive commands for status indicators such as Caps Lock. Baud rate, bit order, idle state and command framing should be treated as parameters until verified. A logic analyser is far safer than guessing from a random pinout found in a forum post.
Record the behaviour of a known-good keyboard if one is available. Observe the power rail, idle voltage and data transitions while pressing ordinary keys, modifier keys and keys that generate repeated events. Pay attention to make and break codes: the computer needs to know when a key is pressed and released, rather than receiving only a stream of characters.
Preparing The Hardware
A practical adapter can be built around a Pico, a USB-A socket or short USB host lead, a 5-volt regulator or protected supply, a bidirectional level shifter where required, and the correct X68000 plug. The host-side USB port must provide stable 5 volts with enough current for the chosen keyboard. RGB gaming keyboards can draw considerably more power than a basic office keyboard, so a modest wired keyboard is preferable.
Keep the Pico’s GPIO pins within their voltage limits. If the X68000 interface is a 5-volt signal, use a proper logic-level translator or a carefully selected open-drain arrangement. Do not assume that a resistor divider is suitable for a bidirectional serial line. Some keyboard interfaces rely on pull-ups and shared signalling, in which case the adapter must release the line rather than actively drive it high.
A separate 5-volt USB supply can feed the keyboard while a regulator provides 3.3 volts for the Pico. Tie the grounds together at a controlled point, add local decoupling near the Pico and protect the external connector against accidental shorts. A small fuse or resettable polyfuse on the keyboard supply is sensible insurance when the unit will be used at conventions or moved between systems.
Australian builders can source Pico boards through electronics suppliers in Sydney, Melbourne and Brisbane, while USB sockets and level shifters are often cheaper through the Australian eBay market than through overseas single-item orders. Check that imported mains-powered adapters carry the appropriate Australian compliance markings. The low-voltage adapter itself is safer to assemble than a mains power supply, but mains repairs should remain separate from this project and follow local electrical safety requirements.
Writing The USB Keyboard Firmware
The firmware should begin by mounting the USB keyboard and parsing standard HID boot-protocol reports. A typical report contains modifier bits plus an array of currently held key usages. The adapter compares each new report with the previous one, identifies newly pressed keys, detects released keys and generates the corresponding X68000 events.
Use a translation layer rather than placing conversion logic throughout the USB callback. One table can map USB HID usages to X68000 scan codes, while separate rules handle modifiers, lock keys, keypad functions and special Japanese keys. This makes it easier to support several keyboard layouts and to correct an individual mapping without disturbing the protocol driver.
Australian users will often have a standard US-layout USB keyboard because it is easy to find locally, though Australian retail keyboards may carry familiar Australian legends and a different physical arrangement around the Enter, backslash and symbol keys. USB HID reports describe physical key usages rather than the printed character, so decide whether the adapter should preserve physical positions or imitate an original Japanese X68000 layout.
Key rollover and ghosting can expose firmware weaknesses. Begin with a simple wired keyboard that sends boot-protocol reports, then add support for more complex HID devices if necessary. Reject malformed reports, clear stuck keys after a USB disconnect and provide a clean reinitialisation path when the keyboard is unplugged and reconnected.
Translating Scan Codes Reliably
The X68000 expects keyboard events in a particular sequence, so timing is as important as the numerical code. Keep USB report handling separate from serial transmission. A small event queue allows the USB task to continue running while the protocol task sends bytes at the correct rate. This also prevents a burst of simultaneous key presses from being lost.
Handle modifier keys explicitly. Shift, Control, Alternate and the X68000-specific special keys may have scan codes that differ from ordinary character keys. Lock keys can require state tracking because the keyboard and computer may exchange indicator commands. If the original keyboard supports LED feedback, implement it after basic typing works rather than allowing LED handling to complicate initial debugging.
Use a logic analyser on the Pico’s output before connecting the adapter to a valuable computer. Confirm idle levels, start and stop bits, byte order, inter-byte gaps and release events. A serial terminal configured for the wrong baud rate can make a correct signal look meaningless, so decode the waveform manually when necessary.
It is useful to include a diagnostic mode that prints USB usages and translated codes over a separate serial connection. Disable that output on the X68000 data line itself. A USB keyboard adapter that works for letters but fails on Escape, function keys, keypad input or Japanese-specific controls is usually suffering from an incomplete mapping rather than a hardware fault.
Wiring And First-Power Testing
Make the first tests with the X68000 disconnected. Confirm that the USB keyboard enumerates, that the Pico remains stable during key presses and that the host supply does not sag when Caps Lock or other LEDs activate. Measure the voltage at the keyboard socket end of the cable, not just at the regulator output.
Then connect the adapter to a breakout or sacrificial extension cable if possible. Verify ground and power first, followed by the data line or lines. Never rely on the orientation of a plug viewed from the cable side; connector pin numbering often reverses when viewed from the mating face. Mark the cable and document the orientation in the enclosure.
The first live test should use a current-limited supply or an inline protection device. Watch for excess current, heat, unexpected resets and a keyboard that types continuously without a key press. If the computer fails to respond, disconnect promptly and return to signal measurements rather than repeatedly cycling power.
A logic analyser is especially valuable when the adapter works intermittently. Noise from a long unshielded lead, a weak pull-up or poor ground routing may produce occasional invalid codes. Keep the USB host wiring short, route the X68000 signal away from switching regulators and place the level translator close to the external connector.
Enclosure, Layout And Everyday Use
A 3D-printed case can hold the Pico, USB socket and X68000 cable in a compact desktop adapter. Leave access to the Pico’s programming connector and provide strain relief for the keyboard and computer leads. A labelled status LED can show USB enumeration or protocol activity, but it should not be bright enough to distract from a CRT display in a dark room.
A lightweight modern keyboard is convenient for desk use, while a period-looking keyboard can make the setup feel more authentic. Avoid wireless keyboards during initial development because their receivers and sleep modes introduce another layer of troubleshooting. Wired USB keyboards are easier to enumerate and usually behave predictably after a reset.
Australian heat is worth considering in an enclosed case. A Pico consumes little power, but a poorly ventilated box placed beside an X68000 power supply can become warm during long gaming sessions. Keep the adapter away from repaired switch-mode supplies and use a tested external USB power source. In states where electrical work is regulated, do not modify a mains lead or enclosure in a way that exposes live conductors.
The adapter also makes a useful preservation tool. It lets an X68000 remain usable when an original keyboard is stored safely, and it provides a practical fallback for demonstrations, software testing and repairs. Project notes, repair references and related hardware work are collected on X68K.NET, which can help place a new converter within the broader preservation effort.
Troubleshooting And Further Compatibility
If the USB keyboard is not detected, check host mode, VBUS, pull-down or pull-up requirements and the library’s supported HID device types. Some compact keyboards use hubs internally, while others expose multimedia interfaces before their standard keyboard interface. Start with a basic wired model known to work with the chosen host stack.
If the keyboard enumerates but the X68000 does nothing, inspect the level conversion and protocol timing. A correct USB report proves only that the first half of the adapter works. Compare the Pico’s transmitted waveform with a recording from an original keyboard, paying close attention to polarity and the timing between successive bytes.
Wrong characters usually indicate a mapping problem. Missing key releases suggest that the report-difference logic is incomplete, while stuck modifiers can result from failing to clear state after a USB disconnect. Test every function row, the keypad, cursor keys, both Shift keys, Control, Alternate, Caps Lock and combinations used by the software you intend to run.
For repair histories, replacement parts and community references, the X68000 links directory is a useful starting point. Australian owners may also find parts through local retro-computing groups or Gumtree, although condition varies widely. Treat second-hand keyboards and unknown USB power supplies as untested equipment until their cables, insulation and output voltage have been inspected.
| Adapter approach | Strengths | Limitations | Best use |
|---|---|---|---|
| Pico with PIO USB host | Low cost, flexible firmware, compact | Requires host software and careful wiring | Custom enthusiast build |
| Pico plus USB host module | Easier USB integration | Larger and more expensive | First prototype |
| Dedicated commercial converter | Ready to use, usually tested | Less adaptable, may be scarce | Immediate everyday operation |
| Original X68000 keyboard | Correct feel and protocol | Expensive, fragile and difficult to replace | Authentic restoration |
A well-designed Raspberry Pi Pico converter gives an X68000 a practical modern input option without changing the computer internally. Build the host section first, verify the keyboard protocol with instruments, protect every 5-volt signal and keep a written pinout with the finished unit. Share tested firmware, mappings and measurements with the X68000 community so future repairs become easier, then use the adapter to keep your machine active rather than merely stored.
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.
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.