SHOWALL FUN PRANKS HIGH VOLTAGE LAZARUS-64 PHOTOGRAPHY SPY GADGETS VIDEO GAME
Figure 4 - Adding the RRGGBBII DAC to the breadboard
Figure 4 - Adding the RRGGBBII DAC to the breadboard

The 1K and 2K resistors that form the resistor DAC are close enough to create the necessary analog voltages for any VGA monitor. You can substitute the 2K resistors for 2.2K, if your parts bin has the more common value, and it will work just fine. Because of the low bandwidth needed to generate 256 x 240 over the 640 x 480 VGA standard screen, the DAC does not have to be high precision like the ones used in real video cards. In fact, the slight bit of blurring caused by the resistors actually "smoothens" up the video a bit, since the large square pixels are almost too sharp due to the low resolution. I actually tried this project with a precision, high speed video DAC IC, and it looked worse due to being too sharp! The values of the diodes are also not important, but they do need to be low voltage signal diodes, not power diodes. The small red glass types (whisker diodes) are perfect.

Add the resistor DAC to the solderless breadboard on the top corner, allowing a bit of room to work and add to the circuit. The project will progress from a basic "bit banger" up to a dual buffer system, so the breadboard needs a bit of room to hold the SRAM and a few logic ICs later on if you plan to follow through to the more advanced VGA video generator version.



Figure 5 - The initial prototype will create video without a frame buffer
Figure 5 - The initial prototype will create video without a frame buffer

It is difficult to do anything with graphics when you don't have very much memory, or even enough to store the contents of a single frame. The AVR is capable of 10MHz bandwidth out of a port, so the maximum resolution that can be achieved over any of the VGA standards is 256 x 240 over the standard 640 x 480 screen. There is not enough IO horsepower to push pixels any faster than that, but this actually works out very well, allowing both the horizontal and vertical resolution to be addressed by 8 bits. As you will see later on, this 8 bit addressing makes computations many times faster than trying to push out something like 320 x 200 as that would require 16 bit math.

As this project progresses, an external SRAM capable of holding two full screens will be added, allowing for very complex graphics to be drawn in such a way as one buffer is on the screen while the AVR chews away on the other. This is called "double buffering", and is the way video games are done, allowing for frames to be swapped once all graphics are drawn. For now, we will concentrate on just making a VGA monitor lock onto the signal, and show the 256 possible colors. Using no frame buffer limits the amount of data that can be sent to the screen, but a lot can be done even with just the microcontroller pumping the monitor in real-time as will be shown. Start by connecting the VGA connector to the DAC, the horizontal sync to Pin B.0, vertical sync to Pin B.1, and a test LED to Pin B.2 through a 1K resistor. The test LED will flash in the background, showing that there is plenty of free time to draw graphics during the blanking periods (more in this later).

Back Home Last Next
You are Viewing... Page 3 of 16
Lucid Science Electronics from the Fringe AtomicZombie Hack-a-day SparkFun