aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@tha.de>2024-05-10 13:49:52 +0200
committerFriedrich Beckmann <friedrich.beckmann@tha.de>2024-05-10 13:49:52 +0200
commit25ed296488cd6d9dca9b93ec5ecf76966da1131b (patch)
treefb8972945d4c64ce5b426e52e4c21832da31602f /src
parentbc7d43b160864d53e7e4bbea81b29d5e8903baf4 (diff)
add pwm
Diffstat (limited to 'src')
-rw-r--r--src/pwm.vhd17
-rw-r--r--src/top_count.vhd5
2 files changed, 21 insertions, 1 deletions
diff --git a/src/pwm.vhd b/src/pwm.vhd
new file mode 100644
index 0000000..b23a170
--- /dev/null
+++ b/src/pwm.vhd
@@ -0,0 +1,17 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity pwm is
+ port (
+ clk : in std_ulogic;
+ rst_n : in std_ulogic;
+ ctrl_i : in std_ulogic_vector(3 downto 0);
+ pwm_o : out std_ulogic);
+end entity;
+
+architecture rtl of pwm is
+begin
+
+end architecture rtl;
+
diff --git a/src/top_count.vhd b/src/top_count.vhd
index 57c6998..0a84349 100644
--- a/src/top_count.vhd
+++ b/src/top_count.vhd
@@ -16,6 +16,7 @@ architecture rtl of top_count is
signal rst_n : std_ulogic;
signal x : std_ulogic;
signal en : std_ulogic;
+ signal pwm : std_ulogic;
signal cnt : std_ulogic_vector(3 downto 0);
begin
-- Assign the inputs to signals with reasonable names
@@ -24,6 +25,8 @@ begin
x <= KEY(1);
cnt <= "0000";
+ en <= '0';
+ pwm <= '0';
bin2seg_inst: entity work.bin2seg
port map(
@@ -34,7 +37,7 @@ begin
-- Set the outputs;
EXP(7 downto 4) <= cnt;
EXP(3 downto 0) <= (3 => en,
- 2 => x,
+ 2 => pwm,
1 => rst_n,
0 => clk);
LEDR <= SW;