197
CHAPTER 9 WATCH TIMER
User
’
s Manual U14701EJ3V0UD
9.5 Watch Timer Operations
9.5.1 Watch timer operation
By using the main system clock or subsystem clock, it operates as a watch timer with preset timing intervals.
Bits 2, 3, and 7 (WTNM02, WTNM03, and WTNM07) of watch timer operation mode register 0 (WTNM0) enable
the selection of the timing for the watch timer.
The watch timer generates an interrupt request (INTWTN0) at a fixed time interval.
If bit 0 (WTNM00) and bit 1 (WTNM01) of watch timer operation mode register 0 (WTNM0) are set to 1, the count
operation starts. If set to 0, the 5-bit counter is cleared and the count operation stops.
For simultaneous operation of the interval timer, a zero-second start can be achieved by setting WTNM01 to 0.
However, in this case, since the 11-bit prescaler is not cleared, at the first overflow (INTWTN0) after the watch
timer
’
s zero-second start, an error up to 2
11
×
1/f
W
seconds is generated.
9.5.2 Interval timer operation
The watch timer operates as an interval timer which generates interrupt requests (INTWTNI0) repeatedly at an
interval of the preset count value.
The interval time can be selected with bits 4 to 6 and 7 (WTNM04 to WTNM06 and WTNM07) of watch timer
operation mode register 0 (WTNM0).
Figure 9-3. Operation Timing of Watch Timer/Interval Timer
0H
Start
Overflow
Overflow
Watch timer
Count clock
Watch timer
interrupt INTWTN0
Interval timer
interrupt INTWTNI0
Interrupt time of watch timer
Interval time
(T)
T
Interrupt time of watch timer
n
×
T
n
×
T
Caution If the watch timer and 5-bit counter are enabled by watch timer operation mode register 0
(WTNM0) (by setting bits 0 (WTNM00) and 1 (WTNM01) of WTNM0 to 1), the time from this setting
to the occurrence of the first interrupt request (INTWTN0) is not exactly the value set by bits 2
and 3 (WTNM02 and WTNM03) of WTNM0. This is because the 5-bit counter is late by one output
cycle of the 11-bit prescaler in starting to count. The second INTWTN0 signal and those that
follow are generated exactly at the set time.
Remark
n: The number of times of interval timer operations