setp_motor.vhd
来自「【经典设计】VHDL源代码下载~~ 其中经典的设计有:【自动售货机】、【电子钟」· VHDL 代码 · 共 31 行
VHD
31 行
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity step_motor is
port (reset:in STD_LOGIC; --system reset signal
dir: in STD_LOGIC; --direction
clk: in STD_LOGIC; --system clock signal
ini: in STD_LOGIC; --enable switch of loading initial
manner: in STD_LOGIC_VECTOR (1 downto 0); --phase excite manner
angle: in INTEGER range 255 downto 0; --phase define
baBA: out STD_LOGIC_VECTOR (3 downto 0)); --state output of setp motor
end step_motor;
--define the signal_structure and flow of the device
architecture stepmotor_arch of step_motor is
signal count: INTEGER range 0 to 7; --counter
signal cntInc: INTEGER range -2 to 2; --count increment
signal cntIni: INTEGER range -1 to 0; --count increment initial
signal angleDnCount: INTEGER range 255 downto 0; --count how many step-angles processed
signal angleDnCntDec: INTEGER range 2 downto 1; --angleCount decrement
begin
-- <<enter your statements here>>
process(dir, manner, angle)--, ini)
begin
--if ini='1' then
if dir='0' then
case manner is
when "01" => -- 1-
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?