Operation In Pulse Width Measurement Mode - Fujitsu F2MC-16LX Hardware Manual

Mb90470 series 16-bit microcontroller
Hide thumbs Also See for F2MC-16LX:
Table of Contents

Advertisement

14.3.6 Operation in Pulse Width Measurement Mode

This section describes operation in pulse width measurement mode.
I 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 14.3.3 "Selection of the 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 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 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
measurement starts again. At the end of measurement, the measurement result of the timer is
transferred to the PWCR.
Note:
Be sure to change the measurement mode only while the timer is stopped.
I 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.
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 WCSR is set. The error flag (ERR) is automatically cleared by reading the
PWCR.
CHAPTER 14 PWC TIMER
, and
H
295

Advertisement

Table of Contents
loading

Table of Contents