169
5.6 Notes on Using the Timebase Timer
5.6
Notes on Using the Timebase Timer
The following describes the precautions to take when using the timebase timer.
I
Notes on Using the Timebase Timer
H
Precautions when setting the timebase timer with programs
Because it is impossible to return from interrupt processing if the interrupt request flag bit
(TBTC: TBOF) is "1" and the interrupt request enable bit (TBTC: TBIE=1) is allowed, the TBOF
bit must be cleared.
H
Clearing the timebase timer
The timebase timer is cleared, in addition to clearing by the timebase timer initialization bit
(TBTC: TBR=0), when the oscillation stabilization wait time of the main clock is required. If the
timebase timer is selected (WDTC: CS=0) as the count clock of the watchdog timer, the
watchdog timer is cleared when the timebase timer is cleared.
H
Using the timebase timer as a timer for the oscillation stabilization wait time
Since the main clock oscillation is stopped when the power is turned on or is in main stop mode
or subclock mode, the oscillator takes the oscillation stabilization wait time of the main clock.
The appropriate oscillation stabilization wait time must be selected according to the type of
resonator connected to the oscillator (clock generator) of the main clock.
For details, see Section 3.7.5 "Oscillation Stabilization Wait Time"
H
Precautions for peripheral functions to which the clock is supplied from the timebase
timer
In a mode in which the main clock oscillation stops, the counter is cleared and the timebase
timer stops its operation. If the counter of the timebase timer is cleared, the "H" level of the
clock supplied by the timebase timer is short and its "H" level may be longer by a 1/2 cycle at
the most because the output originates from the initial state. Though the clock for the watchdog
timer is also output from the initial state, the watchdog timer works in normal cycles because the
counter of the watchdog timer is cleared simultaneously.
Figure 5.6-1 "Effects on the LCD Controller/Driver when the Timebase Timer is Cleared" shows
the effects on the LCD controller/driver when the timebase timer is cleared.