Driver Interface
// Driver Initialization vga_gen_init(); // Setting the color of a pixel vga_gen_set_pixel(x, y, color);
That’s all.
It’s simple because it’s intended to be used as a lower layer for graphical libraries. The example uses the µGUI library.
Schematic
Crystal oscillator
It is necessary to run the XMEGA from an external crystal. The internal RC oscillator is not stable enough for VGA - the image would be wavy or noisy or, more often, the monitor will not lock on it at all.
The value of the crystal is not critical as the on-chip PLL can generate the required frequency.
The PLL output frequency doesn’t have to be exactly the pixel frequency in the mode definition, just choose the closest possible. Modern monitors are quite forgiving. A few percent deviation won't be a problem.
Functional Diagram
Project Files Download
Google Drive Link for XMEGA VGA
I use a URL shortener because I'm curious about the download count.
You can check out my recent port for STM32 aiming for 1080p - work in progress:
https://hackaday.io/project/196282-1080p-on-an-stm32