Hello guys,
it's been a really long time for me without coding in VHDL. I need a stepper motor controller for my nios2 based project so i thought it's best to implement it in FPGA which led me to write the code bellow:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity stepper_motor_controller is
port ( reset_n, clk, F_Hn: in std_logic;
MC: in std_logic_vector (1 downto 0);
steps: out std_logic_vector (3 downto 0));
end entity;
architecture behav of stepper_motor_controller is
signal halffull :std_logic_vector (3 downto 0);
begin
process (reset_n,MC(1),F_Hn) begin
if (reset_n = '0') then
halffull <= (others=>'0');
elsif (MC(1) = '0') then
halffull <= (others=>'0');
elsif (F_Hn = '0') then
halffull <= "0001";
else halffull <= "0011";
end if;
end process;
process (clk) begin
if (rising_edge(clk)) then
if (MC(0)= '1') then
halffull <= halffull(0) & halffull(3 downto 1); --rotate right
else halffull <= halffull(2 downto 0) & halffull(3); --rotate left
end if;
else halffull <= halffull;
end if;
end process;
steps <= halffull;
end architecture;
unexpectingly, i ended up having the following error msg:
Error (10327): VHDL error at stepper_motor_controller.vhd(16): can't determine definition of operator ""="" -- found 0 possible definitions
i'll really appretiate it if someone could point out the reason for this error or suggest a modification to get over it
Thx in advance, good day ;)
it's been a really long time for me without coding in VHDL. I need a stepper motor controller for my nios2 based project so i thought it's best to implement it in FPGA which led me to write the code bellow:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity stepper_motor_controller is
port ( reset_n, clk, F_Hn: in std_logic;
MC: in std_logic_vector (1 downto 0);
steps: out std_logic_vector (3 downto 0));
end entity;
architecture behav of stepper_motor_controller is
signal halffull :std_logic_vector (3 downto 0);
begin
process (reset_n,MC(1),F_Hn) begin
if (reset_n = '0') then
halffull <= (others=>'0');
elsif (MC(1) = '0') then
halffull <= (others=>'0');
elsif (F_Hn = '0') then
halffull <= "0001";
else halffull <= "0011";
end if;
end process;
process (clk) begin
if (rising_edge(clk)) then
if (MC(0)= '1') then
halffull <= halffull(0) & halffull(3 downto 1); --rotate right
else halffull <= halffull(2 downto 0) & halffull(3); --rotate left
end if;
else halffull <= halffull;
end if;
end process;
steps <= halffull;
end architecture;
unexpectingly, i ended up having the following error msg:
Error (10327): VHDL error at stepper_motor_controller.vhd(16): can't determine definition of operator ""="" -- found 0 possible definitions
i'll really appretiate it if someone could point out the reason for this error or suggest a modification to get over it
Thx in advance, good day ;)