CHAPTER 7 8-BIT TIMERS 50, 60, AND 61
User’s Manual U15331EJ4V1UD
158
7.4.5 PPG output mode operation (timer 60 and timer 61)
In the PPG output mode, a pulse of any duty ratio can be output by setting a low-level width using CR6m and a
high-level width using CRH6m.
To operate timer 6m in PPG output mode, settings must be made in the following sequence.
<1> Disable operation of TM6m (TCE6m = 0).
<2> Disable timer output of TO6m (TOE6m0 = 0).
<3> Set count values in CR6m and CRH6m.
<4> Set the operation mode of timer 6m to the PPG output mode (see Figures 7-7 and 7-9).
<5> Set the count clock for timer 6m.
<6> When using timer 60, set P31 to output mode (PM31 = 0) and the P31 output latch to 0, respectively.
When using timer 61, set P32 to output mode (PM32 = 0) and the P32 output latch to 0, respectively.
<7> Enable timer output of TO6m (TOE6m0 = 1).
<8> Enable the operation of TM6m (TCE6m = 1).
The operation in the PPG output mode is as follows.
<1> When the count value of TM6m matches the value set in CR6m, an interrupt request signal (INTTM6m) is
generated and output of timer 6m is inverted, which makes the compare register switch from CR6m to
CRH6m.
<2> A match between TM6m and CR6m clears the TM6m value to 00H and then counting starts again.
<3> After that, when the count value of TM6m matches the value set in CRH6m, an interrupt request signal
(INTTM6m) is generated and output of timer 6m is inverted again, which makes the compare register switch
from CRH6m to CR6m.
<4> A match between TM6m and CRH6m clears the TM6m value to 00H and then counting starts again.
A pulse of any duty ratio is output by repeating <1> to <4> above. Figures 7-29 and 7-30 show the operation timing
in the PPG output mode.
Remark m = 0, 1