Interface stepper motor with 8051 Trainer Kit parallel port

AIM: To interface stepper motor with 8051 parallel port and to vary speed of motor, direction of motor.

APPARATUS REQUIRED:

  • 8051 Trainer Kit
  • Stepper Motor Interface Board

THEORY:

A motor in which the rotor is able to assume only discrete stationary angular position is a stepper motor. The rotor motion occurs in a stepwise manner from one equilibrium position to next.

The motor under our consideration uses 2 – phase scheme of operation. In this scheme, any two adjacent stator windings are energized. The switching condition for the above said scheme is shown in Table.

Clockwise

A1B1A2B2
1001
0100
0101
1010

Anti – Clockwise

A1B1A2B2
1010
0101
0100
1001

In order to vary the speed of the motor, the values stored in the registers R1, R2, R3 can be changed appropriately.

ALGORITHM:

  1. Store the look up table address in DPTR
  2. Move the count value (04) to one of the register (R0)
  3. Load the control word for motor rotation in accumulator
  4. Push the address in DPTR into stack
  5. Load FFC0 in to DPTR.
  6. Call the delay program
  7. Send the control word for motor rotation to the external device.
  8. Pop up the values in stack and increment it.
  9. Decrement the count in R0. If zero go to next step else proceed to step 3.
  10. Perform steps 1 to 9 repeatedly.

PROGRAM:

START: ORG 4100
       MOV DPTR,#4500H
       MOV R0,#04
AGAIN: MOVX A,@DPTR
       PUSH DPH
       PUSH PDL
       MOV DPTR,#FFC0H
       MOV R2, 04H
       MOV R1,#FFH
DLY1:  MOV R3, #FFH
DLY:   DJNZ R3,DLY
       DJNZ R1,DLY1
       DJNZ R2,DLY1
       MOVX @DPTR,A
       POP DPL
       POP DPH
       INC DPTR
       DJNZ R0,AGAIN
       SJMP START

DATA:

4500: 09, 05, 06, 0A

RESULT:

Thus the speed and direction of the motor were controlled using 8051 trainer kit.

Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

Leave a Reply

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

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in