# How exactly does a VGA cable work?

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.

• You plug it in and the transports signals from one end to the other? Are you talking about the VGA signals themselves? Apr 26, 2015 at 2:32
• 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. Apr 26, 2015 at 2:40
• And it looks like the industry standard of 640x480 has a pixel clock of 25.17MHz, and the Arduino Due has a clock speed of 84MHz, so I should be able to read the color data in quick enough, right? Apr 26, 2015 at 3:01
• For three muxed channels probably 2 orders of magnitude too slow (100x too slow). Apr 26, 2015 at 3:27
• @JoshBeckwith Unlikely. The ADC on the Due has a maximum speed of 1000 ksps, considerably slower than would be necessary to sample VGA.
– user39382
Apr 26, 2015 at 5:02

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):

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.

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.

• I dont understand that why we need front porch and back porch, I mean we could just send a horizontal sync signal after this line finished, RGB signal ... H sync, next line. RGB signal ... H sync, next line and so on May 26, 2020 at 6:23
• @krosshj - it makes more sense if you look at how a (simple) CRT monitor works. The display is actually >640px wide, and the front porch / back porch is essentially just padding the image with black. This means that even if your alignment is off by a few pixels the image isn't clipped, and means you don't need separate circuitry to shut off the electron guns while scanning to the next line. That being said, there are reduced-porch timings for LCDs.
– TLW
Oct 10, 2021 at 21:45
• @TLW Thanks, got it Nov 28, 2021 at 3:37