CHAPTER 6 16-BIT TIMER/EVENT COUNTER
117
6.5.2 PWM output operations
By setting bits 1 to 3 (TMC01 to TMC03) of the 16-bit timer mode control register (TMC0) to 1, 0, and 0, they are
operated as PWM output. Pulses with the duty rate determined by the value set in 16-bit compare register (CR00)
beforehand are output from the TO0/P30 pin.
Set the active level width of the PWM pulse to the high-order 14 bits of CR00. Select the active level with bit 1
(TOC01) of the 16-bit timer output control register (TOC0).
This PWM pulse has a 14-bit resolution. The pulse can be converted to an analog voltage by integrating it with
an external low-pass filter (LPF). The PWM pulse has a combination of the basic cycle determined by 2
8
/
φ
and the
sub-cycle determined by 2
14
/
φ
so that the time constant of the external LPF can be shortened. Count clock
φ
can
be selected with bits 4 to 6 (TCL04 to TCL06) of the timer clock select register 0 (TCL0).
PWM output enable/disable can be selected with bit 0 (TOE0) of TOC0.
Cautions
1. PWM operation mode should be selected before setting CR00.
2. Be sure to write 0 to bits 0 and 1 of CR00.
3. Do not select PWM operation mode for external clock input from the TI0/P00 pin.
By integrating 14-bit resolution PWM pulses with an external low-pass filter, they can be converted to an analog
voltage and used for electronic tuning and D/A converter applications, etc.
The analog output voltage (V
AN
) used for D/A conversion with the configuration shown in Figure 6-12 is as follows.
compare register (CR00) value
V
AN
= V
REF
×
2
16
V
REF
: External switching circuit reference voltage
Figure 6-12. Example of D/A Converter Configuration with PWM Output
V
REF
PD78044F
μ
PWM
signal
TO0/P30
Switching
circuit
Low-pass filter
Analog output (V
AN
)