Special Use Of Tm0N; Rewriting Cr01N During Tm0N Operation; Setting Lvs0N And Lvr0N - NEC 78K0 Series User Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

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.
µ
Remark n = 0:
PD78F0531, 78F0532, 78F0533
µ
n = 0, 1:
PD78F0534, 78F0535, 78F0536, 78F0537, 78F0537D
CHAPTER 7 16-BIT TIMER/EVENT COUNTERS 00 AND 01
LVS0n
LVR0n
0
0
0
1
1
0
1
1
Preliminary User's Manual U17260EJ3V1UD
Timer Output Status
Not changed (low-level output)
Cleared (low-level output)
Set (high-level output)
Setting prohibited
239

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents