
Rev. 1.00
13� of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Timer/Event Counters 0, 1, 3
Timer/Event Counters 0, 1, 3
Mode 0 – 13-bit Counter/Timer Mode Operation
To select this mode, bits TnM1 and TnM0, should be set to “00”. The 13 bits of data are comprised
of 5 low bits in the TLn register and 8 high bits in the THn register. The C/Tn bit is used to select
the timer or counter function. The Counter/Timer Run or Stop operation is controlled using the TRn
bit. If the Counter function is selected, the TRn and GATEn bits can be used to manage the external
INTn input to count edge transitions or measure pulse widths. The timer/counter clock source is
decided by the TnPRE0 and TnPRE1 bits in the TMPRE register. Note that the TRn bit is used to
control the Timer/Counter run or stop function. Clearing this bit will not clear the TLn and THn
registers, the registers should be initialised by the application program. When an overflow occurs,
the TFn interrupt request flag will be set and an interrupt will take place if the interrupt is enabled.
13-bit Counter Data
Register
Bit
7
6
5
4
3
2
1
0
THn
D1�
D11
D10
D9
D8
D7
D6
D�
TLn
—
—
—
D4
D3
D�
D1
D0
Note:
n=1� �� 3
Mode 1 – 16-bit Counter/Timer Mode Operation
To select this mode, bits TnM1 and TnM0, should be set to “01” respectively. The 16 bits of data are
stored in the TLn and THn registers. The C/Tn bit is used to select the timer or counter function.
The Counter/Timer Run or Stop is controlled by TRn bit. If the Counter function is selected, the
TRn and GATEn bits can be used to manage the external INTn input to count edge transitions
or measure pulse widths. The timer/counter clock source is decided by the TnPRE0 and TnPRE1
bits in the TMPRE register. Note that the TRn bit is used to control the Timer/Counter run or
stop function. Clearing this bit will not clear the TLn and THn registers, the registers should
be initialised by the application program. When an overflow occurs, the TFn interrupt request
flags will be set and an interrupt will take place if the interrupt is enabled. The following block
illustrates the 13-bit and 16-bit Timer/Counter basic operational blocks.
f
SYS
Tn
TRn
GATEn
INTn
P�escale�
f
SYS
/4
f
SYS
f
SYS
/6
f
SYS
/1�
/
TnPRE[1:0]
TnM1/TnM0 = 00
D0
D1
D�
D3
D4
-
-
-
TLn
D�
D6
D7
D8
D9
D10
D11
D1�
THn
D0
D1
D�
D3
D4
-
-
-
TLn
D�
D6
D7
D8
D9
D10
D11
D1�
THn
Mode 0
TnM1/TnM0 = 01
D0
D1
D�
D3
D4
D�
D6
D7
TLn
D8
D9
D10
D11
D1�
D13
D14
D1�
THn
D0
D1
D�
D3
D4
D�
D6
D7
TLn
D8
D9
D10
D11
D1�
D13
D14
D1�
THn
Mode 1
Inte���pt
TFn flag
C/Tn=0
C/Tn=1
MUX
Mode 0 and Mode 1 Block Diagram – Timer 0, 1, 3