CHAPTER 7 16-BIT TIMER/EVENT COUNTERS 00 AND 01
Preliminary User’s Manual U17260EJ3V1UD
239
7.5 Special Use of TM0n
7.5.1 Rewriting CR01n during TM0n operation
In principle, rewriting CR00n and CR01n of the 78K0/KE2 when they are used as compare registers is prohibited
while TM0n is operating (TMC0n3 and TMC0n2 = other than 00).
However, the value of CR01n can be changed, even while TM0n is operating, using the following procedure if
CR01n is used for PPG output and the duty factor is changed (change the value of CR01n immediately after its value
matches the value of TM0n. If the value of CR01n is changed immediately before its value matches TM0n, an
unexpected operation may be performed).
Procedure for changing value of CR01n
<1> Disable interrupt INTTM01n (TMMK01n = 1).
<2> Disable reversal of the timer output when the value of TM0n matches that of CR01n (TOC0n4 = 0).
<3> Change the value of CR01n.
<4> Wait for one cycle of the count clock of TM0n.
<5> Enable reversal of the timer output when the value of TM0n matches that of CR01n (TOC0n4 = 1).
<6> Clear the interrupt flag of INTTM01n (TMIF01n = 0) to 0.
<7> Enable interrupt INTTM01n (TMMK01n = 0).
Remark
For TMIF01n and TMMK01n, see
CHAPTER 19 INTERRUPT FUNCTIONS
.
7.5.2 Setting LVS0n and LVR0n
(1) Usage of LVS0n and LVR0n
LVS0n and LVR0n are used to set the default value of the TO0n pin output and to invert the timer output without
enabling the timer operation (TMC0n3 and TMC0n2 = 00). Clear LVS0n and LVR0n to 00 (default value: low-
level output) when software control is unnecessary.
LVS0n
LVR0n
Timer Output Status
0
0
Not changed (low-level output)
0
1
Cleared (low-level output)
1
0
Set (high-level output)
1 1
Setting
prohibited
Remark
n = 0:
µ
PD78F0531, 78F0532, 78F0533
n = 0, 1:
µ
PD78F0534, 78F0535, 78F0536, 78F0537, 78F0537D