194
µ
PD78214 Sub-Series
Fig. 7-102 Setting Procedure for Interval Timer Operation (2)
(3) Pulse width measurement operation
In pulse width measurement, the width of the high level or low level of an external pulse signal applied to the
INTP1 pin is measured.
A pulse signal applied to the INTP1 pin must have a pulse width of 12 system clock pulses (2
µ
s: fCLK = 6 MHz)
or more for both the high level and the low level. If the pulse width is less than this value, no valid edge can
be detected, thus resulting in a failure to perform capture operation.
As shown in Fig. 7-103, the value of 8-bit timer 2 (TM2) in count operation is loaded and held in the CR22
capture register on a valid edge (either a rising edge or falling edge) of a signal applied to the INTP1 pin. The
pulse width of the input signal is found by multiplying the count clock by the difference between the TM2 count
value (Dn) loaded and held in the CR22 register on the n-th valid edge detected and the TM2 count value (Dn-
1) loaded and held in the CR22 register on the (n 1)-th valid edge detected.
Fig. 7-104 shows the setting of control registers, and Fig. 7-105 shows the setting procedure.
Interval timer
Set count value in CR21 register
Set CRC2 register
Set TMC1 register ; Sets bit 7 of TMC1 to 1
Sets normal mode (CMD2 = 0)
INTC21 interrupt
CE21
CMD20
CRC218H
CR21n
Set PRM1 register