4. Find the values to be loaded in the THO and TLO register in mode-2 of the 8051 microcontroller with a crystal oscillator frequency 12MHz so that it gives a delay of 50 uSec.
4. Find the values to be loaded in the THO and TLO register in mode-2 of the 8051 microcontroller with a crystal oscillator frequency 12MHz so that it gives a delay of 50 uSec.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
![### Timer Calculation for 8051 Microcontroller (Timer Mode-2)
**Problem Statement:**
Find the values to be loaded in the TH0 and TL0 registers in mode-2 of the 8051 microcontroller with a crystal oscillator frequency of 12 MHz to obtain a delay of 50 microseconds (µSec).
**Solution:**
To determine the values for TH0 and TL0, follow these steps:
1. **Calculate the Timer Frequency:**
- The basic frequency of the microcontroller is derived from the crystal oscillator.
- The 8051 microcontroller operates at one-fourth of the crystal oscillator frequency. Therefore, with a 12 MHz crystal, the timer frequency \( f_{T} \) is:
\[
f_{T} = \frac{12\, \text{MHz}}{12} = 1\, \text{MHz}
\]
- This corresponds to a time period \( T \) of:
\[
T = \frac{1}{f_{T}} = \frac{1}{1\, \text{MHz}} = 1\, \mu\text{Sec}
\]
2. **Calculate the Number of Clock Cycles for the Desired Delay:**
- A delay of 50 µSec is required.
\[
\text{Number of clock cycles} = \frac{\text{Desired delay}}{T} = \frac{50\, \mu\text{Sec}}{1\, \mu\text{Sec}} = 50
\]
3. **Calculate the Timer Register Value:**
- In mode-2, the timer operates in an 8-bit auto-reload mode. The timer counts up to 256 (0xFF + 1) and then reloads the value from TH0.
- To achieve 50 cycles, calculate the initial value to be loaded into the timer registers (TH0 and TL0):
\[
\text{Count value} = 256 - 50 = 206 = \text{0xCE}
\]
4. **Load the Timer Registers (TH0 and TL0):**
- For the desired 50 µSec delay:
\[
TH0 = TL0 = 0xCE
\]
### Summary:
Therefore, to set up the 8051 microcontroller for a 50 µSec delay using](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcac3a29c-ba1e-45d5-a4c0-dd75250fa832%2Fec0daaa5-2402-4450-b413-39f1536f8a57%2Fl5o1ckt_processed.jpeg&w=3840&q=75)
Transcribed Image Text:### Timer Calculation for 8051 Microcontroller (Timer Mode-2)
**Problem Statement:**
Find the values to be loaded in the TH0 and TL0 registers in mode-2 of the 8051 microcontroller with a crystal oscillator frequency of 12 MHz to obtain a delay of 50 microseconds (µSec).
**Solution:**
To determine the values for TH0 and TL0, follow these steps:
1. **Calculate the Timer Frequency:**
- The basic frequency of the microcontroller is derived from the crystal oscillator.
- The 8051 microcontroller operates at one-fourth of the crystal oscillator frequency. Therefore, with a 12 MHz crystal, the timer frequency \( f_{T} \) is:
\[
f_{T} = \frac{12\, \text{MHz}}{12} = 1\, \text{MHz}
\]
- This corresponds to a time period \( T \) of:
\[
T = \frac{1}{f_{T}} = \frac{1}{1\, \text{MHz}} = 1\, \mu\text{Sec}
\]
2. **Calculate the Number of Clock Cycles for the Desired Delay:**
- A delay of 50 µSec is required.
\[
\text{Number of clock cycles} = \frac{\text{Desired delay}}{T} = \frac{50\, \mu\text{Sec}}{1\, \mu\text{Sec}} = 50
\]
3. **Calculate the Timer Register Value:**
- In mode-2, the timer operates in an 8-bit auto-reload mode. The timer counts up to 256 (0xFF + 1) and then reloads the value from TH0.
- To achieve 50 cycles, calculate the initial value to be loaded into the timer registers (TH0 and TL0):
\[
\text{Count value} = 256 - 50 = 206 = \text{0xCE}
\]
4. **Load the Timer Registers (TH0 and TL0):**
- For the desired 50 µSec delay:
\[
TH0 = TL0 = 0xCE
\]
### Summary:
Therefore, to set up the 8051 microcontroller for a 50 µSec delay using
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY