BM Dept., Govt. Engg. College, Gandhinagar Page 61
Sequence of pulses required to send on port P0 to rotate motor in clockwise and anticlockwise
direction for full step mode:
Program 1: To rotate motor for 100 steps in clockwise direction (Full step)
ORG 30h
MOV P0,#00h ;Configure port P0 as an output port
MOV R0, #64h ;Load count value for 100 steps
MOV A,#11h ;Load accumulator with 11h
loop: MOV P0,A ;Sent data to port 1 (stepper motor)
delay: ACALL delay ;Delay to control speed
RL A ;Next data
DJNZ R0, loop ;Continue rotation if no. of steps<100
MOV R2,#0FFh ;Change this count to change speed
d_loop: DJNZ R2,d_loop
RET
END
Comments to this Manuals