![Dallas DS87C550 User Manual Supplement Download Page 88](http://html1.mh-extra.com/html/dallas/ds87c550/ds87c550_user-manual-supplement_3298646088.webp)
DS87C550 High-Speed Microcontroller User’s Guide Supplement
88 of 93
SECTION 19: PULSE WIDTH MODULATION
Some members of the High-Speed Microcontroller family incorporate Pulse Width Modulation (PWM)
capability. When incorporated, there are four independent 8-bit channels provided, each of which can
operate at a different repetition rate and with an independent pulse width setting. For more precise PWM
requirements, two 8-bit PWM channels can be combined into one 16-bit PWM channel. For 16-bit
operation, channels PWM0 and PWM1 are combined and/or PWM2 and PWM3 are combined. As shown
in Figure PWM1, each channel of PWM can accept any one of four clock signals derived from the
processor’s machine cycle clock, or an externally generated clock available on the PWMC0 or PWMC1
pins. These two PWM external clock input pins are distributed to the four channels as shown. Each PWM
channel has its own output pin that is a second function for one of the processor’s parallel I/O pins.
The PWM function is divided into three functional modules: the prescaler, the Clock Generator, and the
Pulse Generator. Each of these modules is described in detail below.
PWM Block Diagram (8-Bit Mode) :
Figure PWM1.
PRESCALER
/1
/4
/16
/64
PWM 0
PULSE GENERATOR
PWM 1
PULSE GENERATOR
PWM 2
PULSE GENERATOR
PWM 3
PULSE GENERATOR
PWMO0
PIN
(8 or 16-BIT)
PWMO1
PIN
(8-BIT only)
PWMO2
PIN
(8 or 16-BIT)
PWMO3
PIN
(8-BIT only)
SYSTEM
CLOCK
PWMC0
PIN
PWMC1
PIN
PWM 0
CLOCK GENERATOR
PWM 1
CLOCK GENERATOR
PWM 2
CLOCK GENERATOR
PWM 3
CLOCK GENERATOR
For 16-Bit Operation
For 16-Bit Operation
LSB
MSB
LSB
MSB
PRESCALER
There is a single prescaler that divides the machine cycle clock by 1, 4, 16, or 64, and each of these
outputs is available to all four PWM channels simultaneously. Since the machine cycle clock is an integer
division of the crystal oscillator (or external clock source connected to XTAL1), and this division factor
is determined by the user’s setting of CD1: 0 and
X
2
/
X
4
, then these bits will also affect the frequency of
operation of the PWM channels as well. The selection of one of the four clock sources available as
outputs from the prescaler or one of the externally supplied clocks is made individually, channel by
channel with the PW0S2:0 (PW01CS7:5), PW1S2:0 (PW01CS3:1), PW2S2:0 (PW23CS7:5), and
PW3S2-0 (PW23CS3:1) bits in SFRs.
CLOCK GENERATOR
As shown in Figure PWM1, the four clock outputs available from the prescaler are all provided to each of
the four Clock Generator modules along with the two external PWM clock inputs. The Clock Generator
modules simply select one of the available clocks, use this selection to clock an 8-bit auto-reload counter,
and provide the output of this counter to the Pulse Generator module. The logical behavior of PWM0’s
Clock Generator module is shown in Figure PWM2. All other Clock Generators operate in the same way.