Go Down

Topic: How can I read VGA signals w/ an Arduino? (Read 2 times) previous topic - next topic

TECH GEEK

I would like to know if it is possible to read the signals coming out of my computer's VGA connector using an Arduino UNO R3 or Arduino Mega R3 running at 16MHz. I want to read the signals so that my ?C can correct typo's and such while I type on my keyboard and also act as a stepping stone for me to better understand how VGA commutation works.

(Example: I type the following: "can i type this."  Once I stop typing, the ?C corrects the typo(s) to this: "Can I type this?")

I recognize I could just read the keystrokes but the reason I am doing this is so I can get some experience in some areas I have never touched up on before.

So my question is this: "Is an Arduino running at 16MHz fast enough to read the color of only one pixel on the entire screen running @ 16bit color w/ a resolution of 800x600?"
As always... Thanks for posting!!!

nickn4

i searched on the net because i'd like to know the awnser myself.
i found wikipedia page for vga and the interesting stuff wich we're looking for is listend under 'technical detials'->'Signal'

there are two table's:
the virtical timings
& horizontal timings

note that all detials are for: 640×480@ 60Hz non-interlaced
the frequenty's are
Horizontal frequency 31.4686 kHz
Vertical frequency     59.94      Hz

so i would say yes, based on this information i suggest i'd be okay.
the next question now would be: how about 800x600 pixels..

well, i dont think that the frequnties would raise more than 100%, but even if they did.. the frequenties would be like 60kHz × 100 Hz, i think it should not be a problem (correct me if im wrong, i just looked into it i have no expertise on this..)

nick
humankind cannot obtain anything without
sacrificing something of equal value.

TECH GEEK

As always... Thanks for posting!!!

Graynomad

I can see no way to do this with an Arduino, you not only have to read the high-speed analogue signal in real time but you have to decode that into characters then lookup a dictionary/thesaurus/grammar checker.

All with a 16MHz 2k RAM processor.

You do the maths :)

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

#4
May 26, 2012, 12:25 am Last Edit: May 27, 2012, 12:53 am by Graynomad Reason: 1
I'll believe you about the dot clock being 60kHz (I'm too lazy to work it out myself), and I guess the VGA is digital so you don't have to do analog readings, but you still have to save and re-align the bit patterns (because a character is spread over several scan lines), decode the patterns to get characters, then do all the dictionary stuff.

EDIT: Doh, how can the dot clock be 60kHz, that's the refresh rate. (Previous post where someone said the dot clock was 60kHz has been removed)

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

Grumpy_Mike

Quote
So my question is this: "Is an Arduino running at 16MHz fast enough to read the color of only one pixel on the entire screen running @ 16bit color w/ a resolution of 800x600?"

And my answer is no way is it fast enough or has enough memory or processing power.

TECH GEEK

As always... Thanks for posting!!!

nickn4

i geus it should be fast enough, i mean, why not? the frequenty is way below the avg frequentie right?
but if you look into how to procces those damn singals with an atmega328, than i would say: its not even worth trying..

i belive its way too much data to be dealing with combined with an atmega328
humankind cannot obtain anything without
sacrificing something of equal value.

Grumpy_Mike

Quote
i geus it should be fast enough, i mean, why not? the frequenty is way below the avg frequentie right?

No it is not fast enough.

You have to look for a line sync pulse, then you have to delay by a precise amount, then you have to capture the pixel.
Lets suppose you want to capture a whole line.
First you wait for the frame sync pulse, then you have a short delay and then take 640 digital samples and put them somewhere. This requires quite a lot of memory, processing power and an external digitiser.
What you can do is sample one pixel per line in the same X position, this gives you 480 samples and a bit of time to store them somewhere. You still need an external flash A/D converter.
Way back in the 80's I made several TV video digitisers using this technique. With one column taking one frame to sample the 640 samples at 60 frames per second will take 10.6 seconds to read in a whole frame. Assuming you have external memory to put it in and some time to do the actual processing, your response time would be quite slow.

AWOL

Quote
note that all detials are for: 640×480@ 60Hz non-interlaced the frequenty's are Horizontal frequency 31.4686 kHz

Back of a beer mat calculation:
31.4686kHz gives a line time of a little over 31 microseconds.
Ignoring blanking, this gives a minimum pixel period of 31us/640 = 49 nanoseconds.

And that's ignoring blanking, remember.
From memory, the dot rate is about 25MHz for VGA at 60Hz.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

pwillard

I would think that even my 3Ghz Windows 7 Machine with 4G ram  would have difficulty with it.

AWOL

Not sure about that, given the right hardware.
I've captured VGA on a 1990s 486 PC with the capture hardware on an ISA bus card.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Grumpy_Mike

I captured full video on the first ARM computer from Acorn in the late 80s. It had an ARM chip running at the then very fast speed of 40MHz.

Go Up