Datasheet
78K0/Ix2 CHAPTER 7 16-BIT TIMER/EVENT COUNTER 00
R01UH0010EJ0500 Rev.5.00 316
Feb 28, 2012
7.5 Special Use of TM00
7.5.1 Rewriting CR010 during TM00 operation
In princip
le, rewriting CR000 and CR010 of the 78K0/Ix2 microcontrollers when they are used as compare registers is
prohibited while TM00 is operating (TMC003 and TMC002 = other than 00).
However, the value of CR010 can be changed, even while TM00 is operating, using the following procedure if CR010 is
used for PPG output and the duty factor is changed. (When changing the value of CR010 to a smaller value than the
current one, rewrite it immediately after its value matches the value of TM00. When changing the value of CR010 to a
larger value than the current one, rewrite it immediately after the values of CR000 and TM00 match. If the value of CR010
is rewritten immediately before a match between CR010 and TM00, or between CR000 and TM00, an unexpected
operation may be performed.).
Procedure for changing value of CR010
<1> Disable interrupt INTTM010 (TMMK010 = 1).
<2> Disable reversal of the timer output when the value of TM00 matches that of CR010 (TOC004 = 0).
<3> Change the value of CR010.
<4> Wait for one cycle of the count clock of TM00.
<5> Enable reversal of the timer output when the value of TM00 matches that of CR010 (TOC004 = 1).
<6> Clear the interrupt flag of INTTM010 (TMIF010 = 0) to 0.
<7> Enable interrupt INTTM010 (TMMK010 = 0).
Remark For TMIF010 and TMMK010, refer to CHAPTER 18 INTERRUPT FUNCTIONS.
7.5.2 Setting LVS00 and LVR00
(1)
Usage of LVS00 and LVR00
LVS00 and LVR00 are used to set the default value of the TO00 output and to invert the timer output without enabling
the timer operation (TMC003 and TMC002 = 00). Clear LVS00 and LVR00 to 00 (default value: low-level output)
when software control is unnecessary.
LVS00 LVR00 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