Notes On Pwc Timer Usage - Fujitsu F2MC-16LX Hardware Manual

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

Advertisement

14.4 Notes on PWC Timer Usage

This section provides notes on using the PWC timer.
I Notes on PWC timer usage
❍ Notes on rewriting the register
Overwriting the bits in the PWCSR is prohibited. Rewrite the register either before the timer is
started or after the timer stops.
[Bits 7, 6] CKS1, CKS0 (clock selection)
[Bits 5, 4] PIS1, PIS0 (input signal selection)
[Bit 3] CKS1,CKS0 (clock selection)
[Bits 2, 1, 0] MOD2, MOD1, MOD0 (operation mode/measurement edge selection)
Rewriting DIVR during timer operation is prohibited. Rewrite it either before start or after stop
of timer operation.
❍ Handling the measurement end flag in timer mode
The value of the PWCSR's measurement end interrupt request flag (EDIR) is not significant in
timer mode. Consequently, set the PWCSR's measurement end interrupt request bit (EDIE) to
"0" if it is to be used in timer mode.
❍ Handling of STRT and STOP bits in the PWCSR
Note that the meaning of these two bits is different depending on whether a write or read
operation is performed (Refer to Section 14.2.1 "PWC Control/Status Register (PWCSR0 to
PWCSR2)"). The read value returned in read-modify-write instructions is always 11
irrespective of the value of these bits. Be sure, therefore, not to use bit operation instructions for
reading the operation state (these bits will always return "operation in progress"). However, bit
operation instructions (such as bit clear) can be used for writing the STRT and STOP bits to
start or stop the timer.
❍ Timer Clear
In pulse width measurement mode, the timer is cleared at the measurement start edge. The
timer data will therefore be invalid before the start of measurement.
❍ PWCR and timer values when the mode changes
If the timer is forcibly stopped and set to one-shot timer mode from reload timer mode, the
timer value and the timer value stored in the PWCR will become unspecified. Be sure to
define these values before using the timer.
If the timer is used in one-shot timer mode, the PWCR value is unspecified. Use the timer
only after defining the value.
To switch the mode from pulse width measurement mode to timer mode, specify the PWCR
value again before starting the timer.
CHAPTER 14 PWC TIMER
301
B

Advertisement

Table of Contents
loading

Table of Contents