Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
1082 Discussions

PleeeeZe Help me on VGA PROBLEM

Altera_Forum
Honored Contributor II
848 Views

Hi everyone , 

 

I am working in project that need to display an image using DE2 board but my problem is that I am beginner on using veirelog. :( :( 

 

any one have code on veirelog that interface the VGA to DE2 board ?? :( 

I have this code and I don't know if it is OK or not >>>> 

 

 

module hvsync_generator(clk, vga_h_sync, vga_v_sync, inDisplayArea, CounterX, CounterY); 

input clk; 

output vga_h_sync, vga_v_sync; 

output inDisplayArea; 

output [9:0] CounterX; 

output [8:0] CounterY; 

 

////////////////////////////////////////////////// 

reg [9:0] CounterX; 

reg [8:0] CounterY; 

wire CounterXmaxed = (CounterX==10'h2FF); 

 

always @(posedge clk) 

if(CounterXmaxed) 

CounterX <= 0; 

else 

CounterX <= CounterX + 1; 

 

always @(posedge clk) 

if(CounterXmaxed) CounterY <= CounterY + 1; 

 

reg vga_HS, vga_VS; 

always @(posedge clk) 

begin 

vga_HS <= (CounterX[9:4]==6'h2D); // change this value to move the display horizontally 

vga_VS <= (CounterY==500); // change this value to move the display vertically 

end 

 

reg inDisplayArea; 

always @(posedge clk) 

if(inDisplayArea==0) 

inDisplayArea <= (CounterXmaxed) && (CounterY<480); 

else 

inDisplayArea <= !(CounterX==639); 

 

assign vga_h_sync = ~vga_HS; 

assign vga_v_sync = ~vga_VS; 

 

endmodule
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
53 Views

how did you solve?

Reply