How does a VGA monitor support different modes? (How to choose signal timings?)

Status
Not open for further replies.

amirahmadian

Member level 1
Joined
Jul 23, 2012
Messages
38
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,619
I'm confused by the signal timings for a VGA monitor.
We know that the VGA standard have different modes (There is a different resolution, refresh rate and signal timing for each mode). Also the pixel clock frequency, at which the VGA adapter device must send the image data, differs for different resolutions and refresh rates. Now I wonder how the monitor recognizes the mode that the adapter is using? Are there some predefined standard modes for each monitor and are we restricted to these specific modes?
I mean can I choose any pixel clock frequency that I like (at least in a specific range)? How does the monitor know this frequency? Maybe I must caculate the signal timings (VSYNC,HSYNC) according to the chosen pixel clock? Or there are only some special frequencies possible to choose ,etc ....? :-?
 
Last edited:

Hi;
In general monitor measures your hsync, vsync freq, also their polarity is another detection clue for the monitor.
After detecting the resolution then adjust adc clk according to incoming pixel clk.
On the other hand those h/v timings (freq) are defined in standart (such as Vesa, IBM etc). If you define your own arbitrary values, monitor cannot detect the signal, and display a message such as "unknown signal" or "out of range".
 
Thanks for your reply.
If you define your own arbitrary values, monitor cannot detect the signal, and display a message such as "unknown signal" or "out of range".
So , I must ONLY use the standard resolutions and standard frequencies for clock and sync signals? Ok, but how many standards are defined for that? Is there a complete list of all VGA standards availabe? And what's more, Do all the monitors support these standards? How do I know that a monitor supports the selected standard or doesn't !?...
 

Hi;
There ara many different timing standarts, vesa document could be received via some payment as i know, so cannot be found on web. On the other hand any monitor doesn't need to support all resolutions. Normally there is an eeprom placed on monitor (it can be read by i2c over the VGA connector pin12 and 15). It is called edid or ddc. Any graphics card normally reads this data and then knows which resolutions can be supported by the monitor.
ie in windows advanced graphic settings there is a check box "hide modes that this monitor cannot display", idea behind that is this scenario.
Hope it helps
 

You can modify the timing trough vga crt control registers, but double check your monitor signal limits. Or result is "out of limits" or dead monitor.
 

Hello, maybe i can help too.
Most of the modern videocards provides a VBE3-Bios. With a VBE3-Bios we can set some videomodes with our own CRT-parameter table maybe with higher refreshrates (above the default 60hz). But for to use different resolutions also with higher refreshrates it is recommended to get the enhanced display information data(EDID) from the used monitor via the display data cable(DDC). Here is an example of assembler code(intel syntax) for to get the capacity of the monitor looking for khz and hz:
Code:
	  mov      ax, 4F15h           ; DDC - INSTALLATION CHECK
 	  xor      bl, bl              ; = 0 for to get the monitor information
	  int    10h
	  cmp      ax, 4Fh
	  jnz NODDC
	  mov      ax, 4F15h           ; DDC - READ EDID
	  mov      bl, 1
	  xor      cx, cx
	  xor      dx, dx
	  mov      di, OFFSET EDID
	  int    10h
	  mov      eax, 0FD000000h     ; Text-identifier V/H range
	  mov      bx, 36h
	  cmp      [di+bx], eax        ; di+36h detailed timing #1
	  jz  short H1
	  lea      bx, [bx+12h]        ;  (add bx,12h)
	  cmp      [di+bx], eax        ; di+48h detailed timing #2
	  jz  short H1
	  lea      bx, [bx+12h]
	  cmp      [di+bx], eax        ; di+5Ah detailed timing #3
	  jz  short H1
	  lea      bx, [bx+12h]
	  cmp      [di+bx], eax        ; di+6Ch detailed timing #4
	  jnz NODDC
H1:       cmp     BYTE PTR[di+bx+6], MAXHZ
          jb  NOHZ
	  cmp     BYTE PTR[di+bx+8], MAXKHZ
          jb  NOKHZ

For to switch to a videomode with higher refreshrates using an own CRT-parameter table, we have to get the pixelclock and we have to recalculate the refreshrate before.
Code:
          mov      ax, 4F0Bh           ; Get/set Pixel-Clock
          mov      dx, cx
          xor      bl, bl              ; Get
          mov      ecx, DWORD PTR[PIXCLOC]
          int    10h
          cmp      ax, 4Fh
          jnz NOCLOC                   ; Error: No pixelcloc
          mov      DWORD PTR[PIXCLOC], ecx
;--------------------------
          xor      eax, eax            ; Calculate Refreshrate
          mov      ax, [CRTC]          ; Horizontal Total
          xor      ebx, ebx
          mov      bx, [VERTOTA]       ; Vertikal Total
          mul      ebx
          mov      ebx, eax
          mov      eax, ecx            ; Pixelcloc
          mov      esi, 10
          xor      edx, edx
          div      esi
          xor      edx, edx
          div      ebx
          mov      [REFRATE], ax       ; RefreshRate=Pixelcloc/(HTotal*Vtotal)

Here is an an example of an own CRT-parameter table:
Code:
;--------------------------------------
CRTC    DW 1456                        ; Horizontal Total       in Pixel
HORIANF DW 1122                        ; Horizontal  Sync-Start in Pixel
HORIEND DW 216                         ; Horizontal  Sync-End   in Pixel
VERTOTA DW 814                         ; Vertical   Total       in Lines
VERTANF DW 768                         ; Vertical    Sync-Start in Lines
VERTEND DW 42                          ; Vertical    Sync-End   in Lines
DOIFLAG DB 04h                         ; Flag (interlaced,doubleScan,polarity)
PIXCLOC DD 118309000                   ; Pixel clock in hz
REFRATE DW 10000                       ; Refresh-Rate in 0.01 hz
;---------------------
        DB 40 dup (0)

For more information please look into some public documents from vesa.org (costfree but need register and/or login):
EEDIDguideV1.pdf
EEDIDverifGuideRa.pdf
vbe3.pdf
For to calculate our own CRT-parameter we can use vbehz.
**broken link removed**

At last i have written a little pure DOS based demo(with asm sourcode) that shows how to use a videomode with an own CRT-parameter table.
This demo is using a resolution of 1024x768x32 with 100hz refreshrate. Addititinal this demo use the linear framebuffe(LFB; located in the 4.GB) and VBE hardware triple buffering.

For to write to the LFB using 32bit adresses this demo switch into the 16 bit unrealmode. So it can not be used together with EMS memorymanager like EMM386.EXE.
Tested with a MSI Geforce 4 TI4200(64MB; AGPx4) and a 19" CRT from Samsung and a 19" CRT from Samtron both with a capacity of 96 khz and 160hz.
www.alice-dsl.net/freecracmaps/Tool/Neutrip.zip

Dirk
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…