Toshiba TLCS-900 Computer Hardware User Manual


 
TMP92CM22
2007-02-16
92CM22-140
4. Measurement of difference time
This mode is used to measure the difference in time between the rising edges of
external pulses input through TB1IN0 and TB1IN1.
Keep the 16-bit timer/event counter (TMRB1) counting (Free running) with the
prescaler output clock, and load the UC12 value into TB1CP0H/L at the rising
edge of the input pulse to TB1IN0. Then the interrupt INT4 is generated.
Similarly, the UC012 value is loaded into TB1CP1H/L at the rising edge of the
input pulse to TB1IN1, generating the interrupt INT5.
The time difference between these pulses can be obtained by multiplying the
value subtracted TB1CP0H/L from TB1CP1H/L and the internal clock cycle
together at which loading the UC12 value into TB1CP0H/L and TB1CP1H/L has
been done.
Figure 3.8.16 Measurement of Difference Time
C1 C2
TB1IN0
p
in in
p
ut
Load intoTB1CP1H/L
Count clock
(Prescaler output clock)
INT4
INT5
Difference time
Load into TB1CP0H/L
TB1IN1
p
in in
p
ut