8XC51FXHARDWARE DESCRIPTION
6.7
Pulse Width Modulator Mode
Any or all of the five PCA modules can be pro-
p~
to be
a PukeWidth Modulator.
The
PWM
output can be used to convert digital data to an analog
signal by simple externalcircuitry. The frequencyof the
PWM depends on the clock sources for the PCA timer.
With a 16 MHz crystal the maximum frequency of the
PWM waveform is 15.6 KHz.
The PCA generates8-bit PWMS by comparing the low
byte of the PCA timer (CL) with the low byte of the
module's compareregisters(CCAPnL). Refer to Figure
20. When CL < CCAPnL the output is low. When CL
> CCAPnL the output is high. The value in CCAPnL
controls the duty cycle of the waveform. To change the
value in CCAPnL without output glitches, the user
must write to the high byte register (CCAPrsH). This
value is then shifted by hardware into CCAPnL when
CL rolls over from 01%-I to WIHwhich correspondsto
the next period of the output.
wDSS
PCA
1
I
I* I
x
KO144
o
I
o
I
1
I
x
I
o
I
x
I
CC4PM4 MODEREOISTER
RSsEl
WRm TO
CCAP4L
,, ,,
0
WRm
m
CCAP4H
a
x = Don't Cere
,, ,,
1
270653-16
Figure 19. Watchdog Timer Mode
&
CCAPnH
CL MADE
rrmoo
IRANSlllDN
"o,,
[
t
CL < CC4PnL
CL
8-Slf
rnMpARA70R
CL= ~PnL
~
CESnPIN
WBLE
,, ,,
1
n = O, 1, 2, 3 w 4
x = Don'tCere
=
Cf2.APMn MOE REOUSXR
270653-17
I
Figure 20. PCA 6-Bit PWM Mode
5-26
Need help?
Do you have a question about the MCS 51 and is the answer not in the manual?