BAT32G1x9 user manual | Chapter 6 Universal timer unit Timer4/8
177 / 1149
Rev.1.02
counting.
Note: This is the timing when no noise filter is used. If a noise filter is used, edge detection is
delayed
by
2
f
MCK
cycles
(
3
to
4
cycles in total
) from the
TImn
input
. The
1-cycle error is due to the
TImn
input
being out of sync
with the counting clock (f
MCK
).
(4) Operation of single count mode
(1) By writing "1" to the TSmn bit, enter the run Enabled state (TEmn=1).
(2) The timer count register mn (TCRmn) remains at its initial value until a start trigger signal is generated.
(3) Detect the rising edge of the TImn input.
(4) Load the value of the TDRmn register (m) into the TCRmn register after generating the start trigger
signal, and start counting.
(5) When the TCRmn register decreases the count to "0000H", an INTTMmn interrupt is generated, and
the value of the TCRmn register becomes "FFFFH", stopping the count.
Figure 6-29
Runtime Sequence (Single Count Mode).
TSmn(write)
TImn(input)
rising edge
start
trigger
detection
singal
initial value
wait state of start trigger input
edge detection
Note: This is the timing when no noise filter is used. If a noise filter is used, edge detection is
delayed
by
2
f
MCK
cycles
(
3
to
4
cycles in total
) from the
TImn
input
. The
1-cycle error is due to the
TImn
input
being out of sync
with the counting clock (f
MCK
).