(2) Pulse Width Count Function
This function counts the time period between specified events on an input pulse.
After the function is activated, the count does not start until the specified count start edge is input. The
counter is cleared to "0000
the end edge is detected. The count value at the end of this period is stored in the register as the pulse
width.
An interrupt request can be generated when the count ends or when an overflow occurs. After counting
completes:
•
Single-shot count mode: ... Operation halts.
•
Continuous count mode: ... The timer value is transferred to the buffer register and the count halts
Pulse being counted
on the PWC0 to 3 inputs
Timer count value
FFFF
0000
Figure 18.4c Pulse Width Count Operation (Single-Shot Count Mode, "H" Width Count Mode)
Pulse being counted
on the PWC0 to 3 inputs
Timer count value
FFFF
0000
Figure 18.4d Pulse Width Count Operation (Continuous Count Mode, "H" Width Count Mode)
MB90580 Series
" and counting starts when the start edge is detected. The count halts when
H
until the next start edge is input.
⇓
H
Timer clear
H
Timer start
Count start
EDIR flag set (count end)
⇓
H
Timer clear
H
Timer start
Count start
EDIR flag set (count end)
⇓
⇓
Timer stop
⇓
⇓
⇓
Data transferred
⇓
to PWCR
Timer clear
Timer start
Timer stop
⇓
Chapter 18: Pulse Width Counter (PWC) Timer
(The solid line is the timer count value.)
⇓
(The solid line is the timer count value.)
⇓
Overflow
Data transferred
⇓
to PWCR
OVIR flag set
Timer stop
⇓
EDIR flag set
18.4 Operations
Time
Time
253