interfacing-of-stepper
interfacing-of-stepper
Principle of Working
A stepper motor is an electromechanical device which converts electrical pulses into
discrete mechanical movements. The shaft or spindle of a stepper motor rotates
indiscrete step increments when electrical command pulses are applied to it in the
proper sequence. The motors rotation has several direct relationships to these applied
input pulses. The sequence of the applied pulses is directly related to the direction of
motor shafts rotation. The speed of the motor shafts rotation is directly related to the
frequency of the input pulses and the length of rotation is directly related to the number
of input pulses applied.
0 1 0 0 0 08H
1 1 1 0 0 0CH
2 0 1 0 0 04H
3 0 1 1 0 06H
4 0 0 1 0 02H
5 0 0 1 1 03H
6 0 0 0 1 01H
7 1 0 0 1 09H
0 1 0 0 0 08H
1 0 1 0 0 04H
2 0 0 1 0 02H
3 0 0 0 1 01H
0 1 1 0 0 0CH
1 0 1 1 0 06H
2 0 0 1 1 03H
3 1 0 0 1 09H
Interfacing
Algorithm for Interfacing
Interfacing Diagram
Note:-In order to rotate stepper motor in anticlockwise direction just reverse the
sequence of excitation of windings (from bottom to top) refer table above
Program: Write an ALP to rotate stepper motor 45 degree in the clockwise direction
which is interfaced to 8051 microcontroller.
ORG 00H
MAIN:MOV A,#O8H
ACALL DELAY
MOV A,#OCH
ACALL DELAY
MOV A,#O4H
ACALL DELAY
MOV A,#06H
ACALL DELAY
MOV A,#O2H
ACALL DELAY
MOV A,#03H
ACALL DELAY
MOV A,#O1H
ACALL DELAY
MOV A,#09H
ACALL DELAY
SJMP MAIN
DELAY:MOV R7,#4
UP2:MOV R6,#0FFH
UP1:MOV R5,#0FFH
HERE:DJNZ R5,HERE
DJNZ R6,UP1
DJNZ R7,UP2
RET
END