Operation As Pwm Output - NEC uPD784038 Series User Manual

16-bit single-chip microcontrollers
Table of Contents

Advertisement

Figure 8-40 Interrupt Request Servicing that Calculates Pulse Width
8.8.4

Operation as PWM Output

In PWM output, pulses with the duty ratio determined by the value set in the compare register (CR0n: n = 0, 1) are output
(see Figure 8-41).
This PWM output duty ratio can be varied in the range 1/65,536 to 65,535/65,536 in 1/65,536 units.
Since timer register 0 (TM0) has two compare registers, two different PWM signals can be output.
The control register settings are shown in Figure 8-42, the setting procedure in Figure 8-43, and the procedure for varying
the duty in Figure 8-44.
TM0
Count Value
TO0
(When Active-Low)
230
CHAPTER 8 TIMER/COUNTER 0
INTP3 interrupt
Calculate pulse width
Y
Store capture value in memory
Figure 8-41 Example of Timer/Counter 0 PWM Signal Output
CR00
0H
Timer Start
User's Manual U11316EJ4V1UD
= CR02 – X
n
n
← CR02
X
n + 1
RETI
FFFFH
FFFFH
CR00
FFFFH
CR00

Advertisement

Table of Contents
loading

Table of Contents