Toshiba TLCS-900 Computer Hardware User Manual


 
TMP92CM22
2007-02-16
92CM22-136
(4) Capture function examples
Used capture function, they can be applicable in many ways, for example:
1. One-shot pulse output from external trigger pulse
2. Frequency measurement
3. Pulse width measurement
4. Measurement of difference time
1. One-shot pulse output from external trigger pulse
Set the up counter UC12 in free-running mode with the internal input clock,
input the external trigger pulse from TB1IN0 pin, and load the value of up
counter into capture register TB1CP0H/L at the rise edge of external trigger
pulse.
When the interrupt INT4 is generated at the rise edge of external trigger pulse,
set the TB1CP0H/L value (c) plus a delay time (d) to TB1RG0H/L (= c + d), and set
the above set value (c + d) plus a one-shot width (p) to TB1RG1H/L (= c + d + p).
And, set “11” to timer flip-flop control register TB1FFCR<TB1E1T1, TB1E0T1>.
Set to trigger enable for be inverted timer flip-flop TB1FF0 by UC12 matching
with TB1RG0H/L and with TB1RG1H/L. When interrupt INTTB11 occurs, this
inversion will be disabled after one-shot pulse is output.
The (c), (d), and (p) correspond to c, d, and p in
Figure 3.8.12.
Figure 3.8.12 One-shot Pulse Output (with delay)
TB1IN0 pin input
(External trigger pulse)
c c
+
d
+
p
Load into capture register 1 (TB1CP0H/L)
and generate INT4.
Match with TB1RG1H/L
Timer ou
p
ut
p
in TB1OUT0
Delay time
(d)
Match with TB1RG0H/L
c
+
d
Pulse width
(p)
Inversion
enable
Set it to disables that
inversion caused by
loading into TB1CP1H/L.
Inversion
enable
Generate
INTTB11.
Count clock
(
Prescaler out
p
ut clock
)
Set the counter in free-running mode.