Google

Jan 22, 2008

Interfacing Stepper Motor to 8086 using 8255

To Interface Stepper Motor to 8086 using 8255 and write Assembly Language Program to rotate Stepper Motor in Clockwise & Anticlockwise direction.

APPARATUS:-
Microprocessor trainer kit, ADC kit, power supply, data cable etc

THEORY:-
Stepper motor is a device used to obtain an accurate position control of rotating shafts. A stepper motor employs rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or DC motor. To rotate the shaft of the stepper motor, a sequence of pulses is needed to be applied to the windings of the stepper motor, in proper sequence. The numbers of pulses required for complete rotation of the shaft of the stepper motor are equal to the number of internal teeth on its rotor. The stator teeth and the rotor teeth lock with each other to fix a position of the shaft. With a pulse applied to the winding input, the rotor rotates by one teeth position or an angle x. the angle x may be calculated as.
x = 3600 / no. of rotor teeth
After the rotation of the shaft through angle x, the rotor locks it self with the next tooth in the sequence on the internal surface of the stator. The typical schematic of a typical stepper motor with four windings is as shown below.


The stepper motors have been designed to work with digital circuits. Binary level pulses of 0-5V are required at its winding inputs to obtain the rotation of the shafts. The sequence of the pulses can be decided, depending upon the required motion of the shaft. By suitable sequence of the pulses the motor can be used in three modes of operation.


  • One phase ON (medium torque)
  • Two phase ON (high torque)
  • Half stepping (low torque)


WORKING:-
8255 is interfaced with 8086 in I/O mapped I/O. port C (PC0, PC1, PC2, PC3) is used to give pulse sequence to stepper motor. The 8255 provides very less current which will not be able to drive stepper motor coils so each of the winding of a stepper motor needs to be interfaced using high speed switching Darlington transistors with max 1A, 80V rating with heat sink, with the output port of 8255. Output the sequence in correct order to have the desired direction to rotate the motor.





Assembly Language Program to rotate Stepper Motor in Clockwise direction

MODEL SMALL
.STACK 100
.DATA
PORTA EQU FFC0H ; PORTA ADDRESS
PORTB EQU FFC2H ; PORTB ADDRESS
PORTC EQU FFC4H ; PORTC ADDRESS
CWR EQU FFC6H ; CONTROL PORT ADDRESS
PHASEC EQU 03H
PHASEB EQU 06H ; SEQUENCE IN SERIES TO ROTATE MOTOR
PHASED EQU 0CH ; IN CLOCKWISE DIRECTION
PHASEA EQU 09H
.CODE
START:
MOV AL,@DATA
MOV DX,CTL
OUT DX,AL
AGAIN:
MOV AL,PHASEC
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP:
LOOP UP

MOV AL,PHASEB
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP1:
LOOP UP1

MOV AL,PHASED
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP2:
LOOP UP2

MOV AL,PHASEA
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH

UP3:
LOOP UP3
JMP AGAIN ; REPEATE OUTPUT SEQUENCE
INT 03H
END START




Assembly Language Program to rotate Stepper Motor in Anticlockwise direction
MODEL SMALL
.STACK 100
.DATA
PORTA EQU FFC0H ; PORTA ADDRESS
PORTB EQU FFC2H ; PORTB ADDRESS
PORTC EQU FFC4H ; PORTC ADDRESS
CWR EQU FFC6H ; CONTROL PORT ADDRESS
PHASEC EQU 03H
PHASEA EQU 09H ; SEQUENCE IN SERIES TO ROTATE MOTOR
PHASED EQU 0CH ; IN ANTICLOCKWISE DIRECTION
PHASEB EQU 06H

.CODE
START:
MOV AL,@DATA
MOV DX,CTL
OUT DX,AL
AGAIN:
MOV AL,PHASEC
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP:
LOOP UP

MOV AL,PHASEA
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP1:
LOOP UP1

MOV AL,PHASED
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP2:
LOOP UP2

MOV AL,PHASEB
MOV DX,PORTC
OUT DX,AL
MOV CX,0FFFFH
UP3:
LOOP UP3
JMP AGAIN ; REPEATE OUTPUT SEQUENCE
INT 03H
END START


PROCEDURE:-
1. Connect power supply 5V & GND to both microprocessor trainer kit & Stepper motor interfacing kit.
2. Connect data bus between microprocessor trainer kit & Stepper motor interfacing kit.
3. Enter the program to rotate Stepper motor in clockwise & anticlockwise.
4. Execute the program by typing GO E000:00C0 ENTER for clockwise, GO E000:0030 ENTER for anticlockwise.
5. Observe the rotation of stepper motor.


You might be also interested in:
:: Temperature Control system using 8086
:: Traffic light control system using 8086
:: Assembly Language Program to serve NMI

16 comments:

Unknown said...

YOUr project is very good actually i am a student of final year B.Tech so m interested in your project but i want that in my project shaft rotate by 45. 60, 90. an so on angle can u help me in this I'll be greatly oblige to u.My email id is neha_shreeg@yahoo.co.in

captain ridhwan said...

I have some question, can you write the programming for increase the speed motor and decrease the speed motor?hope to hear you soon.

my email is captain.ridhwan@gmail.com

elizabeth said...

could u please help me with a program to rotate the motor to abt 45,stop it for abt 30sec nd then again continue the rotation to abt 45 degrees,stop for 1min...nd then rotate it back to the initial position.....my e-mail is priyathomas2006@gmail.com

rajesh said...

guys you can perform that by increasing and decreasing the delayy period :)

Anonymous said...

can u provide a circuit diagram for this????

sindhu said...

can we rotate 2 stepper motors using a single program

siddu said...

Iamukg@gmail.com

siddu said...

Helpme

Debojyoti Chakraborty said...

please provide me with the program of 8086 to rotate the motor in a direction where intensity of light is max.please help me soon.my email id is tubai279787@gmail.com

Unknown said...

can u please provide circuit diagram

Unknown said...

can u please provide assembly language program of 8086 for single rotation of stepper motor

Unknown said...

can u please provide assembly language program of 8086 for single rotation of stepper motor

Unknown said...

can you please provide me a 8086 program for rotating the shaft of 4-phase stepper motor for five times in clcok and anticlock wise direction.

Suraj naik said...

How can I write program to rotate clockwise n anticlockwise in one program.... Any one help me
Surajnaik3521@gmail.com

Unknown said...

how can i run the programme using two switches for clockwise and anti clockwise in proteus

Unknown said...

Can you help me for the two motor simulation as soon as possible