Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

ASSIGNMENT NO:9

ROLL NO:29
BATCH: S2
TITLE: Stepper motor to rotate motor with different step angles and speeds.

ORG 0000H
MOV A, #0FFH ; Initialization of Port 1
MAIN: MOV P1, A
MOV A, #09H ; Code for the Phase 1
MOV P1, A ;
ACALL DELAY ; Delay subroutine
MOV A, #0CH ; Code for the Phase II
MOV P1, A ;
ACALL DELAY ; Delay subroutine.
MOV A, #06H ; Code for the Phase III
MOV P1, A ;
ACALL DELAY ; Delay subroutine
MOV A, #03H ; Code for the Phase 1
MOV P1, A ;
ACALL DELAY ; Delay subroutine
SJMP MAIN ; Keep the motor rotating continuously.
;DELAY Subroutine

DELAY:MOV R2,#200
H1: MOV R3,#255
H2: DJNZ R3,H2
DJNZ R2,H1
RET
END

You might also like