![Dallas DS87C550 User Manual Supplement Download Page 91](http://html1.mh-extra.com/html/dallas/ds87c550/ds87c550_user-manual-supplement_3298646091.webp)
DS87C550 High-Speed Microcontroller User’s Guide Supplement
91 of 93
PWM0 PULSE GENERATOR
: Figure PWM3.
TO
PWMO0
PIN
OUTPUT
CONTROL
RS
FLIP
FLOP
S
R
Q
MATCH
COMPARATOR
ZERO
COMPARATOR
COMPARE
VALUE
8-BIT COUNTER
PWM0
SFR
PW01CON
SFR
FROM
PWM0
CLOCK
GENERATOR
P
W
0
D
C
P
W
0
O
E
PW0T/C
The user supplied value contained in the PWMx register is reloaded into the compare value register when
there is a match between the counter and the value. This means that changing the value of PWMx more
frequently than once every 256 PWM-Clocks will have no effect. This prevents software from creating
“glitches” in the PWM output.
The PWMx registers also provide a means to read or write the value of the associated 8-bit counter. When
the bits PW0T/C (PW01CON.4), PW1T/C (PW01CON.0), PW2T/C (PW23CON.4), or PW3T/C
(WP23CON.0) are cleared (reset default condition), reading or writing the associated PWMx register
accesses the PWM user supplied comparison value. When these bits are set, reading or writing the
associated PWMx register accesses the Pulse Generator’s 8-bit counter. If it is important that the first
cycle of the PWM have precisely correct timing, then this feature may be used to initialize the 8-bit
counter to zero.
The rollover condition of the Pulse Generator from 0FFh to 00h is detected and causes the PWM output
to be set as described previously. This condition also causes the corresponding flag bit PW0F
(PW01CON.7), PW1F (PW01CON.3), PW2F (PW23CON.7), or PW3F (PW23CON.3) to be set
providing a means for software to determine when the rollover occurs. Software is the only mechanism to
clear these bits once they are set.
The outputs of the PWM channels share pins with parallel I/O port pins. To enable the PWM channel’s
output, the corresponding PWM Output Enable bit must be set. These enable bits PW0OE
(PW01CON.5), PW1OE (PW01CON.1), PW2OE (PW23CON.5), and PW3OE (PW23CON.1) are all
cleared by reset, and must be set before using the PWM outputs.
16-Bit PWM Mode
The four 8-bit PWM functions offer the unique ability to be cascaded into two 16-bit PWM functions. By
setting PWE0 (PWMADR.0) or PWE1 (PWMADR.1), 16-bit mode is enabled for PWM0 or PWM1
respectively. Note that the 16-bit PWM function called PWM1 is actually a concatenation of resources
from 8-bit PWM2 and PWM3 functions. As an example, the output pin of 16- bit PWM1 is PWMO2,
which is normally the output pin for 8-bit PWM2. This relationship is true for a number of registers and
bits used in the 16-bit PWM1 function. For 16-bit PWM0, the output pin will be PWMO0 as would be
expected. These differences will be detailed in the following discussion.