Stepper motor interfacing with 8086 microprocessor

Share This Topic:
  •  
  •  
  •  
  •  
  •  

Course Details

Field of Study: Computer Science & Engineering
Course Name: Interfacing Techniques
Description: Stepper motor interfacing with 8086 microprocessor to rotate the stepper motor 180 degree and then rotate back to its initial position.

Materials Required

  • APPLIC 18 – x86/8086 CPU module
  • APPLIC 7 – multi I/O module
  • APPLIC-71 – a module that contains a stepper motor
  • Computer with SES88W software installed
  • Voltage regulator

The stepper motor has four coils S1, S2, S3 and S4 which should be connected with Q3, Q2, Q1 and Q0 respectively in the APPLIC 7 I/O module. To rotate the stepper motor to clockwise direction, the sequence of the four hexadecimal values corresponding to the four coils should be 06H, 05H, 09H and 0AH.

The stepper motor in the APPLIC-71 module has 48 steps to complete a full rotation of 360 degrees having each steps 7.5 degrees. So in our case to rotate 180 degrees we need 24 steps and 24 in hexa is 18H.

Now let us write the 8086 MP code to rotate the stepper motor 180 degrees clockwise and then back 180 degrees to its initial position and stops.
Note that to do this practically you need to have the above materials and connect in the following way:
Computer with SES88W—APPLIC 18—APPLIC 7—APPLIC-71
Please follow the instructions at the end of this page to run the program using SES88W software.

8086 MP Code

org 100H ;initial memory address of 8086 MP module(APPLIC 18)
mov DL,18H ;18H is 24 in decimal that is the number of steps
L3: LEA BX,tab1
mov AH,04H
L2: mov AL,CS:[Bx]
out 53H,AL ;53H is I/O module(APPLIC 7) port address
call delay
mov AL,00H ;00H is used to remove electromagnetic induction in the coils
out 53H,AL
call delay
dec DL
jnz L1
jmp down
L1: inc BX
dec AH
jnz L2
jmp L3
down: mov DL,18H
L6: LEA BX, tab2
mov AH,04H
L5: mov AL,CS:[BX]
out 53H,AL
call delay
mov AL,00H
out 53H, AL
call delay
dec DL
jnz L4
int 3
L4: inc BX
dec AH
jnz L5
jmp L6
delay: mov cx,0FFFFH
l7: loop L7
ret
tab1: db 06H,05H,09H,0AH ;this sequence is for clockwise direction
end
tab2: db 0AH,09H,05H,06H ;for counter clockwise direction
end

Steps to work with SES system
1. Open SES88W editing window
2. Write the above assembly program, save it in c:\ses88 as filename.a86
3. In the command prompt write c:\>a86 filename.a86 filename.com “Enter”
4. Write c:\ses88>com2asc filename “Enter”
5. Go to ses88 window
6. Reset APPLIC 18 using Reset button
7. Click on “compile and download”
8. Write g100 and “Enter”

Now you will see the output on the APPLIC-71 that the stepper motor rotates 180 degrees clockwise and then 180 degrees back(counter clockwise) to its initial position.

Add a Comment

Your email address will not be published. Required fields are marked *