Using the X68000 Expansion Slot for a USB Host Controller
Adding USB to a Sharp X68000 is an attractive way to connect modern input devices, storage media, and development tools without changing the character of the original computer. The expansion slot provides a practical path for this work, but it is not a plug-and-play interface. A successful design must bridge the X68000’s 68000-era bus to a USB host controller, provide safe power, and supply software that Human68k can use.
The key distinction is between a USB connector and a USB host system. A socket alone has no knowledge of enumeration, endpoints, transfer types, or device classes. The expansion hardware must contain a controller or microcontroller capable of managing the USB protocol, while the X68000 needs a reliable register interface and a driver.
This makes the project a useful combination of retrocomputing preservation and modern embedded design. It also follows the same practical engineering path as other X68000 peripherals: measure the bus, isolate voltage and timing concerns, build a simple prototype, and add software support one device class at a time.
Why The Expansion Bus Is The Right Starting Point
The X68000 expansion slot exposes the computer’s local bus to external hardware. Depending on the model and slot implementation, a board can use address, data, read, write, interrupt, and control signals to appear as memory-mapped or I/O-mapped hardware. That is enough to give the host CPU access to registers in a USB bridge.
A USB controller does not need to occupy a large memory region. A small register window can provide command, status, data, interrupt, and configuration registers. The X68000 writes a command or data byte, the controller performs the USB transaction, and the board reports completion or an error through a status bit or interrupt line.
The electrical side deserves more attention than the software side at the beginning. Original X68000 systems use 5-volt logic, while many current USB controller ICs and programmable logic devices use 3.3 volts. Bus transceivers, voltage translators, series resistors, and careful power filtering may be required. A board that works on a bench can still fail when connected to a long expansion cable or an electrically noisy USB device.
Existing hardware documentation is valuable here. The project diary provides the kind of practical background that helps place a USB expansion project in the broader history of X68000 modifications, repairs, and experimental peripherals.
What A USB Host Controller Must Handle
USB is host-driven. The host supplies bus timing, detects device attachment, assigns an address, reads descriptors, and selects configurations. It must then schedule control, interrupt, bulk, or isochronous transfers. An X68000 expansion board therefore needs a genuine USB host controller or a secondary processor that performs these jobs.
A simple SPI host controller such as the MAX3421E can be attractive for a first design. The X68000 accesses the controller through a small serial interface, while the controller handles low- and full-speed USB signaling. This reduces the number of high-speed bus signals routed across the expansion board. The cost is software overhead: every register transaction must pass through SPI, and the driver must manage the controller’s state carefully.
A programmable USB device such as a VNC2-based solution can move more protocol work into firmware. This may simplify the X68000 driver for a narrowly defined application, such as a keyboard or mass-storage bridge. It also creates a second firmware environment that must be documented, updated, and recovered if its code becomes corrupted.
High-speed USB should not be the first target. Full-speed support is sufficient for many keyboards, mice, game controllers, and small flash drives. It also keeps signal integrity, controller selection, and driver development within a realistic scope for a home-built X68000 peripheral.
Designing The Hardware Interface
A robust board can be divided into five functional areas: the X68000 bus interface, address decoding, the USB host controller, power distribution, and optional local firmware logic. The bus interface should buffer the computer-facing signals and avoid exposing a sensitive 3.3-volt controller directly to the expansion connector.
A CPLD or small FPGA is useful for address decoding and bus timing. It can translate a selected X68000 access into a clean register transaction, hold data until the CPU completes its cycle, and generate an interrupt when the USB controller needs service. A simpler glue-logic design may be adequate, but programmable logic makes it easier to correct timing assumptions during testing.
USB power should be treated as a separate design problem. A USB port is expected to provide a controlled 5-volt supply, with protection against overcurrent and accidental shorts. A resettable fuse, load switch, transient suppression, and bulk capacitance near the connector are sensible additions. The expansion slot may provide power, but its available current and behavior during startup should be verified rather than assumed.
The connector choice also affects usability. USB-A is historically familiar and mechanically robust, while USB-C requires attention to pull-down resistors, cable orientation, power roles, and connector protection. For a first-generation X68000 board, a clearly labeled USB-A host port can reduce ambiguity and prevent users from treating the connector as a power input or device port.
Choosing A Practical USB Strategy
Different controller approaches shift complexity between hardware, firmware, and the Human68k driver. The best choice depends on whether the goal is a general-purpose USB subsystem or a dependable interface for a small group of devices.
| Approach | X68000 Interface | Strengths | Main Limitations | Suitable First Devices |
|---|---|---|---|---|
| SPI host controller | Memory-mapped SPI registers | Simple routing and widely documented host functions | CPU spends time moving registers and data | Keyboards, mice, simple controllers |
| Programmable USB processor | Parallel or SPI command interface | USB protocol can be handled in board firmware | Requires a second firmware toolchain and update method | HID devices, dedicated storage bridge |
| Custom FPGA host logic | Direct bus-connected registers | Flexible timing and tightly integrated hardware | USB protocol implementation is demanding | Experimental or specialized peripherals |
| USB-to-serial bridge | Serial registers or UART interface | Easy software model and inexpensive hardware | It is not a general USB host solution | Devices with a serial conversion path |
| Dedicated storage controller | Command-oriented register interface | Can hide much of USB mass-storage complexity | Limited device compatibility and feature set | Flash drives and card readers |
A keyboard-focused peripheral can be much smaller than a general USB host adapter. HID reports are short, polling intervals are predictable, and a driver can expose translated key events to existing applications. Mouse support adds motion, buttons, and wheel handling but follows a similar pattern.
Mass storage is a larger commitment. The driver may need USB mass-storage class support, SCSI command handling, FAT filesystem integration, removable-media detection, and error recovery. It must also deal with devices that draw substantial startup current or take a long time to become ready. A design that begins with HID gives the hardware and software a manageable proving ground.
Building The Human68k Driver
The X68000 side needs a documented register map before driver work becomes practical. Each register should have a defined width, reset value, read or write behavior, busy state, error code, and interrupt meaning. Ambiguous status bits create difficult bugs because the USB controller and the 68000 may disagree about which operation is active.
Polling is a reasonable first implementation. The driver can start a transfer, repeatedly inspect a status register, and copy completed data into a buffer. This wastes CPU time, but it makes bus timing and transaction ordering easier to observe. Once transfers are reliable, interrupt-driven operation can improve responsiveness and reduce processor overhead.
A useful driver architecture separates three layers. The lowest layer handles expansion-board registers and USB controller commands. The middle layer performs device enumeration and class-specific transfers. The upper layer exposes keyboard events, mouse packets, block devices, or application-level calls to Human68k software.
Buffer ownership must be explicit. The X68000 should not modify a buffer while the controller is transmitting it, and the controller should not overwrite data before the driver has consumed it. Small ring buffers, sequence counters, and completion flags can prevent lost keystrokes and partially updated mouse reports.
Work on other expansion peripherals offers a useful model for this process. The parallel interface build illustrates how a seemingly simple connector requires coordinated hardware design, signal handling, and software expectations. USB raises the protocol complexity, but the method of turning an electrical interface into a usable X68000 resource is closely related.
Enumeration And Device Compatibility
When a USB device is attached, the controller must detect it and the driver must perform a reset and enumeration sequence. The host reads the device descriptor, assigns an address, retrieves configuration data, and selects an interface. A driver that skips these stages may appear to work with one known device while failing with nearly everything else.
Device classes are the most practical way to control scope. USB HID covers many keyboards, mice, and gamepads, although vendor-specific reports can still require special handling. Mass storage uses standardized command blocks, yet real-world flash drives vary in power behavior, response time, and supported features.
Compatibility testing should include devices from different generations. A basic wired keyboard, an older optical mouse, a modern compact keyboard, a low-capacity flash drive, and a powered hub can expose different problems. Wireless USB receivers should be treated separately because the receiver may enumerate as HID while still depending on proprietary radio behavior.
Error handling matters as much as successful transfers. The driver should recognize disconnects, stalled endpoints, invalid descriptors, timeouts, and controller resets. If a device is unplugged during a transfer, the X68000 must return to a clean idle state rather than leaving a command bit permanently set.
Testing The Bus Without Risking The Computer
Bring-up should begin without a USB device attached. Confirm that the expansion board powers correctly, that the address decoder selects only the intended range, and that reads and writes return known values. A logic analyzer can reveal whether the 68000 bus cycle is being terminated correctly and whether wait states are needed.
The next step is a simple internal register test. Firmware can expose an identification byte, a writable scratch register, and a loopback or FIFO test. These checks establish that the driver, bus interface, and programmable logic agree before USB signaling adds another source of uncertainty.
Use current-limited power during early testing. Measure inrush current when a device connects, voltage at the USB receptacle, and regulator temperature during sustained transfers. A board that resets the X68000 when a flash drive is inserted has a power-design problem, regardless of how correct its USB protocol implementation may be.
Useful first-stage checks include:
- Verify every bus signal against the target X68000 model and expansion connector documentation.
- Start with a read-only identification and scratch-register driver.
- Test keyboard HID support before attempting mass storage.
- Capture USB attach, reset, and enumeration events with diagnostic logging.
- Add overcurrent protection and test disconnect recovery deliberately.
Preserving Compatibility With Original Software
A USB adapter becomes much more useful when it behaves like an ordinary X68000 resource rather than requiring every application to understand its private API. Keyboard and mouse support should ideally integrate with existing input conventions. Storage support should follow familiar drive and filesystem behavior where the available operating-system interfaces permit it.
There is a trade-off between a TSR, a device driver, and a dedicated application library. A TSR can provide system-wide input handling, while a device driver offers a cleaner resource model for storage or serial-style devices. A library may be easiest to develop but limits compatibility with older commercial software.
Documentation should record register definitions, interrupt behavior, supported USB speeds, maximum current, tested devices, and known limitations. Schematics and firmware source are especially important for preservation because replacement components and development tools change over time.
A documented limitation is preferable to a misleading claim of universal compatibility. For example, a first release can explicitly support low- and full-speed HID devices, use polling, and omit hubs or isochronous audio. This gives users a clear target and gives developers a stable base for later expansion.
Move From Prototype To Daily Peripheral
The most effective design path is incremental. First prove the X68000 bus interface with a small register block. Then connect a host controller and verify attach detection. Add enumeration, support one HID class, and only afterward consider storage, hubs, or higher transfer rates.
Keep the board serviceable. Use through-hole connectors where mechanical stress is high, provide test points for bus and USB power signals, label jumpers and revisions, and include a recovery method for programmable logic or local firmware. These details matter when a peripheral is expected to remain useful for decades.
A USB host controller on the X68000 expansion bus can become more than a modern convenience. It can provide a controlled, documented bridge between original software and readily available hardware, while demonstrating how the machine’s expansion architecture still supports serious experimentation. Build the first revision around a narrow, testable goal, publish the electrical and software details, and let each reliable device class guide the next stage of development.
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.