Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Interfacing Stepper
Motor with 8051
Contents at a Glance
8051 Primer Board ...........................................................3
Stepper Motor .................................................................3
Interfacing Stepper Motor ...............................................4
Interfacing Stepper Motor with 8051 ...............................5
Pin Assignment with 8051 ................................................5
Source Code ....................................................................6
C Program to control stepper motor using 8051 ...............7
designs
encompassing
of
speed
8-bit
Microcontrollers.
Stepper Motor
A 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.
Join the Technical Community Today!
http://www.pantechsolutions.net
P0.0
COIL-B
P0.1
COIL-C
P0.2
COIL-D
P0.3
VCC
MOTOR_PWR
STEPPER
COIL-A
COIL-B
COIL-C
COIL-D
IN1
IN2
IN3
IN4
1
2
3
OUT1
OUT2
OUT3
OUT4
MG1
EN1
EN2
JP3
1
2- 3
VCC
SW30
OFF
COIL-A
8051 Lines
Stepper Motor(5V)
VS
VSS
STEPPER MOTOR
ON
1
2
3
4
8
7
6
5
7-SEG
LCD
SM/RL
GLCD
PWR ON/OFF
Source Code
The Interfacing stepper motor control with 8051
program is very simple and straight forward, that control
the stepper motor in clockwise, counter clockwise and also
a particular angular based clockwise by using switches. The
I/O port lines are used to generate pulses for stepper motor
rotations. C programs are written in Keil software.
Join the Technical Community Today!
http://www.pantechsolutions.net
#include <reg51.h>
#include<stdio.h>
void DelayMs(unsigned int);
//Delay function\
//---------------------------------//
Main Program
//Delay 20msec
P0 = 0x02;DelayMs(5);
P0 = 0x04;DelayMs(5);
Join the Technical Community Today!
http://www.pantechsolutions.net
P0 = 0x08;DelayMs(5);
}
}
void AntiClockwise (void)
{
unsigned int i;
for (i=0;i<30;i++)
{
P0 = 0x08;DelayMs(5);
//Delay 20msec
P0 = 0x04;DelayMs(5);
P0 = 0x02;DelayMs(5);
P0 = 0x01;DelayMs(5);
}
}
void main (void)
{
P0 = 0;
//Initialize Port0
while(1)
//Loop Forever
{
Clockwise ();
DelayMs (100);
P0 =
0;
AntiClockwise ();
DelayMs (100);
P0 =
0;
}
}
//--------------------------------//
Delay Function
What do we sell?
Our products range from Various Microcontroller
development boards, DSP Boards, FPGA/CPLD boards,
Communication Kits, Power electronics, Basic electronics,
Robotics, Sensors, Electronic components and much more . Our
goal is to make finding the parts and information you need
easier and affordable so you can create awesome projects and
training from Basic to Cutting edge technology.