A real Z80, a software ULA, and the clock problem behind HDMI

Z80, RP2350B, ZX Spectrum

This is the read-only HTML version. For the full Visual Space experience, open the app.

Z80 board, retrocomputer — Ima

Z80 board, retrocomputer — Ima
Z80 board, retrocomputer — Ima
Z80 board, retrocomputer — Ima
Z80 board, retrocomputer — Ima

Source: Z80 + RP2350B ZX-compatible homebrew retrocomputer on Hackaday.io · Vlad

Retrocomputing, video timing

Vlad’s ZX-compatible homebrew keeps a physical Z80, discrete memory and audio-only program loading, while an RP2350B handles the Spectrum-specific logic. Adding digital video exposed an awkward trade-off: the clock that suits the display isn’t quite the one that suits the original picture.

Award badge 1

Keeping a real Z80 at the heart of a Spectrum-compatible computer is only part of the job. Something still has to share its video memory, control its clock and turn the display data into a picture. In Vlad’s homebrew project on Hackaday.io, that work falls largely to an RP2350B—and adding digital video shows just how closely those jobs are connected.

The result mixes a mostly through-hole computer with a programmable replacement for the Spectrum’s ULA. Vlad reports that it runs every game tried so far, while explicitly warning that it isn’t cycle-perfect. The supplied logs run from July through September 2026, documenting a working build with further hardware and firmware ideas still open.

Old-fashioned where it counts

The processor is a DIP-40 Z84C00AB6, backed by discrete ROM and static RAM. A 64 KB EEPROM supplies a selectable 16 KB ROM bank through DIP switches. Of the RAM available to the machine, 32 KB is dedicated to the Z80 and another 16 KB is shared with the RP2350B.

That shared region is where the two eras meet. Vlad separates the CPU and “ULA” data buses with resistors, following the original Spectrum approach, while 74LS541 buffers isolate the address and read/write signals under RP2350B control. The microcontroller also generates the CPU clock according to the memory-contention scheme. It isn’t merely drawing a screen after the fact: it participates in deciding when the Z80 can proceed.

The rest of the machine preserves some deliberate friction. There’s a handmade keyboard, an onboard speaker and a cassette interface for a recorder or smartphone. There’s no SD-card loader or other fast-loading shortcut. Programs enter and leave as audio, even though the picture can go to a modern display.

An expansion connector exposes the Z80 signals. Vlad has used it for a GamePort joystick adapter that presents itself as a Kempston-style interface at port 1Fh. The July 8 adapter log describes an LM324 translating the joystick’s analog axes into directional bits, with adjustable thresholds. The working prototype remained in use; the separate Sinclair joystick connector was listed as not yet soldered.

Why digital video changed more than the socket

The VGA output uses a 720×576 progressive picture at 50 Hz, doubling the Spectrum’s horizontal lines. Vlad reduced the bottom border from 56 to 48 lines to fit the chosen output format. This is already a translation of the original display timing, rather than a direct reproduction of its analog signal.

Digital output added another constraint. In the July 11 investigation, Vlad calculated that generating DVI directly would require a 270 MHz serial bit rate. The existing layout—an RP2350B module on headers, with VGA and HDMI circuitry not laid out for that task—made that route unattractive.

The eventual solution was a TFP410 transmitter, which takes the digital picture signals and handles the TMDS output for DVI through the HDMI connection. On August 24, Vlad reported that the adapter board worked with an RP2040 generating a test image. Integrating it into the computer was the next hurdle.

The August 29 log records a working configuration using a 189 MHz RP2350B system clock. Dividing that by seven gives the required 27 MHz digital-video pixel clock; dividing it by 27 gives the 7 MHz reference used by the Z80 clock routine. PWM supplies the transmitter’s pixel clock.

Those neat divisions came with less tidy consequences. Vlad had to recalculate PIO state-machine dividers and revise video generation, Z80 clock generation and IN 254 handling. A display interface change had reached back into the machine’s basic timing. At that point, Vlad reported a clean digital picture but said more testing in games was needed.

That testing revealed a further compromise. In the September 2 update, Vlad found the geometry change from the analog output’s 28 MHz pixel clock to the digital mode’s 27 MHz clock objectionable: circles became ovals.

Rather than force one timing setup onto both connectors, Vlad described selecting different PIO programs and clock rates: 154 MHz system/28 MHz pixel clocks for analog VGA, or 189 MHz/27 MHz for digital output.

The monitor-detection method is particularly resourceful. With no spare GPIO available for the TFP410’s detection signal, the firmware drives the VGA blue signal and reads back through the BRIGHT connection. A connected monitor’s 75-ohm termination changes the voltage. Vlad’s simulation predicted about 707 mV with a monitor attached and 2.84 V without one—enough to distinguish low from high with a digital input. The log provides detection code, while noting that cable length could affect the approach.

A frame buffer—or just one line?

The latest supplied entry, September 30’s video-buffer exploration, looks at a different way to join the original timing to the modern output.

The working design stores a complete screen frame in the RP2350B. Its VGA line frequency is 31,250 Hz, twice the original PAL Spectrum’s 15,625 Hz. That buffer gives the display process room to operate separately from video-memory fetching.

After modeling the ULA processes in SystemVerilog, Vlad suggested that just 64 bytes—32 of pixel data and 32 of attributes—might suffice. With carefully timed output, the VGA process could begin reading shortly after the memory-fetch logic writes the data, displaying each line twice within one original PAL line interval.

That remains a modeled possibility, not a reported firmware replacement. Vlad was unsure whether changing the already-working RP2350B implementation was worthwhile, and floated a CPLD or FPGA version as a way to learn more about synthesis.

The linked firmware and KiCad repository is the place to follow the design, with one build caveat from the project overview: schematic and PCB mistakes had been corrected in the files, but that corrected board revision had not yet been built.

The useful lesson here is that a modern ULA replacement doesn’t make the old timing relationships disappear. A full-frame buffer gives the two sides breathing room; a line-sized buffer would demand much tighter coordination. The next meaningful test is whether that smaller design can preserve the working machine’s behavior—not merely produce a recognizable picture.

Source: Z80 + RP2350B ZX-compatible homebrew retrocomputer

Hardware

3 Followers

A workshop for electronics and physical computing. Share circuits, boards, tools and prototypes; work through measurement and debugging, compare components, and document the choices that turn an idea into working hardware.

Visual Space is built for projects like this—where creators collaborate, organize goals, and grow communities around real work.