Spartan 3E debounce help needed

Status
Not open for further replies.

uncond1t1on4l

Newbie level 2
Joined
Feb 21, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
I am working on an assignment and I don't know how to debounce the push buttons and switches for the Spartan-3E board. I know I have to add some time-delay to get ride of the bounce, but I dont know how to do that in assembly language. =[
 

Hi, if you use Xilinx ISE, you can look at Language templates. The path (from inside ISE sources) is:
Edit->Language Templates, and in case you use VHDL: ->VHDL->Synthesis Constructs->Coding Examples->Misc->Debounce circuit.
The code itself is:
---'begin' keywords**
signal Q1, Q2, Q3 : std_logic;

--**Insert the following after the 'begin' keyword**
process(<clock>)
begin
if (<clock>'event and <clock> = '1') then
if (<reset> = '1') then
Q1 <= '0';
Q2 <= '0';
Q3 <= '0';
else
Q1 <= D_IN;
Q2 <= Q1;
Q3 <= Q2;
end if;
end if;
end process;

Q_OUT <= Q1 and Q2 and (not Q3);
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…