Arduino VGA driver

For my final project for AP Physics C, we were allowed to create basically anything relating to physics. With the amount of electron gun problems included in the class, I thought it would be a fun to do a project involving VGA—a controller based on the old electron gun monitors. To do this project, I had to delve a lot into the idea of creating precise delays and timings through counting instructions. It was my first experience in highly precise pin timings, an important real-time programming concept.


Video before we were cool

One of the earliest form of monitor/display is CRT (cathode ray tube). It consisted of a vacuum tube containing an electron gun, shotting electrons onto a phosphorescent screen that would emit light when shot. Through applying a magnetic and electric field to the electrons shot out of the electron gun, it was possible to illuminate any part of the phosphorescent screen‐giving the illusion of pixels.

The CRT electron gun diagram
A CRT mechanism with its deflecting coils that allowed you to aim the electrons

Early on, people realized that to achieve higher framerates an aiming mechanism (e.g. a packet system where you specify x,y) would be suboptimal. Instead, they created sweeping system, where the electron gun would sweep across every line on the screen and the computer would be responsible for telling the system when it should shoot (illuminate a pixel). This is the very system that motivates VGA. There are of course drawbacks, a precise timing system like this requires practically synchronous operation.

A video showing the CRT scan lines moving through the display

VGA

As a said before,