about timing.

Discussion in 'VHDL' started by Amit, Mar 1, 2008.

  1. Amit

    Amit Guest

    Hello group,

    I'm looking at a source code which generates a vsync and hsync signal
    for VGA (640x480 pixel by pixel) and in there I see there is a
    checking if v_count and h_count condition is checked as follow:



    For horizontal and then vertical:

    --Generate horizontal and vertical timing signals for video signla
    --H_count counts pixels (640 + extra time for sync signals)


    if (h_count = 799 ) Then
    h_count <= "0000000000";
    else
    h_count <= h_count + 1;
    end if;


    if (v_count <= 755) AND (h_count =>659 ) Then
    horiz_sync <= '0';
    else
    horiz_sync <= '1';
    end if;



    if (v_count >= 524) AND (h_count =>699 ) Then
    v_count <= "0000000000";
    elsif
    v_count <= v_count + 1;
    end if;


    Questions:

    Why does it check for 799 when the resolution is 640?
    if it is extra time how is it calculated then?!
    same for the vertical? how should I know what number should I use in
    condition part?

    Thanks,
    Amit
     
    Amit, Mar 1, 2008
    #1
    1. Advertising

  2. Amit

    Guest

    On Mar 1, 4:59 pm, Amit <> wrote:
    > Hello group,
    >
    > I'm looking at a source code which generates a vsync and hsync signal
    > for VGA (640x480 pixel by pixel) and in there I see there is a
    > checking if v_count and h_count condition is checked as follow:
    >
    > For horizontal and then vertical:
    >
    > --Generate horizontal and vertical timing signals for video signla
    > --H_count counts pixels (640 + extra time for sync signals)
    >
    > if (h_count = 799 ) Then
    > h_count <= "0000000000";
    > else
    > h_count <= h_count + 1;
    > end if;
    >
    > if (v_count <= 755) AND (h_count =>659 ) Then
    > horiz_sync <= '0';
    > else
    > horiz_sync <= '1';
    > end if;
    >
    > if (v_count >= 524) AND (h_count =>699 ) Then
    > v_count <= "0000000000";
    > elsif
    > v_count <= v_count + 1;
    > end if;
    >
    > Questions:
    >
    > Why does it check for 799 when the resolution is 640?
    > if it is extra time how is it calculated then?!
    > same for the vertical? how should I know what number should I use in
    > condition part?
    >
    > Thanks,
    > Amit


    There's always some dead time between when the active pixels on one
    line end and those in the the next line start. This called the HBI
    (horizontal blanking interval). In the olden days, this time was
    needed for the magnetic field of the monitor's deflection coils to
    collapse and put the beam back at the left edge of the screen. Same
    idea for the dead time between bottom of active video and top of
    active picture. I'd expect you could google for a chart, or look for
    some Xilinx/Altera app notes, although I think there's more
    flexibility (read: slop) in the VGA/computer world than there is in
    real (read: television broadcast) video.

    - Kenn
     
    , Mar 1, 2008
    #2
    1. Advertising

  3. Amit

    Amit Guest

    On Mar 1, 3:36 pm, wrote:
    > On Mar 1, 4:59 pm, Amit <> wrote:
    >
    >
    >
    > > Hello group,

    >
    > > I'm looking at a source code which generates a vsync and hsync signal
    > > for VGA (640x480 pixel by pixel) and in there I see there is a
    > > checking if v_count and h_count condition is checked as follow:

    >
    > > For horizontal and then vertical:

    >
    > > --Generate horizontal and vertical timing signals for video signla
    > > --H_count counts pixels (640 + extra time for sync signals)

    >
    > > if (h_count = 799 ) Then
    > > h_count <= "0000000000";
    > > else
    > > h_count <= h_count + 1;
    > > end if;

    >
    > > if (v_count <= 755) AND (h_count =>659 ) Then
    > > horiz_sync <= '0';
    > > else
    > > horiz_sync <= '1';
    > > end if;

    >
    > > if (v_count >= 524) AND (h_count =>699 ) Then
    > > v_count <= "0000000000";
    > > elsif
    > > v_count <= v_count + 1;
    > > end if;

    >
    > > Questions:

    >
    > > Why does it check for 799 when the resolution is 640?
    > > if it is extra time how is it calculated then?!
    > > same for the vertical? how should I know what number should I use in
    > > condition part?

    >
    > > Thanks,
    > > Amit

    >
    > There's always some dead time between when the active pixels on one
    > line end and those in the the next line start. This called the HBI
    > (horizontal blanking interval). In the olden days, this time was
    > needed for the magnetic field of the monitor's deflection coils to
    > collapse and put the beam back at the left edge of the screen. Same
    > idea for the dead time between bottom of active video and top of
    > active picture. I'd expect you could google for a chart, or look for
    > some Xilinx/Altera app notes, although I think there's more
    > flexibility (read: slop) in the VGA/computer world than there is in
    > real (read: television broadcast) video.
    >
    > - Kenn



    Hello Keen,

    Thanks for the explanation. Now, how should we calculate it? how is it
    calculated?

    Regards,
    Amit
     
    Amit, Mar 2, 2008
    #3
  4. David Spencer, Mar 2, 2008
    #4
  5. Amit

    Amit Guest

    On Mar 1, 7:24 pm, "David Spencer" <> wrote:
    > "Amit" <> wrote in message
    >
    > news:...
    >
    > > On Mar 1, 3:36 pm, wrote:

    >
    > > Hello Keen,

    >
    > > Thanks for the explanation. Now, how should we calculate it? how is it
    > > calculated?

    >
    > > Regards,
    > > Amit

    >
    > Have a look athttp://www.epanorama.net/documents/pc/vga_timing.html.



    Hi David,

    Thank you so much. That was a big help.

    Regards,
    Amit
     
    Amit, Mar 2, 2008
    #5
  6. Amit

    Tricky Guest

    On Mar 2, 6:27 am, Amit <> wrote:
    > On Mar 1, 7:24 pm, "David Spencer" <> wrote:
    >
    > > "Amit" <> wrote in message

    >
    > >news:...

    >
    > > > On Mar 1, 3:36 pm, wrote:

    >
    > > > Hello Keen,

    >
    > > > Thanks for the explanation. Now, how should we calculate it? how is it
    > > > calculated?

    >
    > > > Regards,
    > > > Amit

    >
    > > Have a look athttp://www.epanorama.net/documents/pc/vga_timing.html.

    >
    > Hi David,
    >
    > Thank you so much. That was a big help.
    >
    > Regards,
    > Amit


    Video signals are made up of all sorts of timings. If you look at a
    video signal on a scope you will see that the actual video data only
    makes up about 2/3 of the overall signal. You have to worry about your
    syncs, plus flyback as modern monitors are disigned to work with
    standardised signals, that were made standard with analogue screens,
    which are still in major use.

    The counters may also be set to odd numbers depending of the clock
    speed of the system.
     
    Tricky, Mar 3, 2008
    #6
  7. Amit

    JK Guest

    JK, Mar 6, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kieran Francisco

    Timing Diagram to HDL Translation

    Kieran Francisco, Sep 8, 2003, in forum: VHDL
    Replies:
    9
    Views:
    1,293
    VhdlCohen
    Sep 17, 2003
  2. Kload

    Strange Timing Problem

    Kload, Oct 23, 2003, in forum: VHDL
    Replies:
    2
    Views:
    594
    Kload
    Oct 23, 2003
  3. Kload
    Replies:
    1
    Views:
    555
    John_H
    Oct 23, 2003
  4. ramzi
    Replies:
    0
    Views:
    521
    ramzi
    Nov 1, 2003
  5. guille
    Replies:
    0
    Views:
    575
    guille
    Dec 19, 2003
Loading...

Share This Page