8051 ALP to interface stepper motor(Full step AntiClock wise)
;Write an 8051 ALP to interface stepper motor
;for following operation :
;Full step AntiClock wise
ORG 0000H ;set origin at 0000 position
L0 : MOV R0,#48H ;number of rotations
MOV A,#99H ;first quadrant value
L1 : MOV P1,A ;moves accumulator to port 1
RL A ;rotate right
ACALL DELAY ;absolute call to label delay
DJNZ R0,L1
JMP L0 ;jump to label L0
DELAY : MOV R4,#0FFH ;FF*FF delay
L2 : MOV R7,#0FFH
L3 : DJNZ R7,L3
DJNZ R4,L2
RET
END ;end of program
0 comments:
Post a Comment