Need help writing VGA Driver

Discussion in 'The Projects Forum' started by JeremyW, Jun 4, 2013.

  1. JeremyW

    Thread Starter New Member

    Jun 4, 2013
    1
    0
    Hello,

    this is for programming an FPGA. I wasn't sure where to post it, so I'm going to post it here.

    I am trying to write a 640x480 vga driver in verilog. I am analyzing a working VHDL module and following this ( http://people.ece.cornell.edu/land/c...raf225_dah322/ ) as a guide. The problem is that I am just getting a black screen, the monitor is picking up the VGA signal, but it is not rendering any image onto the screen (I am seeking a totally white image on the screen.)

    I have tried the other module and plugged it into my FPGA. It function perfectly, which implies that the wiring is proper.

    I have compared my waveforms in a modelsim simuation to that which I know works perfectly and I still am unable to get anything other than a black screen.

    I don't expect you to analyze this verilog code line for line (since there are a lot of unnamed constants) but I would appreciate it if you looked at the produced waveforms in a simulator and assure it is proper. Further, maybe if you tried plugging this into your own development boards?

    Is it at all possible that quartus is not synthesising my verilog code properly due to some faulty configuration on my part? I'm not super familiar with quartus, and I don't have a logic analyzer\oscillopscope handly to confirm the FPGA is working as the simulations say it should.

    Here is my verilog code, I appreciate your insight:


    Code ( (Unknown Language)):
    1.  
    2. module vgaDriver(
    3.     clk50M,
    4.     reset,
    5.     hsync,
    6.     vsync,
    7.     red,
    8.     green,
    9.     blue);
    10.    
    11. input clk50M;
    12. input reset;
    13.  
    14. output hsync;
    15. output vsync;
    16.  
    17. output red;
    18. output green;
    19. output blue;
    20.  
    21. wire clk50M;
    22.  
    23. reg [20:0] countV;
    24.  
    25. wire hsync;
    26. wire vsync;
    27.  
    28. wire red;
    29. wire green;
    30. wire blue;
    31.  
    32. initial
    33.   begin
    34.     countV = 833039;
    35.   end
    36.  
    37. always @(posedge clk50M or posedge reset)
    38.     if (reset) begin
    39.     countV <= 833039;
    40.     end
    41.     else begin
    42.         countV <= (countV + 21'd1) % 21'd834642;
    43.     end
    44.  
    45. assign hsync = (countV % 1602) >= 192;
    46. assign vsync = countV >= 3204;
    47.  
    48. assign red = countV > 60878 && countV < 818629 && (countV % 1602) > (192 + 94) && (countV % 1602) < (192 + 94 + 1280);// && countV % 4 >= 2;
    49. assign green = red;//(countV % 250 > 100);
    50. assign blue = red;
    51.  
    52. endmodule
    53.  
    54.  
    55.  
     
Loading...