Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- I am no expert on debouncing logic. some boards have it as part of switch design outside fpga. but you can try this(not tested) per each switch
signal count_0 : unsigned(17 downto 0) := (others => '0');
signal sw_0_d, sw_0_final : std_logic;
--in a clocked process
sw_0_d <= sw_0;
if sw_0 = sw_0_d then
count_0 <= count_0 +1;
else
count_0 <= (others => '0');
end if;
if count_0 > 250000 then -- about 5 msec bounce time
sw_0_final <= sw_0;
end if;
--- Quote End --- ------------------------------------------------------------------ Sorry to bother you guys again , Kaz, i am having difficulties to cause the code to function without errors, please where exactly in the clock process or per each switch in my code should i insert the code your posted. Thanks for helping