Electrofriends

Stepper motor control board

by Ranjith | November 17th, 2008.

Program 3:-

This is also easy program. Now three keys are used and three LEDs are used. Please refer table. The speed of motor is again fixed at 20 RPM. The mode is double coil excitation.

Org 00h
mov r0,#01h         ; initileze key count
mov p1,#0ffh        ; P1 as input port
lop:   mov a,p1
cjne a,#0ffh,jmp
ajmp lop               ; loop until any key is pressed

jmp:     clr p0.0              ; indicates keypress
loop:    rrc a
jnc num                ; get key no.
inc r0
sjmp loop
num: acall dely          ; key debounce delay
setb p0.0

cjne r0,#01h,nxt   ; for 1st key rotate motor
acall clkwise          ; clock wise
sjmp over
nxt: cjne r0,#02h,nxt2  ; for 2nd key
acall aclkwise           ; rotate anticlock
nxt2:   cjne r0,#03h,over ; for 3rd key
mov p2,#00h             ; stop motor
over:   mov r0,#01h
sjmp lop          ; jump to loop again

clkwise:
lop:   clr p0.1
mov p2,#03h        ; at a time two coils
acall delay            ; energized in double
mov p2,#06h        ; coil excitation mode
acall delay
setb p0.1
mov p2,#0Ch
acall delay
mov p2,#09h
acall delay
mov p1, #0FFh      ; continue loop
mov a,p1               ; until any key is
cjne a,#0FFh,out   ; not pressed
sjmp lop
out:   ret
aclkwise:
lop1: clr p0.1
mov p2,#03h
acall delay
mov p2,#09h        ; revert the pulse
acall delay            ; sequence for
setb p0.1
mov p2,#0Ch        ; anticlockwise
acall delay
mov p2,#06h
acall delay
mov p1, #0FFh
mov a,p1
cjne a,#0FFh,out1
sjmp lop1
out1:  ret

delay:
mov r5,#0Fh         ; load count 15
lop2: mov r6,#FAh      ; give 1 ms delay
lop1:nop                    ; so it gives full
nop                       ; 15 ms delay
djnz r6,lop1          ; to give speed
djnz r5,lop2           ; of 20 RPM
ret

dely:
mov r5,#0C8h          ; load count 200
lop2: mov r6,#0FAh       ; for 200ms delay
lop1:nop
nop
djnz r6,lop1
djnz r5,lop2
ret
end

Program 4:-
This  program is same as above but now the mode is changed to half step and RPM is now 30.

Org 00h
mov r0,#01h        ; initileze key count
mov p1,#0ffh       ; P1 as input port
lop:   mov a,p1
cjne a,#0ffh,jmp
ajmp lop               ; loop until any key is pressed

jmp:     clr p0.0              ; indicates keypress
loop:    rrc a
jnc num                ; get key no.
inc r0
sjmp loop
num: acall dely         ; key debounce delay
setb p0.0

cjne r0,#01h,nxt      ; for 1st key
acall clkwise             ; rotate motor
sjmp over                  ; clock wise
nxt: cjne r0,#02h,nxt2  ; for 2nd key
acall aclkwise           ; rotate anticlock
nxt2:   cjne r0,#03h,over  ; for 3rd key
mov p2,#00h             ; stop motor
over:   mov r0,#01h
sjmp lop                     ; jump to loop again

clkwise:
lop:   clr p0.1
mov p2,#01h         ; alternate pulses
acall delay             ; given one from
mov p2,#03h         ; single coil second
acall delay              ; from double coil
mov p2,#02h         ; in half step mod
acall delay
mov p2,#06h
acall delay
setb p0.1
mov p2,#04h
acall delay
mov p2,#0Ch
acall delay
mov p2,#08h
acall delay
mov p2,#09h
acall delay
mov p1, #0FFh       ; continue loop
mov a,p1                ; until any key is
cjne a,#0FFh,out   ; not pressed
sjmp lop
out:   ret
aclkwise:
lop1: clr p0.1
mov p2,#01h
acall delay
mov p2,#03h         ; revert the pulse
acall delay             ; sequence for
mov p2,#08h        ; anticlockwise
acall delay
mov p2,#09h
acall delay
setb p0.1
mov p2,#04h
acall delay
mov p2,#0Ch
acall delay
mov p2,#02h
acall delay
mov p2,#06h
acall delay
mov p1, #0FFh
mov a,p1
cjne a,#0FFh,out1
sjmp lop1
out1:  ret
delay:
mov r5,#0Ah          ; load count 10
lop2: mov r6,#FAh         ; give 1 ms delay
lop1: nop                        ; so it gives full
nop                         ; 10 ms delay
djnz r6,lop1            ; to give speed
djnz r5,lop2            ; of 30 RPM
ret
dely:
mov r5,#0C8h         ; load count 200
lop2: mov r6,#0FAh        ; for 200ms delay
lop1: nop
nop
djnz r6,lop1
djnz r5,lop2
ret
end


Pages: 1 2 3 4 5

Share and Enjoy:
  • Digg
  • Technorati
  • StumbleUpon
  • Twitter
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • Mixx
  • Yahoo! Buzz
  • LinkedIn
  • NewsVine
  • RSS
  • email
Similar Posts:

