Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

One minute delay generation with 8051(89c51,89c52) microcontroller internal timers for led blinking

By EG Projects July 17, 2019

Giving a proper delay like 1-Second OR 1-Minute is possible only by using internal timers of 8051(89c51,89c52) microcontroller. The 8051 series microcontrollers have two build in 16-bit timers Timer 0 & Timer 1, Some also have an extra timer Timer 3 . You can use them to generate delays, baud rate for UART for serial Communication OR trigger an event source to execute an interrupt when ever a particular condition is meet. I strongly recommend you to take a simple tutorial on internal timer registers of 8051(89c51,89c52) microcontrollers and registers associated with them.

  • The Registers Associated with Timers of 89c51 Microcontroller.  

If you don’t know the internal registers dedicated for timer’s you will be unable to understand the tutorial and code below. Generating delays of specific time is not easy using internal timers of 8051 microcontrollers. It requires an extensive knowledge to properly generate delays. 

The Project/tutorial is simple just blinking an led after every 1 minute. I calculated the delay for 2 ms and loaded the Calculated values in TH and TL register. To calculate the values go through the tutorial link given above. Now if i run 2 ms delay for 500 times it will generate 1-Second Delay. Running this 1-Second Delay for 60 Times gives me 1-Minute Delay.

Delay Generation using Timers of 8051(89c51) Microcontroller

Delay Generation using Timers of 8051(89c51) Microcontroller

8051 microcontroller 1 second delay circuit diagram

The circuit diagram is pretty straight forward. Led is connected to Port-1 Pin#0. Making this pin high and low will make led blink. Main function is easy to understand. The delay() function is generating 1-Minute delay for us. At the top is for loop, Which is running 60 times. To generate 1-Minute delay, Loop is running 60 Times generating 60 seconds. Then while loop is running 500 times to generate 1-Second delay.

The above tutorial is very important to understand the delay function. I calculated values of TH and TL register for 2ms delay and run them for 1ms(500 Times). The code is generating exactly 1ms delay.

Port-1 Pn#0 is connected with led -(Negative) leg. Apply 5 volts to +(Positive) leg of led. Connect Oscillator(11.0592MHz) with PIN# 18 & 19 (XTAL0, XTAL1) of 89c51 Microcontroller. Apply 5 volts to Pin#40 & 31 of 8051(89c51).Ground Pin# 20.

Led with 8051(89c51)  Microcontroller

Led with 8051(89c51) Microcontroller

Please take the tutorial if you are not familiar with the internal timer registers of 8051(89c51,89c52) microcontroller. The tutorial will help you in understanding the code below.

  • 8051 TIMER REGISTERS AND THEIR WORKING
I made digital clock with 89c51 microcontroller by utilizing the above time delay technique. You can see the post. Each project code and circuit diagram is free.

  • Digital Clock with 89c51 Microcontroller.
  • Calculator with 89c51 Microcontroller.
  • HOW TO GIVE ONE SECOND DELAY
Download the Project files, code(c & Hex) compiled in c using keil U-vision4. If you have any questions regarding the post Plz write your queries below.

One Minute Delay Generation with 89c51 Microcontroller


Filed Under: 8051 Microcontroller, Electronic Projects, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

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

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe