I try to program a counter who counts the clock'edges between the signal changes. The problem is that when the the next change occours, the counter doesn't reset back to 0.
Can anyone help me with that ??
process(lastdata, data, cclk, test, change, clk, i, rs)
begin
change <= data xor lastdata;
if (rs = '1') then
i <= 0;
elsif(rising_edge(clk)) then
i <= i + 1;
end if;
if(rising_edge(change)) then
if( i >= 5) then
test <= '1';
else test <= '0';
end if;
end if;
if(change = '1') then
rs <= '1';
else rs <= '0';
end if;
lastdata <= data;
end process;
Regards, Kriki
Can anyone help me with that ??
process(lastdata, data, cclk, test, change, clk, i, rs)
begin
change <= data xor lastdata;
if (rs = '1') then
i <= 0;
elsif(rising_edge(clk)) then
i <= i + 1;
end if;
if(rising_edge(change)) then
if( i >= 5) then
test <= '1';
else test <= '0';
end if;
end if;
if(change = '1') then
rs <= '1';
else rs <= '0';
end if;
lastdata <= data;
end process;
Regards, Kriki