The Raspberry Pi 5 is a big step up in processing power, but it lacked support for the interlaced video output mode present on earlier models. Thankfully, that has now been fixed.
Originally, the Raspberry Pi 5’s Display Parallel Interface (DPI) couldn’t manage that type of video. So it couldn’t send full-resolution RGB signals to CRT TVs, which is important for people wanting to use them for retro gaming or media. However, a recent software update has fixed this issue, allowing the Raspberry Pi 5 to output interlaced video now.
The main part of the solution involved using the Raspberry Pi’s Programmable Input/Output (PIO) block, which is also found in RP2040 and RP2350 microcontrollers. The PIO’s ability to create real-time signals was key in overcoming the problems related to producing interlaced video.
Since interlaced video wasn’t supported, the Raspberry Pi team had to make three important software changes. First, the team adjusted the DPI to output field data (either the even or odd lines of a frame) instead of full frames. The team did this by changing an address and doubling the line stride in the DPI settings. An interrupt to alternate between even and odd fields at a rate of 50 or 60 times per second was also set up.

CanaKit Raspberry Pi 5 Starter Kit
The Raspberry Pi team needed to make some timing adjustments to make sure the fields were arranged correctly. They did this by changing the settings of the DPI peripheral as needed, adding an extra blank line after each top field and before each bottom field. This careful timing adjustment was essential for properly showing the interlaced signal.
The third and most difficult challenge was creating the right synchronization pulses. The RP1’s DPI can’t produce vertical sync pulses (VSync) that start in the middle of a line, which is necessary for interlaced video. To tackle this, the team made full use of the PIO’s features. The PIO keeps an eye on the DPI’s horizontal sync (HSync) and data enable (DE) signals.
The team dedicated two of the four state machines in the PIO to this task. One functions as a timer that generates interrupts at the beginning and middle of each line, while the other detects when the vertical blanking interval starts, counts half-lines to establish when the VSync pulse should be, and checks that the correct field phase is being used with the DE signal.
While the solution works well, there are some limitations to think about. The DE signal requires output on GPIO1, no matter how it’s being used. Also, the PIO doesn’t operate in sync with the DPI clock, which may cause a timing variation of up to around five nanoseconds in the VSync output. This sounds small and wouldn’t be an issue for a standard-definition TV, but unsurprisingly, it would be a problem at higher resolutions. The sync fix-up also takes up a lot of instruction memory, so it restricts the PIO from being used for other tasks at the same time.
To get this working, you’ll need certain hardware and software setups. You’ll need a Raspberry Pi 5, a HAT, and a VGA monitor that works at a 50Hz refresh rate. On the software side, make sure to update to the latest version of Raspberry Pi OS. By default, the configuration uses GPIO0 for DPICLK and GPIO1 for DE, which affects the use of I2C/DDC on those pins. If you have other HATs, you might need to create custom overlays to use DE output on GPIO1 safely.
The Raspberry Pi 5 has added support for composite sync, and most existing SCART HATs already have the necessary circuitry for generating composite sync, but the Raspberry Pi’s PIO can also create this signal. To keep the software simple, this feature isn’t included in the main driver; instead, it requires a separate PIO program and possibly some hardware changes.
Source: Raspberry Pi