Timer Mode Operation - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

16.6.3

Timer Mode Operation

The timer mode includes the one-shot operation mode and reload operation mode.
■ One-shot Operation Mode
When the timer is started in this mode, a count is incremented at each count clock. The timer automatically
stops when an overflow occurs from FFFF
If PWC0/PWC1 is set before the timer has started, the count is started from this set value. After overflow,
the set value is deleted and the current count value remains in PWC0/PWC1.
PWCSH0/PWCSH1:POUT is reversed if an overflow occurs.
■ Reload Operation Mode
When the timer is started in this mode, the reload value in PWC0/PWC1 is set in the timer and the count is
incremented at each count clock. If an overflow occurs when the timer counts FFFF
value in PWC0/PWC1 is set in the timer again, the PWCSH0/PWCSH1:POUT bit is reversed, and the
count operation is repeated.
PWCSH1:STOP to stop the timer or it is reset. The port bit will output to pin PWO0/PWO1 if pulse output
mode is specified.
The reload value (set in PWC0/PWC1 before the timer is started) is stored during a count. When the timer
is started or restarted and an overflow occurs, the reload value is always set in the timer. If the value that is
set during a count is to be changed, a new reload value becomes valid when the next overflow occurs or the
timer is restarted.
■ Timer Value and Reload Value
In one-shot operation mode, direct access to PWC0/PWC1 accesses the up-count timer. When a value is
written to PWC0/PWC1, the value is written directly to the timer. When PWC0/PWC1 is read during a
count operation, the current timer value is read. If the value is set in PWC0/PWC1 before the timer is
started, the timer starts a count from the specified value.
In reload operation mode, the up-count timer cannot be accessed and PWC0/PWC1 functions as a reload
register (stores the reload value). When the timer is started or restarted and an overflow occurs, the value
written to PWC0/PWC1 is always set in the timer. When PWC0/PWC1 is read, the stored reload value is
read.
The PWC0/PWC1 value and timer value are undefined if the timer is set in one-shot mode after the
operation is discontinued in reload mode. Therefore, always set the values before the timer is used.
The PWC0/PWC1 value is undefined if the timer is set in reload mode after the operation is forcibly
discontinued in one-shot mode. Therefore, always set the value before the timer is used.
■ Interrupt Request Generation
During operation in timer mode, an overflow enables the generation of an interrupt request. If the
increment of a timer count causes an overflow, the overflow flag is set, an overflow interrupt request is
enabled, and an interrupt request is generated.
to 0000
.
H
H
The timer does not stop until a value is written to the PWCSH0/
CHAPTER 16 PWC Timer
to 0000
, the reload
H
H
453

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents