- The registers associated with the 89c51 microcontroller timers.
If you don't know the internal registers dedicated to timers, you won't be able to understand the tutorial and code below. Generating delays of specific time is not easy using internal timers of 8051 microcontrollers. It requires extensive knowledge to generate delays properly.
The project/tutorial is simple, just blinking an LED every 1 minute. I calculated the delay as 2 ms and loaded the calculated values into the TH and TL registers. To calculate the values, access the tutorial link provided above. Now, if I run a 2 ms delay for 500 times, it will generate a 1 second delay. Running this 1 second delay for 60 times gives me a 1 minute delay.
1 Second Delay Circuit Diagram of 8051 Microcontroller
The above tutorial is very important to understand the delay function. I calculated the TH and TL register values for 2ms delay and ran them for 1ms (500 times). The code is generating exactly 1ms of delay.
Port 1 Pn#0 is connected to the – (negative) led leg. Apply 5 volts to the + (positive) leg of the LED. Connect the oscillator (11.0592 MHz) with PINs #18 and 19 (XTAL0, XTAL1) of the 89c51 microcontroller. Apply 5 volts to pins #40 and 31 of 8051 (89c51). Grounding pin #20.
- 8051 TIMER RECORDS AND THEIR WORKING
- Digital Clock with Microcontroller 89c51.
- Calculator with 89c51 microcontroller.
- HOW TO MAKE A SECOND DELAY