WINSEM2023-24 BECE320E ETH VL2023240504752 2024-03-18 Reference-Material-I
WINSEM2023-24 BECE320E ETH VL2023240504752 2024-03-18 Reference-Material-I
Srihari Mandava
Department of Electrical Engineering,
SELECT
C/T (clock/timer)
• This bit in the TMOD register is used to decide whether
the timer is used as a delay generator or an event counter.
C/T (clock/timer)
• This bit in the TMOD register is used to decide whether
the timer is used as a delay generator or an event counter.
}
The delay length depends on three factors:
The crystal frequency
The number of clocks per machine cycle
The C compiler.
• AT89C51/52 uses 12, while the OS5000 uses 4 clocks, and the
OS89C4xO uses only one clock per machine cycle.
• The C compiler is a factor in the delay size since various 8051
C compilers generate different hex code sizes.
}
To calculate the values to be loaded into the TL and TH registers,
• The C/T bit in the TMOD registers decides the source of the
clock for the timer
When C/T = 1, the timer is used as a counter and gets its
pulses from outside the 8051.
The counter counts up as pulses are fed from pins 14 and
15, these pins are called T0 (timer 0 input) and T1 (timer 1
input)
A timer can be used as a counter if we provide pulses from
outside the chip instead of using the frequency of the crystal
oscillator as the clock source.