Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

VGA assistance

I've been introduced to this altera kit since entering college. May need some assistance on using the VGA output. Anyone of you mind lending assistance to me. Your help will be much appreciated. =)

*Am a rookie, please pardon me for my greenhorn-ness*

I'm supposed to construct a code that allows the VGA output ADV7123 produce a coloured screen or even possible, a simple image. The following is what I have done, but doesn't work.

Am using the old version of cyclone 2. EP2C35F672C6N.

Am still trying to figure out what values and the various declaration styles. Any kind souls do help me thanks.

module VGAOUT ( input CLOCK_50, output VGA_HS, output VGA_VS, output [9:0]VGA_R,

output [9:0]VGA_B, output [9:0]VGA_G);

reg clk = 1'b0;

always @ (posedge CLOCK_50)

clk = ~clk;

reg [9:0]Counter1= 0;

reg [8:0]Counter2= 0;

wire CounterXmaxed = (Counter1== 768);

always @ (posedge clk)

if(CounterXmaxed)

Counter1 <= 0;

else

Counter1 <= Counter1 + 1;

always @(posedge clk)

if(CounterXmaxed)

Counter2 <= Counter2 + 1;

reg vga_HS, vga_VS;

always @(posedge clk)

begin

vga_HS <= (Counter1[9:4]==0);

vga_VS <= (Counter2==0);

end

assign VGA_HS = ~vga_HS

assign VGA_VS = ~vga_VS;

assign VGA_R[9:0]=10'hFA;

assign VGA_G[9:0]=10'hFA;

assign VGA_B[9:0]=10'hFE;

endmodule
No RepliesBe the first to reply