19 Responses to “Stepper motor control board”

  1. 1
    Naqash Says:

    da program gives syntax error when it is build in keil software.
    its give error for cjne a,#0ffh,jmp. n
    jmp clr p0.0……..

  2. 2
    ranjith Says:

    Hi, here jmp is used as a label. Please change jmp to some other name. for example
    cjne a,#0ffh,keypress
    keypress: clr p0.0

  3. 3
    naqash Says:

    it also gives error here
    lop2:mov r6,#FAh ; give 1 ms delay :the error is undefined symbol(pass 2).
    lop2: mov r6,#0FAh ; for 200ms delay : attempt to define already defined label.
    lop1: nop attempt to define already defined label.

  4. 4
    Naqash Says:

    hi plz tell me abt these error in program
    n i m using of Seiko epson EM-198.
    will it operate with 7805.

  5. 5
    Ranjith Says:

    Hi replace “dely” function as given below.
    ———————-
    dely:
    mov r5,#0C8h ; load count 200
    lop22: mov r6,#0FAh ; for 200ms delay
    lop11:nop
    nop
    djnz r6,lop11
    djnz r5,lop22
    ret
    ———————–

  6. 6
    Wharliaverisa Says:

    Nothing seems to be easier than seeing someone whom you can help but not helping.
    I suggest we start giving it a try. Give love to the ones that need it.
    God will appreciate it.

  7. 7
    gretamandisson Says:

    I’m new here on the forum, found it by searching google. I look forward to chatting about various topics with all of you.

  8. 8
    chandran Says:

    It is interesting. Can you mail me the full details of the circuits

  9. 9
    For Sale Says:

    Good stuff. I like this blog. I will subscribe to it.

  10. 10
    vinod Says:

    very good circuit … can you mail the full details and explainations of the circuit.

  11. 11
    omar Says:

    can u tell me how to control pitman motor using at89s51 through h bridge give ,jut move the motor in forward and reverse direction ,and also give me a small cobe to drive the motor through h bridge using at89s51

  12. 12
    muthu Says:

    sperb thank u

  13. 13
    Chucculty Says:

    А телефон свой не оставите? Хотелось бы кое-что обсудить по теме.

  14. 14
    naina Says:

    hey the project is nice but is there any problem in the programs is they give error

  15. 15
    purna Says:

    hi, please give the full information about the stepper motor

  16. 16
    inhew Says:

    72]Free Ringtones!

    http://fastloannow.ru/ringtones/ringtones-19.jpg

    72]Download Ringtones!

    sprint lg ringtone
    i730 free nextel ringtone
    ring tone file type
    free ringtones for v3a
    gob ringtones
    christian cellphone ringtones
    club jet music ringtone
    lotr ringtones
    indianna jones ringtone
    u s cellular fart ringtones

    Fine Young Cannibals Ringtone
    Razr V3a How To Unlock Ringtones
    7100i Midi Ringtones
    Ringtones Nokia 5140i Eagle
    Pantech Duo Ringtone Mp3 Help
    Free Polish National Ringtone
    Styx Ringtones
    Lg Incite Ringtones
    Pass Alarm Ringtone
    Listening Ringtone
    Find Downloadable Ring Tones
    Ringtones On
    Record Your Own Ringtone
    King Dedede Midi Free Ringtone
    Hey Ya Ringtone
    Free Polyphonic Ringtones Sony Erricson
    Ringtone Tv Themes Free Download
    8500 Audiovox Free Polyphonic Ringtone
    Hifi Motorola V600 Mp3 Ringtones
    Russian Christmas Ringtones
    Happy Together Ringtones
    Cheer Cincinnati Ringtone
    Into Mp Ringtone Samsung Turn
    Ringtones For Your Prepaid Cell Phone
    Ringtone Lg-vx9900
    Make Iphone Ringtone
    2312333232i Free Nokia Phone Ringtone
    Free Phone Ringtone Verizon Samsung
    Listen To Ringtones From Disney
    Woman Orgasm Ringtone
    Chrstian Ringtones
    Polyphonic Ringtones Online
    Lg Vx3200 Wireless Ringtones
    Ringtones College Sprint
    College Fight Song Ring Tones
    Kyocera Kx414 Game Ringtone
    Download Ringtone Canada
    Wwe The Rock Ringtones
    Iphone Ringtones E
    Add Ringtone To Palm Centro
    Magix Ringtone Magix Ringtone
    Free Comtempory Ringtones
    Motorola V180 Cellular One Ringtones
    Free Ringtones For Samsung M610
    Embarq Ringtones
    Uninsured Making Mp3 Ringtones
    Iphone Ringtones Uk
    837101222143 Music As A Ringtone
    Hindi Mp3 Ringtones
    Electric Avenue Ringtone Velvet
    Free Motorola Ringtones To Download
    Best Ringtones For Motorola Bc50
    Download Nagging Ringtone Free
    Free Michael Myers Ringtone
    Motorola V233230233 Ringtone
    Motorola Razr Ringtone Mp3

    ringtones real one nokia
    how to add ringtones
    t500 ringtones
    ringtones and graphics
    i730 wav ringtone
    droppin loads ringtone
    free tie me down ringtone
    remove ringtones came cell phone
    motorola ringtone makers
    sanyo 3100 ringtones
    free ringtones boomer sooner
    free pirates of the caribbean ringtones
    ringtone toploader
    silverstein ringtones
    download free ringtone cricket
    ringtones for adults
    houston ringtones
    free nextel ringtone software i
    free verizon polyphonic ringtones sms
    cingular downloads free ringtone

  17. 17
    Ashok Shah Says:

    Nice project for learners. Is it available in kit form at a reasonable price?
    Are the problems solved or still existing?

  18. 18
    Taio Cruz Says:

    Cheers, superb post.

  19. 19
    Tushar Says:

    Hi . . .can you mail me the full detail of the circuit diagram and the
    program.

Leave a Reply

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya