stepper motor interfacing with 8086

stepper motor interfacing with 8086

Method-1

The most effective method to program stepper engine in microchip 8086 low level computing construct

How to Control stepper engine utilizing Microprocessor 8086 by low level computing construct program? As we as a whole realize that stepper engine driver assumes a significant job in programmed control system. We can make a stepper engine controller utilizing 8086 chip and 8255 Programmable Peripheral Interface IC. Here is the low level computing construct program for 8086 microchip.

This stepper engine low level computing construct program is very straightforward and simple. Here we had depicted the elements of each code for better understanding.

Essentially this gathering program is an amateur manual for the individuals who like to examine 8086 programming.
You must know!

Stepper engine is interfaced to 8086 with the assistance of 8255 IC (Programmable Peripheral Interface).

8255 has two methods of activity BSR (Bit Set Reset) mode and IO (Input Output) mode.

The mode is dictated by the Control Word (CW) register; (here the CW address is 26).

Introduce the CW with (0000 0000)B=(00)H for BSR mode and (1000 0000)B=(80)H for IO mode

Stepper engine is IO gadget so CW ought to be (80)H There are 4 shafts in a run of the mill stepper engine A1, A2, B1, B2

Stimulate the shafts for anticlockwise pivot we need to apply the accompanying to the poles.

So we, out these arrangement of qualities to the IO port of 8255
8086 assembly language programming code for beginners
The below program shows the interfacing of Stepper motor [cc lang=”C”]1000 MOV AL,80 /*Move 80(hex) to AL*/
1002 OUT 26,AL /*Move 80(Hex) to PPI, 26 is the CW of PPI*/
1004 MOV AL,0A /*Energizing the poles*/
1006 OUT 20,AL
1008 CALL 2000 /*Give some delay to rotate Motor*/
1010 MOV AL,06
1012 OUT 20,AL
1014 CALL 2000
1016 MOV AL,05
1018 OUT 20,AL
1020 CALL 2000
1022 MOV AL,09
1024 OUT 20,AL
1026 CALL 2000
1028 JMP 1004 /*Repeat the steps*/
1030 HLT
[/cc]
In the memory location 2000, we should give Delay program. You can choose any memory location other than 2000 as you like.
The delay Program is shown below [cc lang=”C”]2000 MOV BX,1000 /*Move a value to BX*/
2002 DEC BX /*Decrementing the value*/s
2004 MP BX,0000 /*Check whether the value reach 0000*/
2006 JNZ 2002 /*If not 0000, Decrement again*/
2008 RET /*Return to the Motor program*/[/cc]


Method-2

To Interface Stepper Motor to 8086 utilizing 8255 and compose Assembly Language Program to turn Stepper Motor Clockwise and Anticlockwise way.

Hypothesis:-

Stepper engine is a gadget used to get an exact position control of pivoting shafts. A stepper engine utilizes turn of its pole as far as steps, instead of constant revolution as if there should arise an occurrence of AC or DC engine. To turn the pole of the stepper engine, a succession of heartbeats is should have been applied to the windings of the stepper engine, in legitimate arrangement. The quantities of heartbeats required for complete revolution of the pole of the stepper engine are equivalent to the quantity of inner teeth on its rotor. The stator teeth and the rotor teeth lock with one another to fix a place of the pole. With a heartbeat applied to the winding info, the rotor pivots by one teeth position or an edge x. the point x might be determined as.


x = 3600/no. of rotor teeth

After the revolution of the pole through point x, the rotor locks it self with the following tooth in the succession on the inside surface of the stator. The regular schematic of a run of the mill stepper engine with four windings is as demonstrated as follows.

The stepper engines have been intended to work with advanced circuits. Double level beats of 0-5V are required at its twisting contributions to get the turn of the poles. The arrangement of the beats can be chosen, contingent on the necessary movement of the pole. By reasonable succession of the beats the engine can be utilized in three methods of activity.

One stage ON (medium torque)

Two stage ON (high torque)

Half venturing (low torque)



WORKING:-

8255 is interfaced with 8086 in I/O mapped I/O. port C (PC0, PC1, PC2, PC3) is utilized to give beat grouping to stepper engine. The 8255 gives less present which won't have the option to drive stepper engine curls so every one of the twisting of a stepper engine should be interfaced utilizing rapid exchanging Darlington transistors with max 1A, 80V rating with heat sink, with the yield port of 8255. Yield the grouping in right request to have the ideal heading to pivot the engine.

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.

No comments: