I didn't know that existed, I'm checking it out right now. So far, if I've set it up right, it hasn't helped, still on the "ON" black screen :/ I'm doing a big simulation right now to try and make sure I did it right.
Here is my updated code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity vgatest is
PORT ( C24 : in BIT;
SW : in UNSIGNED(9 downto 0);
KEY : in UNSIGNED(3 downto 0);
LEDG : out UNSIGNED(7 downto 0);
VGA_R,VGA_G,VGA_B : out UNSIGNED(3 downto 0) := "0000";
VGA_HS : out BIT := '1';
VGA_VS : out BIT := '1';
DEB1 : out INTEGER;
DEB2 : out INTEGER;
DEB3 : out boolean;
DEB4 : out boolean
);
end vgatest;
architecture vtbehav of vgatest is
signal C252 : bit := '0';
signal H_READY : boolean := true;
signal V_READY : boolean := false;
signal H_CNT : integer := 0;
signal V_CNT : integer := 494;
signal RDATA, GDATA, BDATA: UNSIGNED(3 downto 0) := "1111";
component vgapll is
PORT( inclk0 : IN BIT;
c0 : OUT BIT ;
locked : OUT BIT
);
end component;
begin
VGACLK : vgapll port map(C24, C252);
process(C252)
begin
if C252'event and C252 = '1' then
H_CNT <= H_CNT + 1;
--HSYNC
if H_CNT = 640 then
H_READY <= false;
elsif H_CNT = 660 then
VGA_HS <= '0';
elsif H_CNT = 755 then
VGA_HS <= '1';
elsif H_CNT = 800 then
H_READY <= true;
H_CNT <= 0;
V_CNT <= V_CNT + 1;
end if;
--VSYNC
if V_CNT = 480 then
V_READY <= false;
elsif V_CNT = 494 then
VGA_VS <= '0';
elsif V_CNT = 496 then
VGA_VS <= '1';
elsif V_CNT = 528 then
V_READY <= true;
V_CNT <= 0;
end if;
if H_READY and V_READY then
VGA_R <= "0000";
VGA_G <= "0000";
VGA_B <= "1111";
end if;
end if;
end process;
DEB1 <= H_CNT;
DEB2 <= V_CNT;
DEB3 <= H_READY;
DEB4 <= V_READY;
end vtbehav;
EDIT: The PLL didn't solve my problem, but the timing seems to be better, but made the simulation take waaaaay too long. I'll try it with any new solutions to see if maybe it needs a more precise clock AND whatever the solution is here. BTW the closest I could get the new clock to was 25.20 MHz, with the intended clock 25.175MHZ.
EDIT 2: HA! I never turned the VGA_R/G/B OFF on the front/back porch! :D It works now.