
21.2
Time Measurement Function (Input Capture)
When the external trigger is applied, the base timer value is stored into the GiTMj register (i = 0, 1 j = 0 to 7).
Table 21.4 shows specifications of the time measurement function.
Table 21.5 lists pin settings for the time
measurement function.
Figure 21.12 lists time measurement function associated register settings. Figures
21.13and
21.14 show operation examples of the time measurement function.
Figure 21.15 shows an operation example
of the prescaler function and gate function.
Table 21.4
Time Measurement Function Specifications
Item
Specification
Measurement channel
Channels 0 to 7
Trigger input polarity
Selectable from rising edge, falling edge, or both edges of the IIOi_ j pin
Measurement start condition
Set the IFEj bit in the GiFE register to 1 (channel j’s function enabled) while the
FSCj bit in the GiFS register is set to 1 (time measurement function selected)
Measurement stop condition
Set the IFEj bit to 0 (channel j’s function disabled)
Time measurement timing
Without prescaler: every time a trigger signal is applied
With prescaler (for channels 6 and 7):
every (GiTPRk register value + 1) times a trigger signal is applied (k = 6, 7)
Interrupt request generation timing The TMijR bit in the IIOmIR register (m = 0 to 11) is set to 1 (interrupt requested)
IIOi_ j pin
Trigger input
Selectable function
Digital filter function
The digital filter samples a trigger input signal level using f1 or fBT1 and
passes the pulse that have matched its signal level three times
Prescaler function (for channels 6 and 7)
Time measurement is taken every (GiTPRk register value + 1) times a trigger
signal is applied
Gate function (for channels 6 and 7)
After the time measurement is taken initiated by the first trigger input, the
following trigger inputs are all disabled. However, trigger inputs are enabled
again by matching the base timer value with the GiPOp register while the GOC
bit in the GiTMCRk register is set to 1 (gate function disabled by matching the
base timer value with the GiPOp register (p = 4 when k = 6, p = 5 when k = 7))