bit bang VGA
dr hydra
Posts: 212
Has anyone created a bit bang video VGA driver using the propeller? I am looking to increase the number of colors from 6 bits to 15 bits. My idea is to use two sync cogs to bit bang the video data to 15 pins (5-5-5 RGB). The idea is to have one cog load the data into the its own cog RAM while the other cogs is driving data (from its RAM) to the pins. Then after one line of video is done the two cogs would switch roles...
Comments
I've thought about directly driving VGA from external memory chips controlled by the Propeller.
Only problem is that you have to then juggle updating the screen during screen refresh...
movs label,#data
mov counter,#128
lable mov outa,data
add lable,#1
jnz counter,#lable
Would get you a pixel rate of 6.6mhz, those will be some wide pixels.
if you unrooled the loop, you would have no room to store the data for a whole line.
So your best bet would be to use regular vga driver as is with 6bit and start a second cog (easy to sync) that do 8bit
So it will get you 14bit Rrrrr_Ggggg_Bbbb.
But now comes the propblem, where are you gone get store this color and pixel data as your 128x240 would use 54k
http://www.linusakesson.net/programming/propeller/pllsync.php
But if your plans is to bit bang really low-res vga, no need for pll.
Just start both cogs with a cnt number far ahead in future (pass it along to cog with PAR)
and then you have both cogs use
mov start,par
waitcnt start,#0
But at your low resolution 16bit color (use 6bit for green), I think you could do it in one cog.
rdword data,hubaddr
shr data,#10 ' may have to adjust for the pin group (16pins) used for vga colors.
or data, syncpins ' H and V sync pin are always high during pixel display
mov outa,data.
Use my bit banging barebone vga
http://forums.parallax.com/showthread.php/134552-Barebone-VGA-driver
Thank you for your help...i am still thinking through the options...I like the two cogs waitvid option, but syncing the two cogs has me worried. If it is off a little the screen will get jiggly. Any suggestions?
But due to memory constraints, your pixels will be so wide I think you can do it in one cog
and no need to interleave two cogs.
That was not the problem, as 200+4, or 211+4 is still 12.5ns granularity
It was more about hub access being in sync if you get your pixel data from there.
So that is why all vga drivers that use hub are a little slow and have specs of 59.4 frames a second
My waitcnt vga routine uses these values: