alarm working, LED needs fix later on
This commit is contained in:
@@ -20,7 +20,7 @@ set_property -dict { PACKAGE_PIN W16 IOSTANDARD LVCMOS33 } [get_ports {SW_MODE
|
||||
#set_property -dict { PACKAGE_PIN W13 IOSTANDARD LVCMOS33 } [get_ports {sw[7]}]
|
||||
#set_property -dict { PACKAGE_PIN V2 IOSTANDARD LVCMOS33 } [get_ports {sw[8]}]
|
||||
#set_property -dict { PACKAGE_PIN T3 IOSTANDARD LVCMOS33 } [get_ports {sw[9]}]
|
||||
#set_property -dict { PACKAGE_PIN T2 IOSTANDARD LVCMOS33 } [get_ports {sw[10]}]
|
||||
set_property -dict { PACKAGE_PIN T2 IOSTANDARD LVCMOS33 } [get_ports {RST_B}]
|
||||
# Budik
|
||||
set_property -dict { PACKAGE_PIN R3 IOSTANDARD LVCMOS33 } [get_ports {SW_ALARM_SET}]
|
||||
set_property -dict { PACKAGE_PIN W2 IOSTANDARD LVCMOS33 } [get_ports {SW_DIN[0]}]
|
||||
@@ -30,7 +30,7 @@ set_property -dict { PACKAGE_PIN R2 IOSTANDARD LVCMOS33 } [get_ports {SW_DIN[
|
||||
|
||||
|
||||
## LEDs
|
||||
#set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports {led[0]}]
|
||||
set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports {ALARM_LED}]
|
||||
#set_property -dict { PACKAGE_PIN E19 IOSTANDARD LVCMOS33 } [get_ports {led[1]}]
|
||||
#set_property -dict { PACKAGE_PIN U19 IOSTANDARD LVCMOS33 } [get_ports {led[2]}]
|
||||
#set_property -dict { PACKAGE_PIN V19 IOSTANDARD LVCMOS33 } [get_ports {led[3]}]
|
||||
|
||||
@@ -11,6 +11,7 @@ entity top_modul is
|
||||
SW_ALARM_SET : in STD_LOGIC; -- '0' = Display Clock, '1' = Set Alarm
|
||||
SW_DIN : in STD_LOGIC_VECTOR (3 downto 0); -- Value to set
|
||||
BTN_LOAD : in STD_LOGIC_VECTOR (3 downto 0); -- Which digit to set
|
||||
RST_B : in STD_LOGIC;
|
||||
SEGMENTS : out STD_LOGIC_VECTOR (7 downto 0);
|
||||
ANODS : out STD_LOGIC_VECTOR (3 downto 0);
|
||||
ALARM_LED : out STD_LOGIC -- LED lights up when alarm triggers
|
||||
@@ -101,20 +102,19 @@ begin
|
||||
);
|
||||
|
||||
-- Comparator Logic for alarm LED to be ON or OFF
|
||||
-- TODO BUG proste niekedy na zaciatku ledka svieti aj ked ma byt zhasnuta
|
||||
process(CLK)
|
||||
begin
|
||||
if rising_edge(CLK) then
|
||||
if RST = '1' or RST_B = '1' then
|
||||
ALARM_LED <= '0';
|
||||
-- Match condition (HH:MM)
|
||||
if (sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
||||
elsif (START = '1' and
|
||||
sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
||||
sig_m_tens = alrm_m_tens and sig_m_units = alrm_m_units and
|
||||
sig_s_tens = "0000" and sig_s_units = "0000") then
|
||||
ALARM_LED <= '1';
|
||||
end if;
|
||||
|
||||
-- Reset turns the alarm LED off
|
||||
if RST = '1' then
|
||||
ALARM_LED <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user