Connecting a PS/2 keyboard to the X68000 with a custom adapter
The Sharp X68000 remains remarkably usable when its original keyboard is present, but replacement keyboards can be difficult to find and expensive to ship. A PS/2 keyboard adapter offers a practical alternative: it translates the electrical and protocol requirements of a modern or readily available keyboard into signals the X68000 understands.
This project is more involved than changing a connector. The X68000 keyboard interface is a proprietary serial connection, while PS/2 uses its own clocked bidirectional protocol and scan-code system. A reliable converter therefore needs suitable level handling, firmware, a carefully verified pinout, and a way to reproduce the special keys used by Human68k software.
A custom adapter is also a useful preservation project. It keeps an original computer operational without modifying the motherboard, makes testing easier during hardware repairs, and can be built around inexpensive microcontroller boards. The safest approach is to treat the adapter as a protocol bridge rather than assuming that the X68000 keyboard port behaves like a standard PC interface.
Understanding the two keyboard interfaces
A PS/2 keyboard communicates over separate clock and data lines, normally using open-collector signaling at 5 V. The keyboard generates clock pulses when sending data, and the host can inhibit the clock or request transmissions. Each key action is represented by a scan code, with make codes for pressing a key and break codes for releasing it. Extended keys use additional prefixes.
The X68000 keyboard connection also carries serial keyboard data, but its framing, command behavior, and key codes are different. The computer expects the original keyboard to identify key transitions in the format used by Sharp hardware and Human68k. A PS/2 keyboard cannot be connected directly by matching clock and data wires because the resulting bit stream has the wrong timing and meaning.
The physical connector must be verified for the particular X68000 model and cable being used. Different revisions and regional accessories deserve careful documentation, and connector orientation can be deceptive when viewed from the plug side rather than the socket side. Before applying power, identify ground and supply pins with a multimeter and confirm signal behavior with an oscilloscope or logic analyzer.
Do not rely on a pinout copied from an unrelated keyboard interface. Check continuity from the computer’s connector, inspect the cable, and compare measurements with service information where available. A mistake on a power pin can damage the computer, the keyboard, or the converter in seconds.
Choosing the adapter hardware
A small microcontroller is the central component of the converter. Suitable platforms include an ATmega-based board, a compact ARM board, or another 5 V-tolerant controller with interrupt support and stable timers. The important features are dependable edge detection, enough program memory for a translation table, and GPIO pins that can emulate open-collector outputs.
The PS/2 side should generally use open-drain or open-collector behavior rather than driving the clock and data lines high. Pull-up resistors return the lines to the idle state, while the keyboard and host pull them low as required. If the microcontroller operates at 3.3 V, use a proper level-shifting arrangement for any X68000 signal that may reach 5 V. A resistor network is not automatically safe for bidirectional open-collector lines.
Power can come from the X68000 keyboard port if its available current and voltage are confirmed, but an external regulated supply may be preferable during development. Add local decoupling near the microcontroller, provide a common ground, and protect the input from accidental static discharge. A resettable fuse or modest series protection can limit the consequences of a wiring error without interfering with normal operation.
The physical design should include a removable test connector, status LED, and access to programming pins. A small enclosure with strain relief is safer than a loose circuit board hanging from the computer. If the adapter will be used with several keyboards, make the PS/2 socket and X68000 cable replaceable so that a damaged connector does not require rebuilding the whole unit.
Translating scan codes into X68000 key events
The firmware needs three distinct layers. The first receives PS/2 frames and validates their parity and stop bit. The second converts make and break scan codes into an internal representation of physical keys. The third emits the corresponding X68000 codes and manages any host-side handshake or response required by the computer.
Use a state machine instead of blocking delays. PS/2 sequences can include prefixes such as extended-key and break indicators, and a keyboard may send responses during initialization. The firmware should tolerate a resend request, ignore unsupported LED commands safely, and recover from a malformed frame by returning to an idle state after a timeout.
A translation table is more flexible than a long collection of conditional statements. It can map ordinary letter, number, and punctuation keys directly while assigning special handling to modifiers, cursor keys, function keys, and the X68000-specific Help, Undo, CLR, and accelerator keys. The table should distinguish left and right modifiers where the original software does so.
Some PC keyboards lack a physical equivalent for important X68000 keys. The adapter can reserve combinations such as an unused function-key chord, but this should be documented and configurable. A small configuration mode could let the user select mappings for the Graph, Code, kana, and other system keys without recompiling the firmware.
Before sending a key event, confirm the X68000-side electrical idle state and timing. If the original keyboard protocol includes commands from the computer, the converter must listen as well as transmit. A one-direction-only design may work for basic typing but fail during boot, keyboard initialization, LED control, or software that scans the keyboard more closely.
| Area | PS/2 keyboard | X68000 keyboard | Adapter responsibility |
|---|---|---|---|
| Physical connection | Usually a 6-pin mini-DIN socket | Proprietary Sharp keyboard connector | Provide correct wiring and strain relief |
| Signaling | Clocked bidirectional serial data | Proprietary serial keyboard protocol | Translate timing and frame format |
| Key representation | PC scan codes with prefixes | X68000-specific key codes | Maintain a complete conversion table |
| Electrical behavior | Open-collector clock and data | Verify from the hardware and documentation | Use safe pull-ups and level compatibility |
| Special keys | Standard PC modifiers and function keys | Extra system and Japanese-layout functions | Add mappings or configurable chords |
| Initialization | Keyboard reset, IDs, LEDs, resend | Computer-specific startup exchange | Implement required commands and responses |
| Testing | PC or USB-to-PS/2 host can validate input | Real X68000 hardware is required | Test boot, typing, games, and utilities |
Wiring and firmware development
Start with a breakout cable rather than soldering directly to an original keyboard connector. Label every conductor and record resistance to the connector pins. With the computer switched off, identify ground and power. Then power the system without the adapter attached and measure the supply voltage under normal conditions. This staged procedure reduces the chance of confusing a signal line with a supply line.
The PS/2 socket should include the usual power and ground connections, but check the keyboard’s current demand. Older mechanical keyboards can behave differently from compact modern models, and some keyboards expect a host to control their LEDs. If the adapter does not implement LED commands, most keyboards will still type, although Caps Lock and related indicators may not reflect the computer’s state.
For development, log both interfaces independently. A logic analyzer capture can reveal whether PS/2 frames are arriving correctly before any X68000 translation is attempted. A second capture on the computer side helps establish bit order, idle levels, inter-byte gaps, and response timing. Keep a record of working traces from the original keyboard whenever possible; those captures are more valuable than assumptions based on similar computers.
Firmware should fail safely. If the X68000 side does not appear idle, do not continuously drive it. If the PS/2 keyboard sends an unexpected sequence, discard only the affected frame rather than locking the converter. Add a watchdog timer, bounded receive buffers, and a startup indication so that a failed initialization can be distinguished from a dead keyboard or missing power.
A serial debug output is useful during development, but it should be disabled or isolated in the finished unit. Debug wiring can introduce ground noise, interfere with timing, or accidentally connect a modern host directly to the vintage computer. Store diagnostic counters in memory only when needed, since repeated writes can wear out nonvolatile storage.
Testing with real software and hardware
Begin with a current-limited bench supply or a sacrificial test harness if the connector pinout is still uncertain. Confirm that the adapter does not pull the X68000 supply down and that no signal remains actively driven when the computer is turned off. Check voltage levels at idle and during transmission, then compare them with the original keyboard.
The first functional test should occur at the Human68k command prompt. Check every ordinary key, both shift keys, Control, Escape, Return, Backspace, space, punctuation, cursor keys, and function keys. Test press and release behavior separately: a key that types correctly but remains logically held can cause confusing failures in editors and games.
Next, exercise the keys that make the X68000 different from a typical PC. Japanese software may depend on kana, Graph, Code, Help, Undo, Insert, Delete, CLR, and the physical layout of the original keyboard. If a chosen PS/2 keyboard has a US or ISO layout, document differences in symbols and provide firmware mappings for functions that cannot be reached naturally.
Games are an important test because many use direct keyboard polling rather than relying entirely on normal operating-system input. Hold several keys at once, release them in different orders, and test rapid repeated presses. Ghosting in the PS/2 keyboard itself can appear as a converter problem, so compare results with a known-good keyboard that has rollover suitable for gaming.
A useful long-duration test is to leave the system at a prompt or inside a text editor for several hours, then reboot repeatedly. Watch for missed keystrokes, stuck modifiers, corrupted frames, and failures after warm-up. Record the keyboard model, firmware version, supply voltage, and cable length for each test so that intermittent faults can be reproduced.
Troubleshooting common conversion faults
No response usually points to power, ground, connector orientation, or an incorrect assumption about the X68000 pinout. Measure the voltage at the adapter while the keyboard is connected, not only with the keyboard unplugged. A weak supply or a connector with reversed viewing orientation can produce symptoms that resemble a firmware failure.
If the PS/2 keyboard works on a PC but not through the converter, capture its startup exchange. The adapter may be waiting for a reset response, mishandling the keyboard ID, or failing to release the clock line. Some keyboards are less tolerant of timing variations than others, so test with a basic older PS/2 model before drawing conclusions from a modern gaming keyboard.
Correct characters with broken modifiers usually indicate an incomplete translation table or incorrect handling of break codes. Check whether the original X68000 protocol expects a separate release event, a changed status byte, or a different code for modifier transitions. Do not fix this by adding arbitrary delays; delays may hide a state-machine error and create new problems with fast typing.
If keys repeat or remain stuck, inspect interrupt handling and line-release behavior. An input pin configured as a driven output can hold the bus low. Likewise, a firmware loop that waits indefinitely for a clock edge can prevent later release events from being processed. Watchdog recovery and timeout counters make these faults easier to diagnose.
For background on related repairs, modifications, and ongoing hardware work, the project notes collected in the X68K.NET diary provide useful context for approaching the machine as a living system rather than a static museum piece.
Building a dependable finished adapter
Once the prototype is stable, replace temporary jumper wires with a small PCB or a carefully assembled perfboard. Keep clock and data traces short, route them away from noisy switching regulators, and place pull-up resistors close to the receiving circuitry. Mark pin one, connector orientation, supply voltage, and the supported firmware version directly on the enclosure.
A socketed microcontroller or accessible programming header makes future key-map changes practical. Firmware updates may be needed when a previously unsupported special key is discovered, so avoid sealing the board permanently. Include a clearly labeled test point for ground and each serial signal; these points can save considerable time during later repairs.
Document the adapter as thoroughly as the circuit itself. Record the verified pinout, cable colors, logic levels, timing observations, keyboard compatibility, and known limitations. Include a warning that the connector is not a generic PS/2 port and should never be connected to an unrelated computer. Good documentation protects the original X68000 from well-intentioned but unsafe experimentation.
- Verify the X68000 connector pinout from the actual machine before applying power.
- Use open-collector signaling and confirm voltage compatibility on every bidirectional line.
- Capture an original keyboard’s traffic whenever possible before writing the translator.
- Test special keys, simultaneous presses, games, and long-duration operation.
- Publish the firmware version, wiring diagram, and known keyboard limitations with the adapter.
A PS/2-to-X68000 converter is most successful when it is treated as a preservation tool, not merely a cable adapter. Build the electrical interface conservatively, separate protocol reception from key translation, and test against real software rather than stopping after a few characters appear at the command line. With those practices, an inexpensive PS/2 keyboard can provide dependable access to an original Sharp system while leaving its motherboard and keyboard port unmodified.
Document the finished circuit, firmware, and test results so other X68000 owners can reproduce the work and improve the key mappings. That shared record turns a one-off adapter into a useful part of the wider enthusiast community and helps keep the platform operational for years to come.
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.