EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / I started doing it on real

I started doing it on real

|

Microcontroller › 8051 › Stepper Motor interfacing with 8051, › I started doing it on real

November 16, 2013 at 10:38 am #10611
pankaj
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++)
    {}
  }
}
 
wysiwyg_imageupload:11078:

RSS Recent Posts

  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque November 10, 2025
  • Anyone In The US Ordered From AliExpress Recently? November 10, 2025
  • Calculation of A Class amplifier November 10, 2025
  • strange laptop problem November 10, 2025
  • restarting this Christmas project November 10, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise