I'm in work placement and I have this subject in VHDL : Measurement system of response time of computer monitor. To succeed I thought about to put a photodiode in front of the monitor and switch in black and white every second the monitor to known the response time. But I don't know really how to make that, I use a spartan 3 connected at the monitor by VGA. I right a program I'm not sure if it's right, (I think it's wrong). I show you my program :
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL
USE IEEE.NUMERIC_STD.ALL
ENTITY Counter IS
PORT(clk, rst : IN STD_LOGIC;
sync, PhD : IN STD_LOGIC;
s : OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END ENTITY Counter;
ARCHITECTURE Main OF Counter IS
SIGNAL q : UNSIGNED (3 DOWNTO 0);
BEGIN
s <= STD_LOGIC_VECTOR(q);
PROCESS (clk, rst) IS
BEGIN
IF rst='1' THEN
q<=(OTHERS => '0');
ELSIF RISING_EDGE(clk) THEN
IF sync='0' THEN
q=q;
ELSIF sync='1' THEN
IF PhD='0' THEN
q<=q+1;
ELSIF PhD='1' THEN
q=q;
END IF;
END IF;
END IF;
END PROCESS;
END ARCHITECTURE Mai
n;
Tell me if you need something more maybe I forgot something. And tell me what you thing about my program.