AVGA has yet been successfully tested on theese devices:
- ATMega128 (overclocked to 19.6608MHz)
How to connect the AVR to a monitorThe system needs one 16bit AVR timer/counter. The horizontal sync signal outputs through OCRxB of the configured timer. Vertical sync output port and pin can be set in config_hw.h. Pixel stream appears at high nibble of a configured port.
The pixel stream can be converted using resistor video DAC to RGB compounds with standard 16 color EGA/VGA pallette.
Where R1=R2=R3, R4=R5=R6 and R7=R8=R9;
By adjusting R1:R4 ratio, contrast between lower and upper color page is changed easily. I suggest range from 2:3 to 1:2. Actual resistor values depends on monitor's input levels and impedance. Here are some examples:
VGA CRT monitor (75 ohm inputs):
Sony PSOne TFT Screen (high impedance inputs):
Analog PAL TV with SCART connector (75 ohm inputs):
Color palette you get with this DAC
Alternatively, R2R ladder can be used to create 16 color grayscale. Such signal can be for example mixed with VSYNC directly to create B&W composite video.
The SYNC signal voltage should be reduced using resistor divisor to ensure correct input voltage level for your display. Resulting lines: R, G, B and VSYNC (HSYNC) may be connected directly to the monitor (e.g. VGA D-sub, SCART connector...) or to a RGB-to-composite converter unit (e.g. AD725).
The audio signal outputs through OCRxx of the configured timer. A capacitor should be connected between the pin and audio output to remove the DC compound and resistor divisor to reduce the volume.
Mega168 development board
Sample project schematics and layouts
Mega168 Development board
ATMega168 (DIP) @ 19.6608MHz
Has RGB resistor DAC, CINCH connectors for audio and each color compound, (VSYNC only), 78L05 voltage stabilizer and six pushbuttons extracted from an old AT keyboard.
ATMega16 (SMD) @ 19.6608MHz
Download AVGA config_hw.h for theese samples
|Project name||Hardware configuration file|
|Mega168 development board||config_hw.h|