English
Language : 

UPD784938 Datasheet, PDF (259/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 9 TIMER/EVENT COUNTER 0
9.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 9-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 counter 0 (TM0) has two compare registers, two different PWM signals can be output.
The control register settings are shown in Figure 9-42, the setting procedure in Figure 9-43, and the procedure for varying
the duty in Figure 9-44.
Figure 9-41. Example of Timer/Event Counter 0 PWM Signal Output
TM0
count value
CR00
0H
Timer start
TO0
(When active-low)
FFFFH
CR00
FFFFH
CR00
FFFFH
Figure 9-42. Control Register Settings for PWM Output Operation
(a) Capture/compare control register 0 (CRC0)
7
6
5
4
3
2
1
0
CRC0 1
0
0
1
0
0
0
0
TM0 clearing disabled
TO0 & TO1 both PWM outputs
(b) Timer output control register (TOC)
7
6
5
4
3
2
1
0
TOC
×
×
×
×
×
×
1
1
TO0 = active-low PWM signal output
TO0 PWM output enabled
(c) Port 3 mode control register (PMC3)
7
6
5
4
3
2
1
0
PMC3 ×
×
×
1
×
×
×
×
P34 pin set as TO0 output
Preliminary User’s Manual U13987EJ1V0UM00
259