![](http://datasheet.mmic.net.cn/120000/MB89P985PFV-201_datasheet_3559095/MB89P985PFV-201_232.png)
228
CHAPTER 8 8/16-BIT TIMER/COUNTER
Check:
When using timer 2 in the 16-bit mode, set T2CS1 and T2CS0 to "11B"; then use the T1CR
register to control the circuit.
Table 8.3-2 Timer 2 Control Register (T2CR) Bits
Bit
Function
Bit 7
T2IF:
Interrupt request
flag bit
Set to "1" when the count in the timer 2 counter matches
the value set in the T2DR, the Timer 2 data register
(comparison data latch).
An interrupt request is output when both this bit and the
interrupt request enable bit (T2IE) are "1".
Writing "0" clears this bit. Writing "1"has no effect and
does not change the bit value.
Check:
In the 16-bit mode, the T1IF bit is the valid interrupt
request flag, and the T2IF bit has no effect.
Bit 6
T2IE:
Interrupt request
enable bit
This bit enables or disables an interrupt request output
to the CPU.
An interrupt request is output when both this bit and the
interrupt request flag bit (T2IF) are "1".
Check:
In the 16 bit mode, the T1IE bit is the valid interrupt
request enable bit, and the T2IE bit has no effect.
Bit 5
Bit 4
T2OS1 and
T2OS0:
Unused bits
These bits are not used in timer 2. They should always be
written to "00".
Bit 3
Bit 2
T2CS1 and T2CS0:
Clock Source
Selection Bits
TSelects the count clock to be supplied to the counter.
Selects one of three internal clocks.
Setting to "11B" selects the 16-bit mode.
Check:
In 16-bit mode, T1CS1 and T1CS0 select the clock.
T2CS1 and T2CS0 serve only to select the 16 bit-mode.
Bit 1
T2STP:
Timer stop Bit
This bit is used to temporarily stop the counter.
Writing this bit to "1" temporarily stops the counter.
Writing it to "0" when the timer start bit (T2STR) is "1",
restarts the counter where it left off.
Check:
In 16-bit mode, T1STP is the stop bit, and T2STP has
no effect.
Bit 0
T2STR:
Timer activation bit
Starts and stops timer.
Changing this bit from "0" to "1" clears the counter. At
this time, if the T2STP bit is "0", the counter starts
(counts up, clocked by selected count clock). Writing
this bit to "0" stops the counter.
Check:
In 16-bit mode, T1STR is the start bit, and T2STR has
no effect.