433
16-bit Interval Timer Z (TMZ)
Chapter 12
Preliminary User’s Manual U17566EE1V2UM00
(2)
TZnCNT0 - TMZn synchronized counter register
The TZnCNT0 register is the synchronized register that can be used to read
the present value of the 16-bit counter.
“Synchronized” means that the read access via the internal bus is
synchronized with the maximum counter clock (PCLK2). The synchronization
process may cause a delay, but the resulting value is reliable.
Access
This register is read-only, in 16-bit units.
Address
<base> of TMZn
Initial Value
0000
H
. This register is cleared by any reset and when TZnCTL.TZCE = 0.
(3)
TZnCNT1 - TMZn non-synchronized counter register
The TZnCNT1 register is the non-synchronized register that can be used to
read the present value of the corresponding 16-bit counter.
“Non-synchronized” means that the read access via the internal bus is not
synchronized with the counter clock. It returns the instantaneous value
immediately, with the risk that this value is just being updated by the counter
and therefore in doubt.
Access
This register is read-only, in 16-bit units.
Address
<base> + 2
H
Initial Value
0000
H
. This register is cleared by any reset and when TZnCTL.TZCE = 0.
Note
The value read from this register can be incorrect, because the read access is
not synchronized with the counter clock.
Therefore, this register shall be read multiple times within one period of the
counter clock cycle.
If the difference between the first and the second value is not greater than one,
you can consider the second value to be correct. If the difference between the
two values is greater than one, you have to read the register a third time and
compare the third value with the second. Again, the difference must not be
greater than one.
If the read accesses do not happen within one period of the counter clock
cycle, the difference between the last two values will usually be greater than
one. In this case, you can only repeat the procedure or estimate the updated
counter value.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Updated counter value (synchronized)
R
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Instantaneous counter value (non-synchronized)
R
electronic components distributor