Microcontroller › 8051 › Stepper Motor interfacing with 8051, › I started doing it on real
November 16, 2013 at 10:38 am
#10611
Participant
I started doing it on real hardware, with bipolar stepper motor, crystal 12MHz, capacitor 33pF ,AT89C51, and L293D .
And my program is:
It is working in proteus but not working in hardware:
Reference:http://www.electrosome.com/interfacing-stepper-motor-8051-keil-c-at89c51/
#include<reg51.h> //using AT89C51
#include<stdio.h>
void delay(int); // Rotation In sequence without any switch continously
void main()
{
P1=0;
P2=0;
P3=0;
do
{
P2=0x01; //0001
delay(100);
P2=0x04; //0100
delay(100);
P2=0x02; //0010
delay(100);
P2=0x08; //1000
delay(100);
}while(1);
}
void delay(int k)
{
int i,j;
for(i=0;i<k;i++)
{
for(j=0;j<1725;j++)
{}
}
}