Table 18.4B Start And Stop Bit Functions; Table 18.4C Operating State Indicator Bit Functions - 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
(5) Starting and Stopping the Timer and Pulse Width Count
Starting, restarting, and forcibly halting each operation is performed using bits 15 and 14 (STRT and
STOP) of PWCSR. Writing "0" to the STRT bit starts or restarts operation and writing "0" to the STOP bit
forcibly halts operation. However, neither bit performs its operation if the values written to the two bits are
contradictory. When using instructions other than bit manipulation instructions (byte or larger instructions),
only write the following bit combinations.
Start or restart timer or pulse width count.
Forcibly halt timer or pulse width count.
When using a bit manipulation instruction (clear bit instruction), writing of the above combinations is
enforced automatically by hardware so no particular care is required.
(a) Operation After Starting
Timer mode: ...................... The count operation starts immediately.
Pulse width count mode: ... The count does not start until the count start edge is input.
(b) Restarting the Timer
Re-applying the start command (writing "0" to the STRT bit) while the timer is still operating after start-
ing in timer mode or pulse width count mode is called restarting. The operation performed for a restart
depends on the mode, as follows.
Single-shot timer mode: .... No effect on the operation.
Reload timer mode:........... Performs a reload and continues operation.
Pulse width count mode: ... Has no effect on the operation if the timer is waiting for the count start
(c) Stopping the Timer
In single-shot timer mode or single-shot count mode, the count halts automatically when the timer
overflows or the count ends and therefore you do not need to explicitly stop the timer. However, you
must forcibly stop the timer in other modes or if you wish to stop the timer before it halts automatically.
(d) Checking the Operating State
The STRT and STOP bits described previously function as indicator bits for the operating state of the
timer when read. The table below lists the bit meanings.
STRT
0
1
The STRT and STOP bits both have the same value when read. However, as the bits always have the
value "1
" when read by read-modify-write instructions (such as bit manipulation instructions), do not
B
use these instructions to read the bit values.
256
Chapter 18: Pulse Width Counter (PWC) Timer

Table 18.4b Start and Stop Bit Functions

Function
After detecting the count start edge, the 16-bit up-count timer is cleared
to 0000
If the restart occurs at the same time as an overflow, the overflow flag
(OVIR) is set and the POUT bit inverted.
edge.
If applied during a count, the count halts and the timer returns to the
"waiting for a count start edge" state. If the restart occurs at the same
time as a count end edge is detected, the count end flag (EDIR) is set
and, in continuous count mode, the count result is transferred to PWCR.

Table 18.4c Operating State Indicator Bit Functions

STOP
0
The timer is stopped (other than when waiting for a count start edge).
Indicates that the timer has not been started or that counting has ended.
1
The timer is counting or waiting for a count start edge.
STRT
STOP
0
1
and counting starts.
H
Operating State
1
0
MB90580 Series

Advertisement

Table of Contents
loading

This manual is also suitable for:

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

Table of Contents