
137
μPD780948, μPD78F0948, μPD780949, μPD78F0949
7.4.3 Pulse width measurement
The 16-bit timer register (TM0) can be used to measure the pulse widths of the signals input to the TI00
and TI01 pins.
Measurement can be carried out with TM0 used as a free running counter or by restarting the timer in
synchronization with the edge of the signal input to the TI00 pin.
(1) Pulse width measurement with free running counter and one capture register
If the edge specified by the prescaler mode register 0 (PRM0) is input to the TI00 pin when the 16-bit
timer register (TM0) is used as a free running counter (refer to Figure 7-11), the value of TM0 is loaded
to the 16-bit capture/compare register 01 (CR01), and an external interrupt request signal (INTTM01) is
set.
The edge is specified by using bits 6 and 7 (ES10 and ES11) of the prescaler mode register 0 (PRM0).
The rising edge, falling edge, or both the rising and falling edges can be selected.
The valid edge is detected through sampling at a count clock cycle selected by the prescaler mode register
0n (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.
Figure 7-11: Control Register Settings for Pulse Width Measurement with Free Running Counter
and One Capture Register
(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/1
CRC00
0
CRC0
CR00 as compare register
CR01 as capture register