0% found this document useful (0 votes)
37 views1 page

Microprocessors and Microcontrollers 86

Uploaded by

harrymainah9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

Microprocessors and Microcontrollers 86

Uploaded by

harrymainah9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Dr. N. Karuppiah & Dr. S.

Ravivarman

Software for Stepper Motor Control


As port A is used as an output port, control word for 8255 is 80H.
6000H Excite code DB 03H, 06H, 09H, OCH: This is the code sequence for
clockwise rotation
Subroutine to rotate a stepper motor clockwise by 360° - Set the counts:
MVI C, 32H : Set repetition count to 50ıο
START : MVI B, 04H
: Counts excitation sequence
LXI H, 6000H : Initialize pointer
BACK1 : MOV A, M
: Get the Excite code
OUT PORTA : Send Excite code
CALL DELAY : Wait
INX H : Increment pointer
DCR B : Repeat 4 times
JNZ BACK1
DELAY : LXI D, Count
BACK : DCX D
MOV A, D
ORA E
JNZ BACK
RET

86

You might also like