MB95630H Series
92
FUJITSU SEMICONDUCTOR LIMITED
MN702-00009-1v0-E
CHAPTER 7 TIME-BASE TIMER
7.4 Operations and Setting Procedure
Example
7.4
Operations and Setting Procedure Example
This section describes the operations of the interval timer function of the time-
base timer.
■
Operations of Time-base Timer
The counter of the time-base timer is initialized to "0xFFFFFF" after a reset, and starts
counting while being synchronized with the main clock divided by two, the main CR clock, or
the main CR PLL clock.
The time-base timer continues to count down as long as the main clock, the main CR clock, or
the main CR PLL clock is oscillating. Once the main clock, the main CR clock, or the main CR
PLL clock stops, the counter stops counting and is initialized to "0xFFFFFF".
The settings shown in Figure 7.4-1 are required to use the interval timer function.
Figure 7.4-1 Settings of Interval Timer Function
When the time-base timer clear bit in the time-base timer control register (TBTC:TCLR) is set
to "1", the counter of the time-base timer is initialized to "0xFFFFFF" and continues to count
down. When the selected interval time has elapsed, the time-base timer interrupt request flag
bit of the time-base timer control register (TBTC:TBIF) becomes "1". In other words, an
interrupt request is generated at each interval time selected, based on the time when the counter
was last cleared.
■
Clearing Time-base Timer
With the output of the time-base timer being used in other peripheral functions, clearing the
time-base timer affects their operations in various ways such as changing the count time of a
peripheral function.
When clearing the counter by using the time-base timer clear bit (TBTC:TCLR), modify the
settings of other peripheral functions whenever necessary so that clearing the counter does not
have any unexpected effect on them.
When the output of the time-base timer is selected as the count clock for the watchdog timer,
clearing the time-base timer also clears the watchdog timer.
The time-base timer is cleared not only by the TCLR bit, but also when the main clock, the
main CR clock, or the main CR PLL clock is stopped and the oscillation stabilization wait time
is necessary. The time-base timer is cleared in the following situations:
•
When the device transits from the main clock mode or main CR clock mode or the main CR
PLL clock mode to the stop mode
•
When the device transits from the main clock mode or main CR clock mode or the main CR
PLL clock mode to the subclock mode or sub-CR clock mode
•
At power-on
•
At low-voltage detection reset
0
1
0
Bit to
b
e
us
ed
:
:
:
S
et to "1".
S
et to "0".
TBIF
TBTC
TBIE
-
TBC
3
TBC2
TBC1
TBC0
TCLR
0
1
b
it7
b
it6
b
it5
b
it4
b
it
3
b
it2
b
it1
b
it0