I'm relatively new with FPGA design, so sorry if this is rather a basic or common question. Unfortunately I wasn't able to find any answers to my troubles (for my particular board) after several days of searching.
I am working on an image processing project with my Altera DE1-SoC board and the first step is to display an image on the VGA display. To configure the display before dealing with the image itself, I first decided to program random patterns in the 640x480@60Hz VGA monitor. I used the first part of this code as the basis and tried running it on the board with the DE1 pin configuration:
The pins I am using are VGA_R, VGA_G, VGA_B, VGA_VS, VGA_HS as per example.
The indicator light on my monitor is green, suggesting there is some communication between the board and the display (if the timing specs are incorrect, this light is red). However, I only see black on the display, no matter what I set the RGB pins as. :-( Can anyone more experienced offer any suggestions as to why this is the case? Am I forgetting something obvious?
Did you simulate your design?
Are you sure the timings in your design are correct?
Did you check the signal levels (with a scope)?
Are you sure that all the pin assignments are correct?
Have you tried it with a different screen?
Are you able to see the Hsync, Vsync on the CRO (You can check these signals by connecting a prob on the display's Hsync, Vsync ports).
also check the clock.
If the Hsync and Vsync are able to see...
then try to find whether the RGB data are zero or not..
if the RGB data are zero then also you can see black screen.
Thanks, after studying the sync signals carefully my problem has been solved!!
A follow-up question:
I have now encoded an image in .MIF format and am trying to show it on the display. I've done this in MATLAB by converting the RGB values to unsigned int and storing them in a file:
Code:
color = red*(16*16) + green*16 + blue;
fprintf(fid,'%4u : %4u;\n',count,color);
Each R,G,B variable takes a value of 0-15 for a particular pixel. I then used the Altera ROM Megafunction to initialize the memory file. I used an address generator to scan through the image and display the pixels on the screen. I am decoding the .MIF addresses using the following code and writing it to VGA_R, VGA_G, VGA,B ports [7:4]:
Code:
always@(posedge VGA_CLK)
begin
VGA_R <= readData/256;
VGA_B <= readData%16;
VGA_G <= (index-(VGA_R*256))/16;
end
where readData is the q output for a particular memory address. I am using 4 bits of the VGA ports as this is the range for my R,G,B variables.
The result: The image shows up on the screen and fits. However, the green channel seems to dominate as the picture takes on a weird hue. I'm not sure if I'm using the VGA RGB ports correctly here, given that the channels take on 4-bit outputs? Maybe someone with more experience has the solution?
If I'm interpreting your design correctly, the colors are stored in the ROM in 12-bits per pixel (4 each for R, G, and B)? Assuming this is true, I might have the HDL set up as follows:
Code:
always@(posedge VGA_CLK)
begin
VGA_R <= readData[11:8];
VGA_G <= readData[7:4];
VGA_B <= readData[3:0];
end