7
\$\begingroup\$

I've been looking around on the internet and I can't find anything in depth on how the cable/connection functions. I've only been able to find simple pin out descriptions.

If someone can link me or point me in the right direction, I would be very grateful.

\$\endgroup\$
  • 3
    \$\begingroup\$ You plug it in and the transports signals from one end to the other? Are you talking about the VGA signals themselves? \$\endgroup\$ – Matt Young Apr 26 '15 at 2:32
  • \$\begingroup\$ I guess I wasn't very specific. Yes, I was looking to study on the signals that are being carried through the cable. I'm looking to start a project involving a vga cable from a computer to an arduino, and was hoping to understand the VGA component before starting. \$\endgroup\$ – Josh Beckwith Apr 26 '15 at 2:40
  • \$\begingroup\$ Not sure what you're planning, but the first thing I would call to your attention is the signal timings. The VGA signals are faster than a AVR clocked at 16 MHz will handle. Maybe if you use the the Arduino with the ATSAM on it, depending what you're doing. This stuff is usually done in purpose built hardware or an FPGA. \$\endgroup\$ – Matt Young Apr 26 '15 at 2:46
  • \$\begingroup\$ So what I'm getting at from this, is that the screen is lit from the left to the right, top to bottom, just like reading a book, using hex color values from the system memory. Is this correct? \$\endgroup\$ – Josh Beckwith Apr 26 '15 at 2:57
  • \$\begingroup\$ Pretty much, it's called a raster pattern. \$\endgroup\$ – Matt Young Apr 26 '15 at 2:58
10
\$\begingroup\$

The OP asked how a VGA cable works, so I'll start with the wiring for a standard cable, which is a DE-15 15-pin connector (sort of like the DB-9 connector used for RS-232, but with an extra row):

enter image description here

H-SYNC and V-SYNC stand for horizontal and vertical sync. The rest are self-explanatory. H-SYNC and V-SYNC are digital (TTL) level signals, active low, and the color signals are analog, 0v (black) to 0.7v (full color).

As implied by the presence of the H-SYNC and V-SYNC, there is horizontal timing and vertical timing. This diagram shows the timing for 640x480 VGA, which was one of the original VGA formats.

enter image description here

The horizontal timing, shown at the top of the picture above, represents one line of the screen (e.g. 640 visible pixels of a 640x480 display). Between each line of pixel data, there is a horizontal blanking area where no video is shown (this originally was primarily used in TV's to allow the CRT trace to move back from the right side to the left side of the screen, ready for the next line).

The horizontal sync is used to start the timing of each line. It is not quite as wide as the blanking area. Just before the horizontal pulse, there is a delay called the front porch. And just following the horizontal pulse is another delay called the back porch.

Although 640 pixels are displayed, 800 pixels are actually needed per line: 96 for the horizontal sync, 48 for the back porch, 640 for the video, and 16 for the front porch.

As shown in the diagram, each line is 31.77 µs long. Diving this by 800 pixels results in 39.7 ns per pixel. This corresponds to a 25.1 MHz clock rate.

The lines are gathered into frames, shown at the bottom of the picture. Like the timing for each line, there is a vertical blanking interval at the beginning of each frame (this originally was primarily used in TV's to allow the CRT trace to move back from the bottom of the screen to the top, ready for the next frame). On some older CRT TV sets, it was possible to "roll" the picture down and actually see this interval as a black bar across the screen. Like the line timing, there is a front porch and back porch area in the timing.

Although 480 lines are displayed, 521 lines are actually needed per frame: 2 for the vertical sync, 29 for the back porch, 480 for the visible lines video, and 10 for the front porch.

As shown in the diagram, each frame is 16.784 ms long. This corresponds to a 59.5 Hz frame rate.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.