
98
TOSHIBA CORPORATION
TMP96C141AF
(4)
Application Examples of Capture Function
The loading of up-counter (UC4) values into the cap-
ture registers CAP1 and CAP2, the timer flip-flop TFF4
inversion due to the match detection by comparators
CP4 and CP5, and the output of TFF4 status to TO4
pin can be enabled or disabled. Combined with inter-
rupt function, they can be applied in many ways, for
example:
One-shot pulse output from external trigger pulse
Frequency measurement
Pulse width measurement
Time difference measurement
Figure 3.9 (14). One-Shot Pulse Output (with Delay)
One-Shot Pulse Output from External Trigger Pulse
Set the up-counter UC4 in free-running mode with the
internal input clock, input the external trigger pulse
from TI4 pin, and load the value of up-counter into
capture register CAP1 at the rise edge of the TI4 pin.
Then set to T4MOD <CAP12M1, 0> = 01.
When the interrupt INT4 is generated at the rise edge
of TI4 input, set the CAP1 value (c) plus a delay time (d)
to TREG4 (= c + d), and set the above set value (c + d)
plus a one-shot pulse width (p) to TREG5 (= c + d + p).
When the interrupt INT4 occurs the T4FFCR <EQ5T4,
EQ4T4> register should be set that the TFF4 inversion
is enabled only when the up-counter value matches
TREG4 or TREG5. When interrupt INTTR5 occurs, this
inversion will be disabled.