Knowee
Questions
Features
Study Tools

Discuss: 1. TMOD, TCON, IE and IP register2. Procedure (Steps) for Time Delay calculation with an example

Question

Discuss: 1. TMOD, TCON, IE and IP register2. Procedure (Steps) for Time Delay calculation with an example

🧐 Not the exact question you are looking for?Go ask a question

Solution

  1. TMOD, TCON, IE and IP Register:

    • TMOD Register: This is the Timer Mode Register. It is used to define the operation (mode) of the timers 0 and 1. It can be used to set the timers for 16-bit or 8-bit mode, auto-reload, and other features.

    • TCON Register: This is the Timer Control Register. It is used to start or stop the timers and to configure the way the timers count (up or down).

    • IE Register: This is the Interrupt Enable Register. It is used to enable or disable specific interrupts. Each bit in the register corresponds to a specific interrupt.

    • IP Register: This is the Interrupt Priority Register. It is used to set the priority of the interrupts. If two interrupts occur at the same time, the one with the higher priority (set in the IP register) is handled first.

  2. Procedure for Time Delay Calculation:

    The steps for calculating a time delay using a timer are as follows:

    Step 1: Choose the timer mode in the TMOD register.

    Step 2: Load the TH (Timer High) and TL (Timer Low) registers with the initial count. The initial count is calculated based on the desired delay and the clock frequency.

    Step 3: Start the timer by setting the appropriate bit in the TCON register.

    Step 4: Wait for the timer to overflow. When the timer overflows, it sets a flag in the TCON register.

    Step 5: Stop the timer by clearing the appropriate bit in the TCON register.

    Step 6: Clear the timer overflow flag.

    Example: If we want a delay of 1ms and we have a clock frequency of 11.0592 MHz, we can calculate the initial count as follows:

    • First, calculate the timer count frequency, which is the clock frequency divided by 12 (because the timer counts on every 12th clock cycle). For an 11.0592 MHz clock, this gives a timer count frequency of 921.6 kHz.

    • Next, calculate the number of timer counts needed for a 1ms delay. Since 1ms is 1/1000 of a second, and our timer count frequency is 921.6 kHz, we need 921.6 counts for a 1ms delay.

    • Since the timer counts up to 65536 (for 16-bit mode), we subtract our count from 65536 to get the initial count. So, the initial count is 65536 - 922 = 64614.

    • This initial count is then loaded into the TH and TL registers (with the high byte in TH and the low byte in TL) before starting the timer.

This problem has been solved

Similar Questions

Explain various delay which are occur in data packet transmission.

What is the delay of the following program? MVI B, 10H LOOP2 MVI C, 0FH LOOP1 DCR C JNZ LOOP1 DCR B JNZ LOOP2 A) 3652 T-states B) 3533 T-states C) 2510 T-states D) 3600 T-states

xt, we calculate the bandwidth-delay product, which give

Processing Delay, Queuing Delay, Transmission Delay, Propagation Delay, Throughput and Loss

What value do we need to load the timer’s register if we want to have a time delay of 5 ms (milliseconds) using timer 0, T0 in mode 1? Consider crystal frequency to be 12 MHz.1 pointTH0 = CEH, TL0 = 70HTL0 = ECH, TH0 = 78Hnone of theseTH0 = ECH, TL0 = 78H

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.