139
μPD780948, μPD78F0948, μPD780949, μPD78F0949
(2) Measurement of two pulse widths with free running counter
The pulse widths of the two signals respectively input to the TI00 and TI01 pins can be measured when
the 16-bit timer register (TM0) is used as a free running counter (refer to Figure 7-14).
When the edge specified by bits 4 and 5 (ES00 and ES01) of the prescaler mode register 0 (PRM0) is
input to the TI00 pin, the value of the TM0 is loaded to the 16-bit capture/compare register 01 (CR01) and
an external interrupt request signal (INTTM01) is set.
When the edge specified by bits 6 and 7 (ES10 and ES11) of the prescaler mode register 0 (PRM0) is
input to the TI01 pin, the value of TM0 is loaded to the 16-bit capture/compare register 00 (CR00), and
an external interrupt request signal (INTTM00) is set.
The edges of the TI00 and TI01 pins are specified by bits 4 and 5 (ES00 and ES01) and bits 6 and 7
(ES10 and ES11) of PRM0, respectively. The rising, falling, or both rising and falling edges can be specified.
The valid edge of TI00/P05 pin and TI01/P04 pin is detected through sampling at a count clock cycle
selected by the prescaler mode register 0 (PRM0), and the capture operation is not performed until the
valid level is detected two times. Therefore, noise with a short pulse width can be rejected.
Fig
u
re 7-14: Control Register Settings for Measurement of Two Pulse Widths with Free Running
Counter
(a) 16-bit timer mode control register (TMC0)
(b) Capture/compare control register 0 (CRC0)
Remark:
0/1: When these bits are reset to 0 or set to 1, the other functions can be used along with
the pulse width measurement function. For details, refer to Figures 7-2 and 7-3.
0
0
0
0
TMC03
0
TMC02
1
TMC01
0/1
OVF0
0
TMC0
Free running mode
0
0
0
0
0
CRC02
1
CRC01
0
CRC00
1
CRC0
CR00 as capture register
Captures valid edge of TI01/P04 pin to CR00.
CR01 as capture register