Starting And Stopping The Timer And Pulse-Width Measurement And Clearing The Timer - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

16.6.2
Starting and Stopping the Timer and Pulse-width
Measurement and Clearing the Timer
To start, restart, and forcibly stop the timer and pulse-width measurement, use the
PWCSH0/PWCSH1:STRT and PWCSH0/PWCSH1:STOP.
The 16-bit up-count timer is cleared to "0000
edge is detected and the count is started in the pulse-width measurement mode.
■ Starting and Stopping Timer and Pulse-width Measurement
Writing "0" to the PWCSH0/PWCSH1:STRT bit starts or restarts the operation, and writing "0" to the
PWCSH0/PWCSH1:STOP bit stops the operation. However, unless the value is written to these two bits
are different, none of the bits executes operations. If an instruction (byte or word instruction) other than the
bit manipulation instruction is being used, a value is written to the following bit combinations only.
Table 16.6-2 Pulse-width Measurement Operation
Starts and restarts the timer or pulse-width measurement
Stops the timer or pulse-width measurement
If a bit manipulation instruction (clear bit instruction) is being used, the hardware automatically writes the
above combination of values. The user need not know which value is to be written.
Operation after start
Timer mode: The count operation is started immediately.
Pulse-width measurement mode: Measurement is started after the measurement start edge is input. After
the measurement start edge is detected, the 16-bit up-count timer is cleared to "0000
started.
Restarting the timer
While the timer operation continues after the timer is started in the timer mode or pulse-width measurement
mode, starting the start (writing "0" to the PWCSH0/PWCSH1:STRT bit) is called timer restart. The
operations to be executed during restart are dependent on the following modes:
One-shot mode: The operation is not affected.
Reload timer mode: Reload is executed and the operation is continued. If the timer is restarted when an
overflow occurs, the overflow flag (PWCSH0/PWCSH1:OVIR) is set and the POUT bit is reversed.
Pulse-width measurement mode: In the measurement start edge wait state, the operation is not affected.
During measurement, the count stops and the timer state returns to the "measurement start edge wait" state.
When the timer is restarted on termination of measurement, the measurement termination flag (PWCSH0/
PWCSH1:EDIR) is set and the measurement results are transferred to PWC0/PWC1 in continuous
measurement mode.
(Single Measurement Mode, H-width Measurement Mode)
Function
" at reset and when the measurement start
H
CHAPTER 16 PWC Timer
STRT
STOP
0
1
1
0
" and the count is
H
451

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents