Operation In Pulse Width Measurement Mode - Fujitsu MB90480 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 25 PWC TIMER (ONLY MB90485 SERIES)

25.5.6 Operation in Pulse Width Measurement Mode

This section describes operation in pulse width measurement mode.
One-Shot measurement and repeated measurement
There are two modes for pulse width measurement: a mode for one-time measurement and a
mode for repeated measurement. The mode to use is selected via the PWCSR: S/C bit (Refer
to Section "25.5.3 Selection of Count Clock and Operation Mode").
❍ One-Shot Measurement Mode
As soon as the first measurement end edge is detected, the timer counter will stop and the
measurement end interrupt request flag (EDIR) in the PWCSR is set, causing a stop of
measurement (however, if restart occurs at the same time, the device will wait for measurement
to start again).
❍ Repeated measurement mode
If a measurement end edge is detected, the timer counter stops, the PWCSR's measurement
end interrupt request flag (EDIR) is set, and counting stops until the next measurement start
edge is detected. As soon as the next measurement start edge is detected, the timer is cleared
to 0000
H
of the timer is transferred to the PWCR.
Note:
Be sure to change the measurement mode only while the timer is stopped.
Measurement result data
One-shot measurement mode and repeated measurement mode differ in handling of the
measurement result, timer values, and PWCR functions. Measurement results in both modes
are as follows:
❍ In one-shot measurement mode
The timer value while measurement is in progress can be obtained by reading the PWCR.
The end result data of measurement can be obtained by reading the PWCR after measurement
has ended.
❍ In repeated measurement mode
At the end of measurement, the timer measurement result is transferred to the PWCR.
Reading the PWCR will return the immediately previously obtained measurement result,
because the previous measurement result is kept during the measurement operation. The
timer value while measurement is in progress cannot be read.
In this mode, if a measurement result is not read out before the next measurement operation
ends, the measurement result will be overwritten with the next measurement result. In this case,
an error flag (ERR) in the PWCSR is set. The error flag (ERR) is automatically cleared by
reading the PWCR.
540
, and measurement starts again. At the end of measurement, the measurement result

Advertisement

Table of Contents
loading

Table of Contents