I recently put together an arcade cabinet with a real arcade monitor which can display at 15khz (240 lines vertical) and 25khz (384 lines vertical). The only problem is, I have a computer hooked up to it. Someone other than myself could change the resolution to something not supported and break it.
What I'd like to do is feed the sync line (coming out of the computer video port) into the Arduino, and count the vertical lines - if it's okay, pass it through... trouble is, I don't know where to begin on counting the lines. I've done a lot of poking around and I don't really see anyone else doing this so I'm afraid I'm kind of stuck.
What I'd essentially like to create is a pass through device, VGA connectors on either end, which either allows sync or disallows it based on the resolution going through the device. Am I stepping out of line here or is this reasonable?
I don't think I need to split anything, since the cable itself has a vertical and horizontal sync line independent of each other. I just need to figure out how to actually read the signal and count the number of lines.. I must admit that my electronics skills are sketchy at best, so this is stepping into a new world for me. But I'm determined to learn if I just know what direction I need to go in.
First of all make sure the signals are TTL compatible. If not put them through a transistor first. 10K resistor to the signal, other end into the base of a transistor, emitter to ground and collector to digital input. Then enable the internal pull up resistors.
Then in your code you wait in a loop until the frame sync has gone high then low. Then after you count every high / low transition of the line sync. When it reaches the line number you want then have an output go high for that line.
You then have a line across the screen at the determined point.
What do you actually want to do?
I want to determine if the signal contains X lines (determined by a jumper setting, either 384 or 240 or 480) and if it does not, block it from sending. If it does, pass it on. I don't actually want to do any processing to the signal or change it, just block or allow it depending on the number of lines.