480
Chapter 14
Watch Timer (WT)
Preliminary User’s Manual U17566EE1V2UM00
14.1.2
Principle of operation
In order to generate an interrupt every one or two seconds, WTCLK is usually
set to a frequency around 30 KHz. Then, a load value around 2
15
will yield a
running time of about 1 s.
(1)
Operation control of WT0
The source and frequency of WTCLK are specified in the Clock Generator
register TCC.
The Clock Generator contains a programmable frequency divider that makes it
possible to scale down the selected clock source.
Note
WTCLK uses the same clock source and clock divider as the LCD Controller/
Driver clock LCDCLK. The frequency f
WTCLK
can be the same as f
LCDCLK
or
f
LCDCLK
/ 2. For details refer to
“Clock Generator“ on page 129
.
Typical settings and the resulting maximum time interval between two
interrupts are listed in the table below.
Note that you can double the maximum period by setting TCC.WTSEL1 to 1.
The clock input can be disabled (WT0CTL.WTCE = 0). This stops the Watch
Timer. After reset, the timer is also stopped.
When WT0 is enabled and a non-zero reload value is specified, the counter
decreases with every rising edge of WTCLK. When the counter reaches zero,
the interrupt INTWT0UV is active high for one clock cycle. Upon undeflow, i.e.
with the next clock, the timer reloads its start value and resumes down-
counting. The load value can be freely chosen
(2)
Operation of WT1
Once WT1 is enabled and a non-zero reload value is specified, its counter
decreases with every interrupt INTWT0UV.
When WT1 reaches zero, it generates the interrupt INTWT1UV. Upon
undeflow, i.e. with the next clock, the timer reloads its load value and restarts
down-counting. The load value can be freely chosen.
Starting WT1 requires some attention. For further details refer to
“Watch Timer
start-up“ on page 486
.
Table 14-1
Typical Settings of WTCLK
Clock source
Clock divider setting
WTCLK Frequency
Max. period of INTWT0UV
a
4 MHz main osc.
1 / 128
31.25 KHz
2.097 s
32 KHz sub osc.
1
32.768 KHz (typ.)
2.0 s
240 KHz ring osc.
1 / 8
30 KHz (typ.)
2.184533 s
a)
The maximum period corresponds to a counter load value of 2
16
– 1.
electronic components distributor