Hi am vijay i would like to get details on dc motor verilog code for pwm.My friend Justin said dc motor verilog code for pwm will be available here and now i am living at hyderabad and i last studied in the college/school jntuk and now am doing project i need help on dc motor control by pwm using verolog code etc
Posts: 14,118
Threads: 61
Joined: Oct 2014
Description
In this example to rotate DC motor clockwise/counter clockwise continuously the motor interface card. For that in Spartan3 FPGA lines (P77, P78) are configured for (Coil-A to Coil-B). FPGA Lines (P79) to enable the dc motor. User could verify the result by “Stepper/DC motor Card” connected to the FPGASP3 KIT at connector J6.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity first is
port ( clk : in std_logic;
rst : in std_logic;
enable : out std_logic;
output1 : out std_logic;
output2 : out std_logic);
end first;
architecture Behavioral of first is
begin
process(rst,clk)
variable i : integer := 0;
begin
if rst = '1' then
if clk'event and clk = '1' then
enable <= '1';
if i <= 1005000 then
i := i + 1;
output1 <= '0';
output2 <= '0';
elsif i > 1005000 and i < 1550000 then
i := i + 1;
output1 <= '1';
output2 <= '0';
elsif i = 1550000 then
i := 0;
end if;
end if;
end if;
end process;
end Behavioral;