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 / This is the code of a setpper

This is the code of a setpper

|

Microcontroller › 8051 › Delay function in C › This is the code of a setpper

May 9, 2014 at 4:46 pm #11707
Osama Mohammed
Participant
This is the code of a setpper motor
I am using ISIS Proteus 
when I run the code with that delay function the execution us stuck in the function :)  !!
when I remove this delay function the code is executed normally and continually without stopping ! :)
I tried to make many modfiications but nothing works 
 
#include <reg51.h>
msDelay(unsigned int);
 
#define stepperPort P2
 
void main (void)
{
 
stepperPort=0x03;
msDelay(4000);
stepperPort=0x06;
msDelay(4000);
stepperPort=0x0C;
msDelay(4000);
stepperPort=0x09;
msDelay(4000);
 
 
} 
 
 
 
msDelay(unsigned int tdelay)
{
 unsigned k,j;
 for(k=0;k<=tdelay;k++)
 for(j=0;j<=1275;j++);
 
}

RSS Recent Posts

  • Pnp transistor query March 5, 2026
  • H bridge current direction logic March 5, 2026
  • Sine wave oscillator schematic please? March 5, 2026
  • LM350K variable power supply March 5, 2026
  • Hello & a Request: Recommendations for obsolete Panasonic filter Capacitors. March 5, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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