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 / Topics / Generate delay

Generate delay

|

Microcontroller › 8051 › Generate delay

  • This topic has 1 reply, 2 voices, and was last updated 12 years ago by alekhya.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 22, 2013 at 5:12 pm #2299
    Jason Jordon
    Participant

    how to generate delay of one second in a 8051 microcontroller??

    April 23, 2013 at 5:14 am #9571
    alekhya
    Participant

    u can generate the 1sec delay like this….check this i think so itz helpful to u

     

     

     

    #include<REG51.H>
    sbit led1 = P1^1;
    sbit led2 = P1^2;
    sbit led3 = P1^3;
    void delay (unsigned int k);
    void main()
    {
    led1 = 1;
    led2 = 0;
    led3 = 0;
    delay(1s);
    led1 = 0;
    led2 = 1;
    led3 = 1;
    delay(1s);
    }
    void delay(unsigned int k)
    {
    unsigned int i,j;
    for(i=0;i<k;i++)
    for(j=0;j<100;j++);
    }
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • How to repair this plug in connector where wires came loose May 17, 2025
  • Lightbox circuit May 17, 2025
  • Fuel Auto Shutoff May 17, 2025
  • Kawai KDP 80 Electronic Piano Dead May 17, 2025
  • Python help with keystroke entries May 17, 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