212
CHAPTER 8 8/16-BIT TIMER/COUNTER
Table 8.4-2 Functions of the Bits in the Timer 2 Control Register (T2CR)
Bit name
Function
Bit 7
T2IF:
Interrupt request flag bit
Set to "1" if Timer 2 has a counter value matching the Timer
2 data register (T2DR) setting value (comparator data latch).
Setting this bit and the interrupt request enable bit (T2IE)
to "1" outputs an interrupt request.
Cleared to "0" while writing. Setting this bit to "1" does
not affect it and causes no change.
Note:
In the 16-bit mode, the T1IF bit becomes valid and the
T2IF bit becomes irrelevant to the operation.
Bit 6
T2IE:
Interrupt request enable bit
Enables or disables the interrupt request output to the
CPU.
Setting this bit and the interrupt request flag bit (T2IF) to
"1" outputs an interrupt request.
Note:
In the 16-bit mode, the T1IE bit becomes valid and the
T2IE bit becomes irrelevant to the operation.
Bit 5
Bit 4
T021, T020:
Square wave output control
bits
Setting these bits to "00
B
" makes the T23/T02 pin a general-
purpose port (P23). Setting these bits to any other value
makes it a square wave output pin (T02). If the HCLK output
is enabled at the same time, the square wave output (T02) is
prioritized.
Writing "01
B
" or "10
B
" in these bits sets the initialization
data in the square wave output control circuit but does not
output it to the T02 pin.
If these bits are set to "11
B
" and the timer is stopped
(STR1=0), the T02 pin is set to a level corresponding to
the initialization data.
Bit 3
Bit 2
TC21, TC20:
Clock source select bit
Note:
Selects the count clock to be supplied to the counter.
Selects one of the three internal clocks.
Setting these bits to "11
B
" selects the 16-bit mode.
In the 16-bit mode, the TC11 and TC10 bits becomes
valid and the TC21 and TC20 bits only select the 16-bit
mode.
Bit 1
STP2:
Timer stop bit
Suspends the counter.
Writing "1" in this bit suspends the counter operation.
While the timer is started (STR2=1), writing "0" causes
the counter to continue the operation.
Note:
In the 16-bit mode, the STP1 bit becomes valid and the
STP2 bit becomes irrelevant to the operation.