3

I've been programming a VGA Module in verilog, and have spent some time fighting with my monitor to display some test colours. When referencing VGA timing diagrams online, it seems many are similar but the front, back & sync pulse positions are switched around.

I've managed to get it working using either orders below (for both vertical and horizontal)

  • Sync, Back-Porch, Display, Front-Porch
  • Front-Porch, Display, Back-Porch, Sync

However I have tested these (and they didn't work):

  • Display, Front-porch, Sync, Back-Porch
  • Front-Porch, Sync, Back-Porch, Display

I have confirmed through simulations that all tests were behaving as expected, although the monitor did not accept the second set above. (I do hope that I didn't somehow manage to stuff up the non-working set above)

This timing diagram worked: Example1

This other diagram on google didn't work: Example2

I do understand the purpose of the porches & sync pulse, but with non-CRT monitors, does the position of these have any importance? Or is my test monitor (an old Acer) somehow not handling it? I haven't yet had a chance to test it on another monitor.

Any Input, or links to material would be appreciated.

g-radam
  • 131
  • 1
  • 5
  • You probably need to be more clear about what you mean by "order". Of course you cannot swap things around, but in something cyclical it matters little where you define the start and end, except perhaps to the degree to which the vertical increment point may been to happen at a particular point in the horizontal cycle, and not some other. Also keep in mind that color levels may see something of an AGC referenced to the state of the signals when outside the visible region - driving them constantly on generally will not work, or will only produce a brief flash of color. – Chris Stratton Mar 27 '17 at 17:22
  • Order - with respect to position within the cycle. – g-radam Mar 27 '17 at 22:01
  • 1
    "1234" and "1423" are clearly different orders. The question is if you consider "1234" and "2341" to be - for something cyclical they are nearly the same, except in their interaction with another loop, for example the horizontal's interaction with the vertical. – Chris Stratton Mar 27 '17 at 22:05
  • Apologies, my wording is quite poor. Yes I was initially referring to your second example "1234", "2341". But with that being said, I've realized that some timing diagrams show the porch position switched. Diagrams: [Example1](http://processors.wiki.ti.com/images/e/e4/Lcd_datasheet_to_linux.jpg, [Example2] (http://nathandumont.com/files/images/vga_regions_1.png). As for your reference to the AGC, yes I happened to read this on a vesa document – g-radam Mar 27 '17 at 23:14

1 Answers1

1

I've been searching as well, and also found virtually every possible option implied to be "the way it is". I assume that your "Front-Porch, Display, Back-Porch, Sync" is meant to be "Back-Porch, Display, Front-Porch, Sync". I weighed the few relevant www pages I found, and deemed "Sync, Back-Porch, Display, Front-Porch" to be the most credible, and also somewhat logical, with the h-sync aligned with v-sync transitions (although the general AI "voting" approach doesn't really apply with so few "answers"). I couldn't find the info in the VESA specs.

  • 1
    The order how you internally send a "stream" of lines is irrelevant, i.e. it does not matter if your counters start counting from back porch, sync start, sync end or active video, as long as the output signal works. The starting edge of HSync is generally the point of updating the VSync so it might make sense to use the notion that a line starts from HSync going active, but again that does not apply to analog or digital video with composite sync as you only know later after HSync edge if this line also has VSync going active. However, the IBM VGA adapter starts counting from start of video. – Justme May 03 '23 at 07:37
  • Yes, it depends on context. But given h-sync starting on a v-sync transition, if the h-sync isn't viewed as the start of each scan line, then instead of 2 lines, v-sync is a bit of a line, then one complete line, then a bit of another line. Anyway, that view actually slightly simplified my VGA code for RP2040 PIO; whatever works and makes it easier! – user1773500 May 04 '23 at 11:32
  • Sorry yes its quite possible that I mixed the Front and Back porches up - I'm still not sure if "Front" comes before "Back" or visa versa. Thanks for the insight. – g-radam Mar 25 '24 at 13:43