Altera_Forum
Honored Contributor
13 years agoPWM generator
i want a PWM generator which i insert D.C in percents, so i did : (tmp_1 is my requierd D.C)
i defined signals like that : signal count_1 : std_logic_vector(15 downto 0); signal tmp_1 : std_logic_vector(6 downto 0) ; if PWM_creator_CLK'event and PWM_creator_CLK='1' then count_1 <= count_1 + 1; if count_1 = 49999 then count_1 <= (others => '0'); elsif count_1 < tmp_1*500 then ---------------------------------------------------------------------> got an Error at this line motor_1_PWM_OUT <= '1'; else motor_1_PWM_OUT <= '0'; end if; end if; end process motor_1_PWM ; how can i do this condition by another way ? thank you for help...