STC8A8K64D4 Series Manual
time. When TR1=1, that is, when Timer/Counter1 starts to work, writing content to TL1 is not actually written to the
current register TL1, but written to the hidden register RL_TL1, and writing content to TH1 is actually also it is not
written into the current register TH1, but into the hidden register RL_TH1, which can cleverly realize the 16-bit reload
timer. When reading the contents of TH1 and TL1, the contents be read are the contents of TH1 and TL1, not the
contents of RL_TH1 and RL_TL1.
When Timer1 is working in mode 0 (TMOD[5:4]/[M1,M0]=00B), the overflow of [TH1,TL1] not only sets TF1,
but also automatically reloads the contents of [RL_TH1,RL_TL1] to [TH1,TL1].
If T1CLKO/INT_CLKO.1=1, the P3.4/T1 pin is configured as timer 1's clock output T1CLKO. The output clock
frequency is
T1 overflow
If C/T=0, the timer/counter 1 counts the internal system clock, then:
if T1 works in 1T mode (AUXR.6/T1x12=1), the output clock frequency =
RL_TL1])/2
if T1 works in 12T mode (AUXR.6/T1x12=0), the output clock frequency =
RL_TL1])/2
If C/T=1, the timer/counter 1 counts the external pulse input (P3.5/T1), then:
the output clock frequency =
13.2.8 Timer1 mode 1 (16-bit non-autoreloadable mode)
In this mode, Timer/Counter 1 works in 16-bit non-reloadable mode, as shown in the figure below.
÷ 12
SYSclk
÷ 1
In this mode, Timer/Counter 1 is configured as a 16-bit non-reloadable mode, which is composed of 8 bits of TL1
and 8 bits of TH1. The 8-bit overflow of TL1 carries over to TH1, and the overflow of TH1 counts the overflow flag
TF1 in TCON.
When GATE=0 (TMOD.7), the timer will count if TR1=1. When GATE=1, it is allowed to control timer 1 by
external input INT1, so that pulse width measurement can be realized. TR1 is the control bit in the TCON register. For
the specific function description of each bit of the TCON register, see the introduction of the TCON register in the
previous section.
When C/T=0, the multiplexer is connected to the frequency division output of the system clock, T1 counts the
internal system clock, and works in timing mode. When C/T=1, the multiplexer is connected to the external pulse input
P3.5/T1, and T1 works in counting mode.
Timer1 of STC microcontroller has two counting rates: one is 12T mode, which is increased by 1 for every 12
clocks, which is the same as traditional 8051 microcontroller, the other is 1T mode, which is increased by 1 for each
clock, and the speed is 12 times of traditional 8051. The rate of T1 is determined by T1x12 in the special function
register AUXR. If T1x12=0, T1 works in 12T mode, and if T1x12=1, T1 works in 1T mode.
rate/2.
(T1_Pin_CLK) / (65536-[RL_TH1, RL_TL1])/2
AUXR.6/T1x12=0
C/T=0
AUXR.6/T1x12=1
C/T=1
T1 Pin
TR1
GATE
INT1
Timer/counter 1 mode 1: 16-bit non-reloadable mode
TH1
TL1
(8bits)
(8bits)
control
(SYSclk)/(65536-[RL_TH1,
(SYSclk)/12/(65536-[RL_TH1,
TF1
Interrupt
Toggle
T1CLKO
P3.4
T1CLKO
- 286 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?