F
fpgawizz
Guest
I have this deboucing logic that i have using 2 d flip flops to sense an
push button input..the trouble here is that this also needs to be level
sensitive..i.e. as long as this push button is pushed i must display
something..
my code right now is
process(clk,button)
begin
if clk'event and clk = '1' then
button1 <= button;
button2 <= button1;
end if;
end process Debounce_Process;
mybutton <= button2 and (not(button1));
mybutton is my debounced version of button..but this signal mybutton does
not take care of the scenario when "button" is pushed and held high. In
that case i want button to be debounced when the first edge happens as
well as stay high since the user has still not taken his finger off of the
button.
Any thoughts on how i can achieve that?
thanks
push button input..the trouble here is that this also needs to be level
sensitive..i.e. as long as this push button is pushed i must display
something..
my code right now is
process(clk,button)
begin
if clk'event and clk = '1' then
button1 <= button;
button2 <= button1;
end if;
end process Debounce_Process;
mybutton <= button2 and (not(button1));
mybutton is my debounced version of button..but this signal mybutton does
not take care of the scenario when "button" is pushed and held high. In
that case i want button to be debounced when the first edge happens as
well as stay high since the user has still not taken his finger off of the
button.
Any thoughts on how i can achieve that?
thanks