How to Interface Stepper motor with 8051 Lab Trainer Kit

Spread the love

8051 – TRAINER BOARD

PS-TRAINER-8051 trainer kit is proposed to smooth the progress of learning and developing designs of MCU from Intel and NXP. It has the facility to connect PC’s 101/104 Keyboard, to enter user programs in Assembly languages. Serial communication achieved using 8051. It also supports C & assembly language in standalone kit (P89V51RD2). It’s designed as to facilitate On-board Programmer for NXP 8051 MCU through ISP on serial port.

STEPPER MOTOR

stepper motor is a brushless, synchronous electric motor that converts digital pulses into mechanical shaft rotation. Every revolution of the stepper motor is divided into a discrete number of steps, and the motor must be sent a separate pulse for each step.

INTERFACING STEPPER MOTOR

Fig. 1 shows how to interface the Stepper Motor to microcontroller. As you can see the stepper motor is connected with Microcontroller output port pins through a ULN2803A array. So when the microcontroller is giving pulses with particular frequency to ls293A, the motor is rotated in clockwise or anticlockwise.

How to Interface Stepper motor with 8051 Lab Trainer Kit
Fig. 1 Interfacing Stepper Motor to Microcontroller
 

INTERFACING STEPPER MOTOR WITH 8051

We now want to control a stepper motor in 8051 trainer kit. It works by turning ON & OFF a four I/O port lines generating at a particular frequency.

The 8051 trainer kit has three numbers of I/O port connectors, connected with I/O Port lines (P1.0 – P1.7),(p3.0 – p3.7) to rotate the stepper motor. Ls293d is used as a driver for port I/O lines, drivers output connected to stepper motor, connector provided for external power supply if needed.

PIN ASSIGNMENT WITH 8051

How to Interface Stepper motor with 8051 Lab Trainer Kit


CIRCUIT DIAGRAM TO INTERFACE STEPPER MOTOR WITH 8051

ASSEMBLY PROGRAM TO RUN THE STEPPER MOTOR USING 8051

ADDRESSOP CODEMNEMONICSCOMMENTS
850074 80MOV A, #80HInitialize 80HEX value to Accumulator
850290 40 03MOV DPTR, #4003Move 4003   to R1 register
8505F0MOVX @DPTR, AStore ACC value into R1 register
850690 40 00MOV DPTR, #4000Move 4000   to R1 register
850974 66MOV A, #66HMove 66HEX value   to Accumulator
850BF0AGAIN:MOVX@DPTR, AIn AGAIN, Store ACC value into R1
850C03RR ARotate sequence for clockwise
850DB1 11ACALL DELAYwait
850F80 FASJMP AGAINShort Jump into AGAIN
85117D 05DELAY:   MOV R5, #5In DELAY, Load 5 value into R5
85137C 0FH3:         MOV R4, #0FIn H3, Load 0F value into R4 register
85157B 43H2:         MOV R3, #43In H2, Load 43 value into R3 register
8517DB FEH1 :       DJNZ R3, H1H1, Decrement R0& check if it’s not 0
8519DC FADJNZ R4, H2Decrement R4& Check if it’s not 0
851BDD F6DJNZ R5, H3Decrement R5& Check if it’s not 0
851D22RETReturn

NOTE: To turn the motor in the reverse direction enter as (Rl A instead of RR A). The schematics sections given is, stepper motor connected to port 1 and the sample program is given based on 8255.

One comment

Leave a Reply

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

2 + fourteen =

This site uses Akismet to reduce spam. Learn how your comment data is processed.