Gabriel Cséfalvay Gets an STM32 Microcontroller Delivering Full HD 1080p Video — After a Fashion
Clever coding delivers a 1080p signal over VGA, though with pixel doubling — with work in progress to offer the full resolution.
Maker Gabriel Cséfalvay is pushing STMicroelectronics' popular STM32 platform to its limit, delivering a 1080p-resolution video output from the humble 32-bit microcontroller — with a few caveats, at least.
"A monochrome VGA video output on an STM32L4 microcontroller, using DMA [Direct Memory Access] and SPI [Serial Peripheral Interface]. It is necessary to use the DMA on a low-performance processor to achieve the necessary bitrate," Cséfalvay explains of his impressive achievement. "This is a nearly no-component monochrome VGA output project. It has a relatively low processor demand, too. This is achieved by deferring as [many] tasks to various peripherals as possible."
Pushing a bit-banged analog VGA signal out of a microcontroller is a tried-and-tested way to offer a graphical display, but is typically limited to low resolutions — VGA, in fact, or lower. Cséfalvay, though, is driving a Full HD monitor at its native resolution of 1920×1080 (1080p), though there's a little hand-waving involved.
"So far I achieved half-resolution of 1080p," Cséfalvay admits. "The video signal is 1080p widescreen, HOWEVER, every pixel is doubled — every pixel in the memory is rendered as 2×2 pixels on the screen. True 1080p is theoretically achievable. The RAM is somewhat limited on the STM32L4s but it's still possible to fit. The [octo-]SPI is capable of outputting the necessary 148Mb/s data rate at a 74MHz system clock in the double data rate mode. The DMA also should be able to deliver at the necessary data rate of 1 transfer every 16 clock cycles. So… coming soon!"
The current half-res mode works by wiring the microcontroller into the monitor over its analog VGA input, requiring only a handful of passives. The monochrome signal is fed into all three colour lines simultaneously, leading to some shadowing, which Cséfalvay suggests could be fixed with the addition of a 7400-series logic chip to drive the three lines independently with impedance matching. On the microcontroller itself, the heavy lifting is handled by peripherals: the DMA controller, timers, and the peripheral interconnect matrix — while the pixel data is output over octo-SPI.
The project is documented in full over on Hackaday.io.