Problem Statement: 8255
Write 8086 ALP to rotate a stepper motor for given number of steps at a given angle and in the given
direction of rotation based on the user choice such as
(i) If 'C' key is pressed - clockwise rotation, (ii) If 'A' key is pressed -
anticlockwise rotation. (iii) If 'B' is pressed - 1/2 clockwise and Vz
Anti-clock wise rotation, (iv) If 'S' key is pressed - stop rotation. Also write routines to accelerate and de- accelerate the motor.
(i) If 'C' key is pressed - clockwise rotation, (ii) If 'A' key is pressed -
anticlockwise rotation. (iii) If 'B' is pressed - 1/2 clockwise and Vz
Anti-clock wise rotation, (iv) If 'S' key is pressed - stop rotation. Also write routines to accelerate and de- accelerate the motor.
1. Anticlockwise (360
degrees)
Dyna-86>U 3000
0000:3000 MOV AL,80
0000:3002 OUT 67,AL
0000:3004 MOV DL,32
0000:3006 MOV AL,06
0000:3008 OUT 61,AL
0000:300A CALL 2000
0000:300D MOV AL,05
0000:300F OUT 61,AL
0000:3011 CALL 2000
0000:3014 MOV AL,09
0000:3016 OUT 61,AL
0000:3018 CALL 2000
0000:301B MOV AL,0A
0000:301D OUT 61,AL
0000:301F CALL 2000
Dyna-86>U 301F
0000:301F CALL 2000
0000:3022 DEC DL
0000:3024 JNZ 3006
0000:3026 INT 3
2. Anticlockwise (180 degrees)
Dyna-86>U 3000
0000:3000 MOV AL,80
0000:3002 OUT 67,AL
0000:3004 MOV DL,19
0000:3006 MOV AL,06
0000:3008 OUT 61,AL
0000:300A CALL 2000
0000:300D MOV AL,05
0000:300F OUT 61,AL
0000:3011 CALL 2000
0000:3014 MOV AL,09
0000:3016 OUT 61,AL
0000:3018 CALL 2000
0000:301B MOV AL,0A
0000:301D OUT 61,AL
0000:301F CALL 2000
Dyna-86>U 301F
0000:301F CALL 2000
0000:3022 DEC DL
0000:3024 JNZ 3006
0000:3026 INT 3
3. Clockwise (360 degrees)
Dyna-86>U 3000
0000:3000 MOV AL,80
0000:3002 OUT 67,AL
0000:3004 MOV DL,32
0000:3006 MOV AL,06
0000:3008 OUT 61,AL
0000:300A CALL 2000
0000:300D MOV AL,09
0000:300F OUT 61,AL
0000:3011 CALL 2000
0000:3014 MOV AL,05
0000:3016 OUT 61,AL
0000:3018 CALL 2000
0000:301B MOV AL,05
0000:301D OUT 61,AL
0000:301F CALL 2000
Dyna-86>U 301F
0000:301F CALL 2000
0000:3022 DEC DL
0000:3024 JNZ 3006
0000:3026 INT 3
;Delay Routine
Dyna-86>U 2000
0000:2000 MOV CX,OFFF
0000:2002 DEC CX
0000:2004 JNZ 2003
0000:2006 RET
No comments:
Post a Comment