TIMER B
8.5 Pulse period/Pulse width measurement mode
8.5 Pulse period/Pulse width measurement mode
In this mode, the timer measures an external signal’s pulse period or pulse width. Tables 8.5.1 and 8.5.2
list the specifications of the pulse period/pulse width measurement mode. Figure 8.5.1 shows the structures
of the timer Bi register and timer Bi mode register in the pulse period/pulse width measurement mode.
(1) Pulse period measurement
The timer measures the pulse period of the external signal that is input to the TBiIN pin.
(2) Pulse width measurement
The timer measures the pulse width (“L” level and “H” level widths) of the external signal that is input
to the TBiIN pin.
Table 8.5.1 Specifications of pulse period/pulse width measurement mode (when counter clear type is selected)
Item
Specifications
Count source f
i
f2, f16, f64, or f512
Count operation
✕ Countup
✕ Counter value is transferred to the reload register at valid edge of
measurement pulse, and counting continues after clearing the counter
value to “000016.”
Count start condition
Count stop condition
When the count start bit is set to “1.”
When the count start bit is cleared to “0.”
Interrupt request occurrence timing ✕ When a valid edge of measurement pulse is input (Note 1).
✕ When a counter overflow occurs (The timer Bi overflow flag is set
to “1” simultaneously.)
TBiIN pin’s function
Measurement pulse input pin (Note 2)
The value obtained by reading the timer Bi register is the reload
register’s contents (Measurement result) (Note 3).
Invalid
Read from timer Bi register
Write to timer Bi register
Timer Bi overflow flag: This bit is used to identify the source of an interrupt request occurrence.
Notes 1: No interrupt request occurs when the first valid edge is input after the counter starts counting.
2: When using timer B2, make sure that the timer B2 clock source select bit (see Figure 8.4.2.) to
“0.”
3: The value read out from the timer Bi register is undefined in the period after the counter starts
counting until the second valid edge is input.
7906 Group User’s Manual Rev.2.0
8-19