Electronics development

Moderators: None (Apply to moderate this forum)
Number of threads: 541
Number of posts: 1056

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Hi, i have a very very simple VHDL Posted by shahar24 on 19 Sept 2012 at 1:21 AM
model i need to build. Yet, it doesn't work :(

the purpose of the code is very simple. I have a step motor i connect to a circuit matrix. the circuit matrix has a ULN2803 transistor. And the matrix is connected to an Altera EPF10K70 device . i need to make the motor turn right at my command (pressing a button on the altera) and turn left at the pressing of the other button. every button pressing is to adjust the motor to the side by a click. Meaning, that one short press only moves it slightly, and a long press keeps it moving until i stop pressing it.

but it doesn't work :(

I have to assign this project for next sunday, or else i'll flank this course.. pls people - i desperetaly need ur help!

here's the code i did:


entity MOTOR2 is
port
(out1_rl, out2_rl, out3_rl, out4_rl : out std_logic;
right, left : in std_logic);
end MOTOR2;

architecture behave of MOTOR2 is
Begin
process (right)
VARIABLE temp_rl : INTEGER RANGE 1 TO 4;
Begin
temp_rl:=1;
if (temp_rl=1) then
out2_rl<='1';
temp_rl:=2;
end if;
if (temp_rl=2) then
out3_rl<='1';
temp_rl:=3;
end if;
if (temp_rl=3) then
out4_rl<='1';
temp_rl:=4;
end if;
if (temp_rl=4) then
out1_rl<='1';
temp_rl:=1;
end if;
end process;
end behave;




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.