Table of Contents

Advertisement

Mnemonic
PWM0_CONTROL
1FB0H
PWM1_CONTROL
1FB2H
PWM_PERIOD
1FB4H
PWM_COUNT
1FB6H
WG_OUTPUT
1FC0H

10.3 PWM OPERATION

The period register (PWM_PERIOD) controls the output frequency of both PWM outputs. Each
control register (PWMx_CONTROL) controls the duty cycle (the pulsewidth stated as a percent-
age of the period) of the corresponding PWM output. Each control register contains an 8-bit value
that is loaded into a buffer when the 8-bit counter rolls over from 00H to FFH. The comparators
compare the contents of the buffers to the counter value. Since the value written to the control
register is buffered, you can write a new 8-bit value to PWMx_CONTROL at any time. However,
the comparators do not recognize the new value until the counter has expired the remainder of
the current 8-bit count. The new value is used during the next PWM output period.
Table 10-2. PWM Control and Status Registers
Address
PWM Duty Cycle
This register controls the PWM duty cycle. A zero loaded
into this register will cause the PWM to output a low
continuously (0% duty cycle). An FFH in this register will
cause the PWM to have its maximum duty cycle (99.6%
duty cycle).
PWM Period
This register holds a programmed value that determines
the output period of the PWM outputs. The value is
reloaded into the counter each time the count resets to
FFH.
PWM Counter
This read-only register contains the current value of the
decremented counter.
Waveform Generator Output
Bits 11 and 12 (PE6 and PE7) determine whether the
corresponding pin functions as a standard I/O port pin or
as a PWM output. Bits 6 and 7 (P6 and P7) define the pin
output when the port pin function is selected.
PE x
0
0
1
Get other manuals https://www.bkmanuals.com
PULSE-WIDTH MODULATOR
Description
P x
Pin Output
0
0
1
1
X
PWM Output
10-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

8xc196md8xc196mh

Table of Contents