EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Timer 2 (24-Bit Timer, 8-Bit Prescaler + 16-Bit Timing); Auxiliary Register 1 (AUXR); External Interrupt and Clock Output Control Register (INTCLKO); Timer 2 Counting Registers

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 290 -
13.3 Timer 2 (24-bit timer, 8-bit prescaler + 16-bit timing)
13.3.1 Auxiliary Register 1 (AUXR)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
AUXR
8EH
T0x12
T1x12
UART_M0x6
T2R
T2_C/T
T2x12
EXTRAM
S1ST2
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
B7
B6
B5
B4
B3
B2
B1
B0
INTCLKO
8FH
-
EX4
EX3
EX2
-
T2CLKO
T1CLKO
T0CLKO
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
B7
B6
B5
B4
B3
B2
B1
B0
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
B7
B6
B5
B4
B3
B2
B1
B0
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.

Table of Contents

Related product manuals