Showing posts with label 8051 microcontroller. Show all posts

8051 ALP to interface stepper motor(Half step Clock wise),

, by Engineer's Vision

ORG 0000H

L0 : MOV R0,#08H
     MOV DPTR,#0200H

L1 : CLR A
     MOVC A,@A+DPTR
     MOV P1,A
     ACALL DELAY
     INC DPTR
     DJNZ R0,L1
     SJMP L0

DELAY : MOV R4,#0FFH

L2 :    MOV R7,#0FFH

L3 : DJNZ R7,L3
     DJNZ R4,L2
     RET

ORG 0200H
DB 01,03,02,06,04,0CH,08,09

END
read more

8051 ALP to interface stepper motor(Half step AntiClock wise)

, by Engineer's Vision



ORG 0000H

L0 : MOV R0,#08H
     MOV DPTR,#0200H

L1 : CLR A
     MOVC A,@A+DPTR
     MOV P1,A
     ACALL DELAY
     INC DPTR
     DJNZ R0,L1
     SJMP L0

DELAY : MOV R4,#0FFH

L2 :    MOV R7,#0FFH

L3 : DJNZ R7,L3
     DJNZ R4,L2
     RET

ORG 0200H
DB 09,08,0CH,04,06,02,03,01

END
read more

8051 ALP to interface stepper motor(Full step AntiClock wise)

, by Engineer's Vision


;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
read more

8051 ALP to interface stepper motor(Full step Clock wise)

, by Engineer's Vision

;Write an 8051 ALP to interface stepper motor
;for following operation :
;Full step Clock wise


ORG 0000H        ;set origin at 0000 position

L0 : MOV R0,#48H    ;number of rotations
     MOV A,#0CCH    ;first quadrant value

L1 : MOV P1,A        ;moves accumulator to port 1
     RR 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
read more