Commit ea1e59d9 authored by Javinator9889's avatar Javinator9889 🎼

Upload New File

parent cb707455
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_unsigned.all;
entity stepperMotor is
port (
enable: in std_logic;
enableOut: out std_logic
);
end entity stepperMotor;
architecture behavioral of stepperMotor is
-- Orchestrator
signal tmp : std_logic := '0';
signal count: std_logic_vector (17 downto 0) := (others=>'0');
--signal count_steps: std_logic_vector (5 downto 0) := (others=>'0');
--signal max_steps: std_logic_vector(5 downto 0) := ;
begin
ENB : process (enable)
begin
if(enable='1') then
enableOut <= '0';
else
enableOut <= '1';
end if;
end process;
-- Orchestrator
DIVIDER : process(clk, dir)
begin
if(clk'event and clk='1') then
count <= count + 1;
if (count = "11000011010100000") then -- If the clk operates at 100 MHz, its clock cycle is 0.000 000 01 second = 10 ns.
tmp <= NOT tmp;
count <= (others=>'0');
end if;
end if;
clockOut <= tmp;
end process;
end behavioral;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment