electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

help req. for driving stepper motor with 8051.....


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> help req. for driving stepper motor with 8051.....
Author Message
sarang2502



Joined: 03 Jul 2009
Posts: 3
Location: Ahmedabad, India


Post03 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


Post07 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


Post07 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
Google Adsense




Post07 Jul 2009 15:12   

Ads




Back to top
ark5230



Joined: 29 Jun 2009
Posts: 188
Helped: 15
Location: India


Post16 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


Post17 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


Post17 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
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> help req. for driving stepper motor with 8051.....
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Driving stepper motor (6)
Driving stepper motor (3)
Driving a large stepper motor (12)
[Ask]Driving Motor Stepper (8)
Request Stepper Motor Driving Schematic (6)
Stepper Motor Driving at High speed (8)
best way of driving a stepper motor (4)
driving the stepper motor unipolar way (7)
calculation of delay for stepper motor using 8051 (2)
stepper motor & 8051 (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS