155
Chapter 7 Timer/Counter Units
7
Fig. 7-61 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
external interrupt request (INTP0) input pin is measured.
A pulse signal applied to the INTP0 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-62, the value of 8-bit timer 1 (TM1) in count operation is loaded and held in the CR11 capture/
compare register specified as a capture register on a valid edge (either a rising edge or falling edge) of a signal
applied to the INTP0 pin. The pulse width of the input signal is found by multiplying the count clock (X/fCLK:
X = 16, 32, 64, 128, 256, 512) by the difference between the TM1 count value (Dn) loaded and held in the CR11
register on the n-th valid edge detected and the TM1 count value (Dn-1) loaded and held in the CR11 register
on the (n 1)-th valid edge detected.
Fig. 7-63 shows the setting of control registers, and Fig. 7-64 shows the setting procedure.
Interval timer (2)
Set count value in CR11 register
Set CRC1 register
Start counting ; Sets bit 3 of TMC1 to 1
INTC11 interrupt
CE11
CRC108H
CR11n
Set PRM1 register