| Author |
Message |
sarang2502
Joined: 03 Jul 2009 Posts: 3 Location: Ahmedabad, India
|
03 Jul 2009 17:12 8051 stepper motor |
|
|
|
|
Hello frnds,
im stuck; plz help...
im having a unipolar stepper with 6 terminals (2 COMM), 12v, 1A Supply...
i hav written assembly code:
| Code: |
org 0H
stepper equ P1
main:
mov stepper, #08H
acall delay
mov stepper, #04H
acall delay
mov stepper, #02H
acall delay
mov stepper, #01H
acall delay
sjmp main
delay:
mov r7,#2
wait2:
mov r6,#0ccH
wait1:
mov r5,#0ffH
wait:
djnz r5,wait
djnz r6,wait1
djnz r7,wait2
ret
end
|
When motor is running it goes fwd for some time then suddenly goes backwd...
i have used this step sequence bcoz dis motor runs continous when one by one pulse is given to four terminals...
I am using driver IC L293D, problem is that; the step angle of motor is 5.3'...
i dont know how to use step angle for giving proper pulses...
im working on project of a robo car with two stepper motors interfaced with 8051..
it can move in all directions... if any suggestions, plz tell...
thnx in advance...
|
|
| Back to top |
|
 |
sarang2502
Joined: 03 Jul 2009 Posts: 3 Location: Ahmedabad, India
|
07 Jul 2009 11:54 stepper motor wire colours |
|
|
|
|
| please help me out.... no one here is with some knowledge on stepper motor inter facing with 8051???
|
|
| Back to top |
|
 |
GetDeviceInfo
Joined: 30 Mar 2009 Posts: 103
|
07 Jul 2009 15:12 stepper motor 8051 |
|
|
|
|
alot of times the problem is phase wiring. your step pattern may be good for one configuration, but useless in another. Post your schematic. Make sure you label motor wire colors.
But first, read this
|
|
| Back to top |
|
 |
Google AdSense

|
07 Jul 2009 15:12 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
ark5230
Joined: 29 Jun 2009 Posts: 188 Helped: 15 Location: India
|
16 Jul 2009 22:12 8051 controlling stepper motors |
|
|
|
|
| If you still have problem, please post more details or schematic and the approach to provide additional steps to get there. Presently your problem is not well defined so limited suggestions.
|
|
| Back to top |
|
 |
sarang2502
Joined: 03 Jul 2009 Posts: 3 Location: Ahmedabad, India
|
17 Jul 2009 6:36 stepper motor assembly code |
|
|
|
|
i found a new way.... using 'RR A' & 'RL A' commands '66h' data is continously moved on port 1.... stepper motor is connected with P1.0-P1.3..
so with this i can rotate stepper reverse nd forward...
if i connect another stepper motor on P1.4-P1.8 then both motors will rotate fwd nd reverse... but as im making car it is necessary to make left nd right turn (i.e. for a turn one motor should run fwd and other reverse..)
how do i do this??
plz help...
as such i have not made schematic... but the circuit is very simple with basic 89S52 requirement, L293d as driver...
| Code: |
org 0h
main: setb P2.7
mov a, #66h
mov p1, a
turn:
jnb p2.7, cw
rr a
acall delay
mov p1,a
sjmp turn
cw:
rl a
acall delay
mov p3,a
sjmp turn
delay:
mov r2, #30
h1: mov r3, #50
h2: djnz r3,h2
djnz r2,h1
ret
end
|
|
|
| Back to top |
|
 |
BABESH
Joined: 27 Sep 2005 Posts: 118 Helped: 10
|
17 Jul 2009 6:46 8051 stepper motor assembly code program |
|
|
|
|
Dude,
Take two seperate bytes one foreach motor,
For reverse or forward operation do your RLor RR on each byte,
then set the bit pattern in a single byte by fetching Higher Nible from one byte and lower nible from another byte and then OUT to P1,
If only one motor is needed to rotate at a time then maintain previous sequence to for associated motor.
--Babesh
|
|
| Back to top |
|
 |