English
Language : 

PXD20RM Datasheet, PDF (1384/1628 Pages) Freescale Semiconductor, Inc – PXD20 Microcontroller
39.7.9 PWM Output
As an alternative to the I2S interface it is possible to have the output of one of the mixer channels act as
the source of the duty cycle of a PWM. The duty cycle of the PWM changes with each output sample and
the output signal can be filtered and integrated to provide a low cost DAC.
PWM channel
select
PWMCR.PWMF
MIXER Left Channel
M
MIXER Right Channel U
X
PWM
COUNTER
pwm_out
PWMOA
pwm_clk
PWMCR.TONF
SGMCTL.OS
TON CLOCK
Generator
composite_out
&
0
ton_clk
1
PWMO
Figure 39-59. PWM Block
The PWM output is designed to provide a simple digital output that can be filtered to reproduce the analog
output of either one of the mixer channels. Reproducing the highest quality sound is not possible for the
PWM due to the very high PWM frequencies that would be required. Therefore for most applications the
PWM is limited to a lower quality sound output. When the PWM output is enabled the I2S is disabled.
The mixed data values from either the left mixer or the right mixer are used as the count of the duty cycle
of the PWM (PWMCHS bit in Section 39.6.2.2, SGM Configuration Register (SGMCFG)). The total
length of the PWM count is defined by the PWMCR[PWMF] field and the frequency of the PWM is
defined by the PWM clock (Section 39.6.2.18, PWM Configuration Register (PWMCR)).
A 100% duty cycle (continually high) will be generated if the value of the mixed data is higher than the
PWMF count. The amplitude of the filtered output is determined by the duty cycle of the PWM. The
frequency of the output is decided by the channel sample rate.
The PWM frequency is generated by PWMF and the PWM clock. It can be calculated as:
fPWM = -----P----W-f--p---wM----m--F--c--l--k-+-----1----
The duty cycle of PWM signal is calculated as follows:
• If [Mixer_out] > [PWMF]: Duty cycle =100%
• If 0 › [Mixer_out] › [PWMF]: Duty cycle = [Mixer_out] / ([PWMF]+1)
39-60
PXD20 Microcontroller Reference Manual, Rev. 1
Preliminary—Subject to Change Without Notice
Freescale Semiconductor