Line 55... |
Line 55... |
--=============================================================================================
|
--=============================================================================================
|
-- Constants
|
-- Constants
|
--=============================================================================================
|
--=============================================================================================
|
-- debounce generics
|
-- debounce generics
|
constant N : integer := 8; -- 8 bits (8 switch inputs)
|
constant N : integer := 8; -- 8 bits (8 switch inputs)
|
constant CNT_VAL : integer := 1000; -- debounce period = 1000 * 10 ns (10 us)
|
constant CNT_VAL : integer := 5000; -- debounce period = 1000 * 10 ns (50 us)
|
|
|
--=============================================================================================
|
--=============================================================================================
|
-- Signals for internal operation
|
-- Signals for internal operation
|
--=============================================================================================
|
--=============================================================================================
|
--- switch debouncer signals ---
|
--- switch debouncer signals ---
|
Line 103... |
Line 103... |
--=============================================================================================
|
--=============================================================================================
|
-- LED register update
|
-- LED register update
|
leds_reg_proc: leds_reg <= sw_reg; -- leds register is a copy of the updated switch register
|
leds_reg_proc: leds_reg <= sw_reg; -- leds register is a copy of the updated switch register
|
|
|
-- update debug register
|
-- update debug register
|
dbg_lo_proc: dbg(7 downto 0) <= sw_i; -- lower debug port has debounced switch data
|
dbg_lo_proc: dbg(7 downto 0) <= sw_i; -- lower debug port has direct switch connections
|
dbg_hi_proc: dbg(15 downto 8) <= sw_data; -- upper debug port has direct switch connections
|
dbg_hi_proc: dbg(15 downto 8) <= sw_data; -- upper debug port has debounced switch data
|
|
|
|
|
--=============================================================================================
|
--=============================================================================================
|
-- OUTPUT LOGIC PROCESSES
|
-- OUTPUT LOGIC PROCESSES
|
--=============================================================================================
|
--=============================================================================================
|