![NEC U789436 Series User Manual Download Page 174](http://html.mh-extra.com/html/nec/u789436-series/u789436-series_user-manual_249277174.webp)
CHAPTER 7 8-BIT TIMERS 50, 60
User’s Manual U15075EJ2V1UD
174
7.4.5 Operation as PWM output (timer 60)
In the PWM pulse generator mode, a pulse of any duty ratio can be output by setting a low-level width using CR60
and a high-level width using CRH60.
To operate timer 60 in PWM output mode, settings must be made in the following sequence.
<1> Disable operation of TM60 (TCE60 = 0).
<2> Disable timer output of TO60 (TOE60 = 0).
<3> Set count values in CR60 and CRH60.
<4> Set the operation mode of timer 60 to the PWM pulse generator mode (see
Figure 7-5
).
<5> Set the count clock for timer 60.
<6> Set P32 to the output mode (PM32 = 0) and the P32 output latch to 0 and enable timer output of TO60
(TOE60 = 1).
<7> Enable the operation of TM60 (TCE60 = 1).
The operation in the PWM output mode is as follows.
<1> When the count value of TM60 matches the value set in CR60, an interrupt request signal (INTTM60) is
generated and output of timer 60 is inverted, which makes the compare register switch from CR60 to
CRH60.
<2> A match between TM60 and CR60 clears the TM60 value to 00H and then counting starts again.
<3> After that, when the count value of TM60 matches the value set in CRH60, an interrupt request signal
(INTTM60) is generated and output of timer 60 is inverted again, which makes the compare register switch
from CRH60 to CR60.
<4> A match between TM60 and CRH60 clears the TM60 value to 00H and then counting starts again.
A pulse of any duty ratio is output by repeating <1> to <4> above. Figures 7-26 and 7-27 show the operation
timing in the PWM output mode.