495
Watch Timer (WT)
Chapter 14
Preliminary User’s Manual U17566EE1V2UM00
14.5.2
INTWT0UV interval measurement by restarting the counter
When the timer is in restart mode (see register TMC00) and it detects the valid
edge of INTWT0UV, it
• copies the present counter value of register TM00 to CR000,
• clears TM00 (restarts counting),
• generates the interrupt request INTTM00.
The valid edge (rising edge, falling edge) is specified in register PRM00. If both
edges are specified, CR000 cannot perform a capture operation.
Setup example
TMC00 = 0000 1000
B
: Restart
mode
CRC00 = 0000 0x11
B
:
CR000 as capture register with
INTWT0UV as capture signal
PRM00.ES00[1:0] = 0100 0000
B
: Rising
edge
The following figure is not to scale but illustrates the operation.
Figure 14-5
Timing in restart mode
As shown in the figure, the present value of CR000 is directly related to the
duration of the previous interval.
Note
If TM00 overflows between two occurrences of INTWT0UV, that means
between two capture triggers, the overflow flag TMC00.OVF00 is set.
Therefore, check also TMC00.OVF00 when reading the second capture value
in order to calculate the interval correctly, because an overflow may have
happened during the measurement.
T
WCTCLK
0000
H
0000
H
FFFF
H
0001
H
D0
D1
D0
D1
D2
D
3
D2
D
3
(D1 + 1) × T
WCTCLK
(D
3
+
1)
×
T
WCTCLK
(10000
H
+ D2 + 1)
×
T
WCTCLK
WCTCLK
TM00
INTWT0UV
CR000
INTTM00
OVF00
0000
H
0000
H
0000
H
0000
H
electronic components distributor