ZX Spectrum video output ported to Raspberry Pi Pico DVI/HDMI with dual-core rendering
A developer adapted the PicoDVI library for ZX Spectrum-compatible video output on both Raspberry Pi Pico and PGA2350 microcontrollers, implementing dual-core scanline rendering with raw RGB565 queue access.
Summary
Developer Kevin has released a project that generates ZX Spectrum-compatible video through DVI signaling on an HDMI connector, using the Raspberry Pi Pico's PIO subsystem and the PicoDVI library. The implementation runs on both the original Pico V1 and the newer PGA2350, with the latter requiring GPIO base configuration for pins 40-47 and 64-bit PIO API calls. Rather than using the standard Adafruit_GFX abstraction layer, the project provides direct scanline access by packaging the original PicoDVI code as a standalone Arduino library and compiling PIO state machine code with pioasm.
The architecture splits workload across the Pico's two ARM Cortex-M0+ cores: core 0 handles memory reading while core 1 manages DVI rendering, with scanlines queued as RGB565 data through a q_colour_valid mechanism. A synchronization fix resolves a sequencing bug between the setup() and setup1() initialization functions. Scanline conversion logic derives from the pico-zxspectrum project. All materials are available through the developer's blog and GitHub repository.
Pico DVI implementation and dual-core architecture
- MCU platforms: Runs on Raspberry Pi Pico V1 (RP2040) and PGA2350, with the latter requiring set PIO GPIO base to 40 and _mask64 variants of PIO API calls for upper GPIO bank access.
- PIO state machines: Custom PIO code compiled with pioasm rather than using prebuilt libraries, with direct scanline access replacing the Adafruit_GFX layer for lower-level video control.
- Dual-core workload split: Memory reader operates on core 0 while DVI rendering executes on core 1, with inter-core synchronization fixing a setup()/setup1() sequencing race condition.
- Video pipeline: Scanlines queued as RGB565 pixel data through q_colour_valid queue mechanism, with ZX Spectrum-specific scanline conversion borrowed from pico-zxspectrum project.
- Library packaging: Original PicoDVI code repackaged as standalone Arduino library, starting from Adafruit's Arduino port in the library manager before stripping back to lower-level access.
Why it matters
This project demonstrates practical techniques for pushing DVI/HDMI video from low-cost ARM microcontrollers without dedicated display controllers, relevant to retrocomputing enthusiasts and embedded developers building custom display interfaces. The dual-core synchronization patterns and 64-bit GPIO PIO techniques are transferable to other RP2040/PGA2350 video projects, while the standalone Arduino library packaging improves reusability beyond the Adafruit ecosystem.
Original reference: blog.adafruit.com →