Microcontroller › 8051 › Stepper Motor interfacing with 8051, › I am working on real hardware
November 16, 2013 at 10:48 am
#10612
pankaj
Participant
I am working on real hardware it is not giving any desired response (at output pins) how ever it works perfectly in Proteus my circuit is:
hardware: AT89C51, capacitor 33pF, crystal 12MHz, Bipolar Stepper Motor (4 wire)…
my program is:
#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++)
{}
}
}