Notes On Pwc Timer Usage - Fujitsu MB90480 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 25 PWC TIMER (ONLY MB90485 SERIES)

25.6 Notes on PWC Timer Usage

This section provides notes on using the PWC timer.
Notes on PWC timer usage
❍ Notes on rewriting the register
Rewriting the bits in the PWCSR is prohibited. Rewrite the register either before the timer is
started or after the timer stops.
[bit7, bit6] CKS1, CKS0 (clock selection)
[bit5, bit4] PIS1, PIS0 (input signal selection)
[bit3] CKS1,CKS0 (clock selection)
[bit2, bit1, bit0] 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 enable 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 "25.3.1 PWC Control/Status Register (PWCSR0 to
PWCSR2)"). The read value returned in read-modify-write instructions is always 11
irrespective of the value for 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 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.
546
B

Advertisement

Table of Contents
loading

Table of Contents