I saw a few people building their own VGA Video Chip via an Arduino and thought about doing the "same".
though i'm not entirely sure how to go about it. and for the start just want to know from some people who did stuff like this if this is even possible.
.
basically i would like to create a Video chip that could be used with External VRAM, does some internal processing (aka uses tiles instead of a direct bit for pixel image), and could be interfaced with a CPU like a Z80.
my idea was to use an ATmega1284 @ 20 MHz. with a target resolution of (at first) 128x96 (monochrome). which is a nice and round 4:3 resolution and requires a total of 1.5kB of memory (if 1 bit = 1 pixel)
.
now about the Timing, which i think i somewhat understand.
I assume running this 128x96 res. at 60 Hz would mean i need to pump out 1 pixel every 1,35633 µs.
but what confuses me are the sync signals.
as far as i understand it the H and V sync are basically used to tell the Monitor what the actual resolution is so it can be scaled up/down to fit the entire screen.
so if i were to cause an H Sync pulse every 128 pixels (every 173.61024 µs) and a V-Sync (plus H-Sync?) every 96 rows (every 16.66658304 ms), would that cause the 128x96 image to stretch out to the entire screen?
and if so how much time does the ATmega have between frames to do other things besides sending data to the VGA Monitor?
and if so could i just use interrupts for the signals and let other code run in the mean time?
i thought about doubling the resolution of the image while only drawing half of it (64 pixels to the left and right would be blank, and 48 rows to the top and bottom would also be blank. so the entire thing would be centered in the middle). only downside i can see with that is that it would be 4 times as many pixels so i would need to output them at 4x the speed (339.0825 ns per pixel)
.
now a bit about the CPU/VRAM Interface.
my idea was to put the VRAM into the same Memory space as the CPU, which takes a away a bit of RAM from the CPu but makes data transfer a lot less stressful as otherwise data would need to be routed through the ATmega into VRAM.
this was my plan and the reason i need a bit of processing time between frames:
basically if the CPU is accessing VRAM it will redraw the same image it already generated until it's done, then it checks again to see if it can access VRAM.
.
so, i'm sorry for this post being kind of a mess but i barely know anything about VGA (atleast i think so) and i thought about posting my plans here
so people could look at it and either go "yep this should be possible like you described it", or "nope this is 100% impossible to do", or maybe "yea it would be possible if you change this and that".
but just to be safe.
here is a TL;DR:
Microcontroller: ATmgea1284 @ 20 MHz
Resolution and Framerate: 128x96 @ 60 Hz (Monochrome)
Interface: 8 bit Parallel Interface for CPU and External VRAM
Function: basically imgine a simplier version of the PPU from the NES
.
anyways i hope this was enough information, if anymore is required i can always post more. thanks in advanced for future help. (hopefully)