Table 18.4E Count Input Pin Selection (N = 3 To 0) - Fujitsu F2MC-16LX MB90580 Series Hardware Manual

16-bit microcontrollers
Hide thumbs Also See for F2MC-16LX MB90580 Series:
Table of Contents

Advertisement

18.4 Operations
(8) Details of Pulse Width Count Mode Operation
(a) Count Input Pins and Pin Selection
The pins used to input the signal for pulse width counting are fixed as pin PWC0 for ch0, PWC1 for ch1,
PWC2 for ch2, and PWC3 for ch3. Always set bits 4 and 5 of PWCSR to "00" on the MB90580.
PIS1
0
0
1
1
Note: Only select or change the count input pin while the timer is halted.
(b) Single-Shot Counting and Continuous Counting
Pulse width count mode has a mode to perform a count once only and a mode to perform pulse width
counting continuously. The following lists the differences between the two modes.
Single-shot count mode: .. When the first count end edge is input, the timer stops counting, the
Continuous count mode: ... When a count end edge is input, the timer stops counting, the count end
The S/C bit in PWCSR selects the mode (see (3) Operation Mode Selection).
Note: Only select or change the count mode while the timer is halted.
Note: For any of the pulse width count modes used with continuous count mode, the divider circuit
for the internal count clock is not cleared when the count ends. Therefore, the result in contin-
uous count modes is the accumulated number of edges.
(c) Count Result Data
The handling of the count result and timer value and the function of PWCR differ for single-shot count
mode and continuous count mode. The differences are as follows.
Single-shot count mode: ... Reading PWCR during timer operation reads the current timer value.
Continuous count mode: ... The count result in the timer is transferred to PWCR when the count
In continuous count mode, if the previous count result is not read before the next count completes, the
new count result overwrites the old value. If this occurs, the error flag (ERR) in PWCSR is set. The error
flag (ERR) is automatically cleared when PWCR is read.
260
Chapter 18: Pulse Width Counter (PWC) Timer

Table 18.4e Count Input Pin Selection (n = 3 to 0)

PIS0
0
The PWCn pin for the channel (Initial value)
1
Setting unavailable
(Do not set any of these values.)
0
1
count end flag (EDIR) in PWCSR is set, and no further count is per-
formed.
(However, if a restart is specified at the same time, the timer goes to the
"waiting for a count start edge" state.)
flag (EDIR) in PWCSR is set, and the count remains stopped until the
next count start edge is input. When the next count start edge is input,
the timer is cleared to 0000
The count result in the timer is transferred to PWCR when the count
ends.
Reading PWCR after the count has ended reads the count result.
ends.
Reading PWCR reads the result of the previous count. PWCR continues
to store the previous count result while counting is in progress. The timer
value during counting cannot be read.
Count Input Pin Selection
and counting restarts.
H
MB90580 Series

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lx mb90v580F2mc-16lx mb90583F2mc-16lx mb90f583

Table of Contents