Timer Mode Operation - Fujitsu F2MC-16LX Hardware Manual

Mb90470 series 16-bit microcontroller
Hide thumbs Also See for F2MC-16LX:
Table of Contents

Advertisement

CHAPTER 14 PWC TIMER

14.3.5 Timer Mode Operation

This section describes the device operation in timer mode.
I Clearing the timer
In the following cases, the 16-bit up-count timer is cleared to 0000
At reset
If, in pulse width measurement mode, a measurement start edge is detected and counting
starts
I One-shot operation mode
In one-shot operation mode, the timer count is incremented with every count clock pulse after
timer start. If an overflow occurs while incrementing from FFFF
automatically stops. If the PWCR is set to any value before timer start, counting will start with
that value. In this case, the value that was previously set will not be preserved, and the PWCR
value will always indicate the current count value.
I Reload operation mode
In reload operation mode, the timer is set to the reload value stored in PWCR, and the timer will
be incremented with every count clock pulse after the timer starts. If an overflow occurs while
incrementing from FFFF
timer (reload operation), and counting will be repeated from that value. The timer does not stop
until it is forcibly stopped due to writing the PWCSR: STOP bit, or due to a reset. The value set
in the PWCR before the timer starts is retained during counting as a reload value, and will be
loaded into the timer if a start/restart or an overflow occurs. If the value that is set in the PWCR
changes during counting, this new, changed reload value will be used at the next overflow or
timer restart.
I Timer value and reload value
In one-shot operation mode, the PWCR is directly accessed by the up-count timer. Any value
written to the PWCR will also be written to the timer as is. When reading the PWCR while the
timer is in progress, the value of the current timer count will be returned. If any value is set to
the PWCR before the timer starts, counting will start from this value. In reload operation mode,
accessing the count-up timer is prohibited. The PWCR operates as a reload register that stores
a reload value. If a start/restart/overflow occurs, the timer is always set to the value stored in the
PWCR. When reading the PWCR, the stored reload value will be returned.
If the timer is placed in one-shot operation mode after the reload operation mode is forcibly
canceled, the PWCR value and timer value are not specified. Be sure to always specify these
values before using the timer.
I Interrupt generation request
In timer mode, an interrupt request may be generated due to a timer overflow. If an overflow
occurs due to incrementing the counter, the overflow flag is set and an overflow request is
generated, if such requests are allowed.
292
to 0000
, the reload value in PWCR will be loaded again into the
H
H
:
H
to 0000
, the timer
H
H

Advertisement

Table of Contents
loading

Table of Contents