Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stepper Motor Interfacing with P89v51RD2

Status
Not open for further replies.

megapoesiedon

New Member
I'm using a unipolar stepper motor (1.8deg)
Here is the datasheet.

According to the datasheet (see the link above)I connected the respective color wire to the respective pin of l293D according to the following circuit diagram

**broken link removed**

and applied 12v,500mA as motor supply to L293D.

Here is my program

Code:
#include <intrins.h>
#include "p89v51rx2.h"

#define stepper P1

void delay();

void main(){
       while(1){
                
                stepper = 0x09;
                delay();
		stepper = 0x08;
         delay();
		stepper = 0x0C;
                delay();
				 stepper = 0x04;
                delay();
				 stepper = 0x06;
                delay();
				 stepper = 0x02;
                delay();
				 stepper = 0x03;
                delay();
				 stepper = 0x01;
                delay();
        }
}

void delay(){
        unsigned char i,j;
        for(i=0;i<255;i++)
					for(j=0;j<1275;j++);			
}

I observed small vibrations in the stepper motor but the motor is not rotating at all...even after changing the delay. What might be the problem ???

Thanks in advance
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top