CHAPTER 10 PWC (Pulse Width Count: Pulse Width Measurement)
In any mode, after a measurement is started, the counter does not perform a count operation until a
measurement start edge is inputted. When the measurement start edge is inputted, the counter is cleared to
"0000
", and then continues the up count per count clock until a measurement end edge is inputted.
H
When the measurement end edge is inputted, the following operation occurs.
1. Measurement ending flag (EDIR) in PWCSR is set.
2. Stop the counter count operation. (Except in case that a restart occurs simultaneously.)
3. In continuous measurement mode: A counter value (count result) is transferred to PWCR, stops the
4. In single measurement mode:
When all edge-to-edge pulse width count or a cycle measurement in continuous mode is performed, the end
edge is used as the next measurement start edge.
●
Minimum input pulse width
The following restrictions apply to the pulse that can be inputted to the pulse width count input pin (PWI1,
PWI0).
Minimum input width: More than machine cycle × 4
If the pulse whose width is smaller than the above pulse width is inputted, the operation will be
unpredictable.
●
Calculation method of pulse width/cycle
After the measurement ends, the pulse width/cycle to be counted can be calculated from the data of the
measurement result obtained in PWCR.
= n × t / D
T
W
198
counting until the next measurement start edge is inputted.
End the measurement. (Except in case that a restart occurs
simultaneously.)
(more than 0.25 µs if the machine clock is 16 MHz)
T
: Pulse width to be measured/cycle (µs)
W
n : Measurement result data in PWCR
t : Count clock cycle (µs)
[µs]
IV
D
: Division ratio selected by the division ratio register PDIVR
IV
(Substitute "1" in a mode other than the division cycle
measurement mode.