You are on page 1of 2

INTERFACING STEPPER MOTOR WITH 8051

Lab # 10
Components:
♦ AT89C52 (Microcontroller)
♦ Keil Software
♦ Proteus
♦ Stepper Motor
♦ ULN2003A IC

Write an 8051 C program for wave drive motor, motor rotates in clockwise direction by some
angles.

Program :
#include<reg52.h>
void delay(int);
void main()
{
do
{
delay(1000);
P2=0x08;
delay(1000);
P2=0x04;
delay(1000);
P2=0x02;
delay(1000);
P2=0x01;
delay(1000);
}
while(1);
}
void delay(int k)
{
int i,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
}
}

You might also like