Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > please please please take attention to my letter

Reply
Thread Tools

please please please take attention to my letter

 
 
mera mera is offline
Junior Member
Join Date: Mar 2011
Posts: 5
 
      03-29-2011
hi everyone
my project is (control dc motor by using fpga) so i want from you to help me with the vhdl code as soon as you can i hope if you can this week
because i am lost in vhdl
thanks
 
Reply With Quote
 
 
 
 
tebzoo tebzoo is offline
Junior Member
Join Date: Mar 2011
Posts: 1
 
      03-29-2011
hi mera, you know the way im so streesed i dnt even know how to use this forum, but what i know i need help..please
 
Reply With Quote
 
 
 
 
mera mera is offline
Junior Member
Join Date: Mar 2011
Posts: 5
 
      03-31-2011
hi every one please why no one help me
hahaha tebzoo we are lost in vhdl
 
Reply With Quote
 
joris joris is offline
Senior Member
Join Date: Jan 2009
Posts: 153
 
      03-31-2011
I think you may get help if you make your question more specific
 
Reply With Quote
 
mera mera is offline
Junior Member
Join Date: Mar 2011
Posts: 5
 
      04-01-2011
ok joris i mean i want to write a progrme in vhdl to make a counter to make it as duration for pwm but i want to make it parallel counter then i need to make a divider to make the frequency less than 30 kHz with a dc input( 5 volt )
i try to write a program but there is an error and i could not solve it\

this is the program that i try to write

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY pwm1 IS
PORT(
clk : IN std_logic;
connect : buffer std_logic;
pwm_in : in std_logic_vector(4 downto 0);
pwm_out : out std_logic);
END pwm1;
architecture behavorial of pwm1 is
signal clk1: std_logic;
signal count: std_logic_vector (4 downto 0) := "00000";
BEGIN
divisor: process (clk)
variable resolution : integer:=0;
constant resolution_limit : integer := 32;
variable divider : integer:=0;
constant divider_limit : integer :=1000;
begin
if (clk'EVENT AND clk='1') then
if divider = divider_limit then
divider := 0;
else
divider := divider + 1;
end if;
clk1 <= clk;

if resolution = resolution_limit then
resolution := 0;
connect <= '1';
else
resolution := resolution + 1;
connect <= '0';
end if;
end if;
end process divisor;

pwm: process (clk1)
begin
if connect ='1' then count <= "00000";
elsif clk1'event and clk1 ='1' then
count <= count + '1';
if count < pwm_in then
pwm_out <= '1';
else
pwm_out <= '0';
end if;
end if;
end process pwm;

END behavorial;


i dont think so you can understand me because i could not explane what i need
but i hope you can help me as soon as you can because i need it sunday
 
Reply With Quote
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 346
 
      04-02-2011
Hi Mera

Try to find inspiration here: jjmk.dk/MMMI/Exercises/05_Counters_Shreg/No7_PWM_vs_SigmaDelta/index.htm

Copy to the address line.
 
Reply With Quote
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 346
 
      04-02-2011
Hi again

I'm not sure about the purpose of Resolution and Connect - but one should be better

Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY pwm1 IS
      PORT(
            clk : IN std_logic;
            connect : buffer std_logic;
            pwm_in : in std_logic_vector(4 downto 0);
            pwm_out : out std_logic);
      END pwm1;
      
architecture behavorial of pwm1 is
   signal clk1: std_logic;
   signal count: std_logic_vector (4 downto 0) := "00000";
BEGIN

   divisor: process (clk)
      variable resolution : integer:=0;
      constant resolution_limit : integer := 32;
      variable divider : integer:=0;
      constant divider_limit : integer :=1000;
   begin
      if (clk'EVENT AND clk='1') then
         if divider = divider_limit then
            divider := 0;
            Clk1 <= '1';
         else
            divider := divider + 1;
            Clk1 <= '0';
         end if;

         if resolution = resolution_limit then
            resolution := 0;
            connect <= '1';
         else
            resolution := resolution + 1;
            connect <= '0';
         end if;
      end if;
   end process divisor;

   pwm: process (Clk, connect)
   begin
      if connect ='1' then
         count <= "00000";
      elsif clk'event and clk ='1' then
         if Clk1='1' then
            count <= count + '1';
            if count < pwm_in then
               pwm_out <= '1';
            else
               pwm_out <= '0';
            end if;
         end if;
      end if;
   end process pwm;

END behavorial
;
 
Reply With Quote
 
mera mera is offline
Junior Member
Join Date: Mar 2011
Posts: 5
 
      04-02-2011
hi thank you very much
The resolution is very important to be sure that i can take a lot of number of speed and we can make that by increase the digit of the “resolution_limit”.
i mean change the velocity of the motor by change the magnitude of resolution_limit
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is That A Letter...A Letter For Me? peterg@uti.com Computer Support 6 12-10-2006 12:32 PM
Take a slow ride....take it eeee-zy ellis_jay Computer Support 0 08-25-2005 01:31 AM
Re: big letter -> small letter Andrew McNamara Python 2 07-06-2004 02:09 PM
big letter -> small letter vertigo Python 4 07-06-2004 07:23 AM
RE: big letter -> small letter Tony Meyer Python 0 07-06-2004 07:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57