Barely a week goes by without another hack blessing the RP2040 with a further interfacing superpower. This time it’s the turn of the humble PAL standard composite video interface. As many of us of at least a certain vintage will be familiar with, the Phase Alternate Line (PAL to friends) standard was used mainly in Europe (not France, they used SECAM like Russia, China, and co) and Australasia, and is a little different from the much earlier NTSC standard those in the US may fondly recollect. Anyway, [Fred] stresses that this hack isn’t for the faint-hearted, as the RP2040 needs one heck of an overclock (up to 312 MHz, some 241% over stock) to be able to pull off the needed amount of processing grunt. This is much more than yet another PIO hack.
The dual cores of the RP2040 are really being pushed here. The software is split into high and low-level functions, with the first core running rendering the various still images and video demos into a framebuffer. The second core runs in parallel and deals with all the nitty-gritty of formatting the frame buffer into a PAL-encoded signal, which is then sucked out by the DMA and pushed to the outside world via the PIO. There may be a few opportunities for speeding the code up even more, but [Fred] has clearly already done a huge amount of work there, just to get it working at all. The PIO code itself is very simple but is instructive as a good example of how to use multiple chained DMA channels to push data through the PIO at the fastest possible rate.
Beyond the Pico PCB, the only extra hardware needed was a resistor-ladder DAC implemented on a solderless breadboard. [Fred] needed a couple of goes to get the correct DAC resistor values, the first version was built on a small prototyping PCB, but unfortunately, the peak voltage was only 1 V, so it was necessary to build a second version (hence the breadboard) to get it to the correct 1.25 V.
We’ve covered video hacks on diminutive hardware many a time, even going into some details of the various standards, like this piece on just why is NTSC so odd? But as time marches on, video standards have gone through vast changes to get to where we are now.
— Fred (@theguruofthree) January 22, 2023