Figure 8.6A Pulse Width Measurement Function Settings; Figure 8.6B Example Of "H" Width Measurement Using Pulse Width Measurement Function - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

6
8.
Operation of Pulse Width Measurement Function
This section describes the operations of the pulse width measurement function of the
pulse width count timer.
n Operation of Pulse Width Measurement Function
Figure 8.6a shows the settings required to operate as the pulse width measurement function.
When counter operation is enabled, the counter starts counting-down from "FF
measurement start edge is detected on the pulse input to the PWC pin. (For "H" width
measurement, the counter starts measurement from the next rising edge if the input is already
"H".)
On detection of the measurement completion edge, the current down-counter value is
transferred to the PWC reload buffer register (RLBR), the measurement completion interrupt
request flag bit (PCR1: IR) and buffer-full flag bit (PCR1: BF) are both set to "1", and counter
operation is re-enabled. (The function supports continuous pulse width measurement and so
can be used like an input capture.)
Figure 8.6b shows the operation when the measured pulse selection bits (PCR2: W1, W0) are
set to "00
(input waveform to the PWC pin)
Counter value

Figure 8.6b Example of "H" Width Measurement Using Pulse Width Measurement Function

Check: • If the previous RLBR register value has not been read during continuous pulse width
172
CHAPTER 8 PULSE WIDTH COUNT TIMER (PWC)
Bit 7
DDR3
×
PCR1
EN
1
PCR2
FC
1
PLBR

Figure 8.6a Pulse Width Measurement Function Settings

" ("H" width measurement).
B
Input pulse
FF
H
EN bit
IR bit
BF bit
measurement, the PWC leaves the BF bit set to "1" and maintains the previous measurement
value. In this case, the new measurement value is lost.
• Do not modify the PCR2 register during pulse width measurement (PCR1: EN = "1").
Bit 6
Bit 5
Bit 4
Bit 3
×
×
×
0
TOE
IE
×
RM
TO
C1
×
×
Holds the pulse width measurement value.
"H" width
Counter operation
Data transferred from down-
counter to RLBR
Bit 2
Bit 1
Bit 0
×
×
×
UF
IR
BF
C0
W1
W2
× : Unused bit
1 : Set "1".
0 : Set "0".
" when a
H
Time
Cleared by the program
RLBR read
MB89620 series
: Used bit
: Used to
measure long
pulse widths

Advertisement

Table of Contents
loading

Table of Contents