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...
icon
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
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
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY