aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2005-01-31 18:30:33 +0000
committerH. Peter Anvin <hpa@zytor.com>2005-01-31 18:30:33 +0000
commit2f437e650e00a920bcc9491eab40c676601d9c6c (patch)
treee54d38b1541d859bdaffc66c8b5d3392d9ee928e
parent22cde118ec4afd3f283a2b5bbf638f0403ed5694 (diff)
downloadabc80-2f437e650e00a920bcc9491eab40c676601d9c6c.tar.gz
abc80-2f437e650e00a920bcc9491eab40c676601d9c6c.tar.xz
abc80-2f437e650e00a920bcc9491eab40c676601d9c6c.zip
Debounce for 4 ms
-rwxr-xr-xabc80.qpf2
-rw-r--r--debounce.v8
2 files changed, 5 insertions, 5 deletions
diff --git a/abc80.qpf b/abc80.qpf
index 4f2bf37..ed64da1 100755
--- a/abc80.qpf
+++ b/abc80.qpf
@@ -21,7 +21,7 @@
QUARTUS_VERSION = "4.1"
-DATE = "10:03:50 January 31, 2005"
+DATE = "10:04:30 January 31, 2005"
# Revisions
diff --git a/debounce.v b/debounce.v
index 53ad806..487b6b7 100644
--- a/debounce.v
+++ b/debounce.v
@@ -12,11 +12,11 @@ module debounce (
output strobe;
// This is optimized for a 12.5 MHz clock and the
- // assumption that glitches are limited to 20 us
+ // assumption that glitches are limited to 4 ms
reg out;
reg out1;
- reg [7:0] ctr;
+ reg [15:0] ctr;
assign strobe = out ^ out1;
@@ -33,14 +33,14 @@ module debounce (
if ( in )
begin
- if ( ctr == 8'hFF )
+ if ( ctr == 16'hFFFF )
out <= 1'b1;
else
ctr <= ctr + 1;
end
else
begin
- if ( ctr == 8'h00 )
+ if ( ctr == 16'h0000 )
out <= 1'b0;
else
ctr <= ctr - 1;