STC8A8K64D4 Series Manual
13.3 Timer 2 (24-bit timer, 8-bit prescaler + 16-bit timing)
13.3.1 Auxiliary Register 1 (AUXR)
Symbol
Address
AUXR
8EH
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)
Symbol
Address
INTCLKO
8FH
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
Symbol
Address
T2L
D7H
T2H
D6H
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)
Symbol
Address
TM2PS
FEA2H
Timer 2 clock = SYSclk ÷( TM2PS + 1 )
13.3.5 Timer 2 working mode
The functional block diagram of Timer/Counter 2 is as follows.
B7
B6
T0x12
T1x12
UART_M0x6
B7
B6
-
EX4
B7
B6
B7
B6
B5
B4
B3
T2R
T2_C/T
B5
B4
B3
EX3
EX2
-
B5
B4
B3
B5
B4
B3
B2
B1
B0
T2x12
EXTRAM
S1ST2
B2
B1
B0
T2CLKO
T1CLKO
T0CLKO
B2
B1
B0
B2
B1
B0
- 290 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?
Questions and answers