167
5.5 Operation of the Timebase Timer
5.5
Operation of the Timebase Timer
The timebase timer provides the interval timer function and supplies the clock to part
of the peripheral functions.
I
Operation of the Interval Timer Function (Timebase Timer)
The setting in Figure 5.5-1 "Setting of the Interval Timer Function" is required for the operation
of the interval timer function.
Figure 5.5-1 Setting of the Interval Timer Function
The counter of the timebase timer continues to count up provided the main clock oscillates in
synchronization with the internal count clock (divide-by-two of the main clock oscillation).
If the counter is cleared (TBR=0), it starts counting up from "0". If an overflow of the bit for the
interval timer occurs, "1" is set to the overflow interrupt request flag bit (TBOF). That is, starting
when clearing occurs, an interrupt request is generated at regular intervals of the selected time.
I
Operation of the Clock Supply Function
The timebase timer is also used as a timer to generate the oscillation stabilization wait time of
the main clock. Counting of the oscillation stabilization wait time starts when the counter of the
timebase timer is cleared and ends when an overflow of the bit for oscillation stabilization wait
time occurs. Three kinds of oscillation stabilization wait time can be selected by the setting of
the oscillation stabilization wait time select bits (SYCC: WY1, WT0) of the system clock control
register.
The timebase timer supplies the clock to the watchdog timer, A/D converter, and LCD controller/
driver. When the counter of the timebase timer is cleared, operations of the continuous
activation cycles of the A/D converter and those of the frame cycles of the LCD controller/driver
are affected. The counter of the watchdog timer is cleared at the same time provided the
timebase timer output is selected (WDTC: CS=0).
I
Operations of the Time-based Timer
Figure 5.5-2 "Operations of the Timebase Timer" shows the operations in the following states:
When a power-on reset occurs
When a transition to the sleep mode occurs during operation of the interval timer function in
main clock mode
When a transition to the main stop mode occurs
When the counter clear is requested
In subclock mode and main stop mode, the timebase timer is cleared and its operation is
stopped. When returning from the subclock mode or main stop mode, the oscillation
stabilization wait time is counted by the timebase timer.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
TBTC
TBC0 TBR
TBC1
1
0
0
TBIE
TBOF
: Bit used
1 : 1 is set
0 : 0 is set