STC8A8K64D4 Series Manual
13.3 Timer 2 (24-bit timer, 8-bit prescaler + 16-bit timing)
13.3.1 Auxiliary Register 1 (AUXR)
TR2: T2 run control bit.
0: T2 stops counting.
1: T2 start counting.
T2_C/T: T2 mode select bit.
0: T2 is used as a timer (input pulse is from internal system clock);
1: T2 is used as a counter (input pulse is from external T2/P1.2 pin).
T2x12: T2 speed control bit.
0: The clock source of T2 is SYSclk/12.
1: The clock source of T2 is SYSclk/1.
13.3.2 External Interrupt and Clock Output Control Register (INTCLKO)
T2CLKO: T2 clock out control bit.
0: Turn off the clock output.
1: P1.3 is configured for T2 clock output pin. When T2 overflows, P1.3 will flip automatically.
13.3.3 Timer 2 Counting Registers
T2 operates in 16-bit auto-reload mode. T2L and T2H combine into a 16-bit register with T2L as the low byte and
T2H as the high byte. When the 16-bit counter [T2H, T2L] overflows, the system loads the reload value in the
internal 16-bit reload register into [T2H, T2L] automatically.
13.3.4 Timer 2 8-bit Prescaler Register (TM2PS)
Timer 2 clock
=
SYSclk
÷(
TM2PS + 1 )
13.3.5 Timer 2 working mode
The functional block diagram of Timer/Counter 2 is as follows.