www
.mcu.com.cn
83
/
239
Rev.
1.00
CMS80F731x Reference Manual
9.4
Timer0 Working Mode
9.4.1
T0 - Mode 0 (13-bit Timing/Counting Mode)
In this mode, timer 0 is a 13-bit register. When all the bits of the counter are flipped from 1 to 0, the timer 0 interrupt flag
TF0 is set to 1. When TCON.4=1 and TMOD.3=0 or TCON.4=1, TMOD.3=1, T0G=1, the count input is enabled to timer 0.
(Setting TMOD.3=1 allows timer 0 to be controlled by an external pin, T0G, for pulse width measurements). The 13-bit register
consists of TH0 and TL0 low 5 bits. TL0 high 3 bits should be ignored. Timer0 Mode 0 block diagram is shown in the following
figure:
CLK
TMOD.3
TCON.4
TCON.5
TL0
5Bit
T0G
:12-T0M=0
: 4-T0M=1
T0
TMOD.2=0
TMOD.2=1
TH0
8Bit
interrupt request
9.4.2
T0 - Mode 1 (16-bit Timing/Counting Mode)
Mode 1 is the same as mode 0, except that the timer 0 data register 16 bits are all running in mode 1. Timer0 mode 1
block diagram is shown in the following figure:
CLK
TMOD.3
TCON.4
TCON.5
TL0
8Bit
T0G
:12-T0M=0
: 4-T0M=1
T0
TMOD.2=0
TMOD.2=1
TH0
8Bit
interrupt request