223
CHAPTER 11 WATCH TIMER
User’s Manual U12697EJ3V0UM
11.4 Operation
11.4.1 Operation as watch timer
The watch timer operates with time intervals of 2
14
/f
W
or 2
5
/f
W
with the main system clock (4.19 MHz) or subsystem
clock (32.768 kHz).
The watch timer generates an interrupt request (INTWT) at fixed time intervals.
The count operation of the watch timer is started when bits 0 (WTM0) and 1 (WTM1) of the watch timer mode control
register (WTM) are set to 1. When these bits are cleared to 0, the 5-bit counter is cleared, and the watch timer stops
the count operation.
When the interval timer function is started at the same time, the watch timer can be started from 0 second by
resetting WTM1 to 0. However, an error of up to 2
14
/f
W
or 2
5
/f
W
may occur when the watch timer overflows (INTWT).
Caution A time interval of 0.5 second cannot be generated by the 12.5 MHz main system clock. Use the
32.768 kHz subsystem clock to generate the 0.5-second time interval
11.4.2 Operation as interval timer
The watch timer can also be used as an interval timer that repeatedly generates an interrupt request (INTTM3)
at intervals specified by a count value set in advance.
The interval time can be selected by bits 4 through 6 (WTM4 through WTM6) of the watch timer mode control register
(WTM).
Table 11-3. Interval Time of Interval Timer
WTM6
WTM5
WTM4
Interval Time
f
XX
= 12.5 MHz
f
XX
= 4.19 MHz
f
XT
= 32.768 kHz
0
0
0
2
4
×
1/f
W
164
µ
s
488
µ
s
488
µ
s
0
0
1
2
5
×
1/f
W
328
µ
s
977
µ
s
977
µ
s
0
1
0
2
6
×
1/f
W
655
µ
s
1.95 ms
1.95 ms
0
1
1
2
7
×
1/f
W
1.31 ms
3.91 ms
3.91 ms
1
0
0
2
8
×
1/f
W
2.62 ms
7.81 ms
7.81 ms
1
0
1
2
9
×
1/f
W
5.24 ms
15.6 ms
15.6 ms
Other than above
Setting prohibited
Cautions 1. Stop the timer operation before overwriting WTM.
2. Do not overwrite WTM when both the watch timer and interval timer are being used. If
the timer is stopped to overwrite WTM, both the prescaler and timer are cleared, causing
an error to occur for the watch timer interrupt (INTWT).
Remark
f
W
: Watch timer clock oscillation frequency (f
XX
/2
7
or f
XT
)
f
XX
: Main system clock frequency
f
XT
: Subsystem clock oscillation frequency