Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • EE Design News
    • DIY Reviews
    • Guest Post
    • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

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

July 17, 2019 By EG Projects

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

Related Articles Read More >

TV remote hack using Arduino and IR sensor
Gesture sensor using Arduino
How to build a metal detector using an inductive proximity sensor with Arduino
Object follower robot using Arduino

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!


Featured Tutorials

  • Getting Started with the ESPlorer IDE
  • SENDING TEXT MESSAGE USING ESP8266
  • CONNECTION BETWEEN TWO ESP8266
  • ESP8266 WIFI HOTSPOT
  • HOME AUTOMATION USING ESP8266
  • Open WiFi Scanner using Esp8266

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

“ee

Recent Articles

  • TV remote hack using Arduino and IR sensor
  • Gesture sensor using Arduino
  • Diodes adds to its family of voltage-level shifters
  • Xilinx expands UltraScale+ portfolio to include compact, intelligent edge solutions
  • New Armv9 architecture designed to increase security and AI capabilities

RSS EDABOARD.com Discussions

  • Help with damaged board
  • Sine Wave Generation with SPI and TIM interrupt in STM32
  • PIC BASIC
  • 4 switch buck boost converter
  • Question about hexagonal patch antenna frequency and design

RSS Electro-Tech-Online.com Discussions

  • Can MT8870 DTMF decoder module handles none audible signals?
  • What has happened to EEVBLOG videos?
  • Funny Images Thread!
  • Cell phone detector
  • Adjustable 0-5v ground switch
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

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

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • EE Design News
    • DIY Reviews
    • Guest Post
    • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering