Datasheet

2013-2015 Microchip Technology Inc. DS40001723D-page 203
PIC12(L)F1571/2
22.0 16-BIT PULSE-WIDTH
MODULATION (PWM) MODULE
The Pulse-Width Modulation (PWM) module generates
a pulse-width modulated signal determined by the
phase, duty cycle, period and offset event counts that
are contained in the following registers:
PWMxPH register
PWMxDC register
PWMxPR register
PWMxOF register
Figure 22-1 shows a simplified block diagram of the
PWM operation.
Each PWM module has four modes of operation:
Standard
Set On Match
Toggle On Match
Center-Aligned
For a more detailed description of each PWM mode,
refer to Section 22.2 “PWM Modes”.
Each PWM module has four Offset modes:
Independent Run
Slave Run with Synchronous Start
One-Shot Slave with Synchronous Start
Continuous Run Slave with Synchronous Start
and Timer Reset
Using the Offset modes, each PWM module can offset
its waveform relative to any other PWM module in the
same device. For a more detailed description of the
Offset modes, refer to Section 22.3 “Offset Modes”.
Every PWM module has a configurable reload
operation to ensure all event count buffers change at
the end of a period, thereby avoiding signal glitches.
Figure 22-2 shows a simplified block diagram of the
reload operation. For a more detailed description of
the reload operation, refer to Section 22.4 “Reload
Operation”.
FIGURE 22-1: 16-BIT PWM BLOCK DIAGRAM
Rev. 10-000152A
4/21/2014
PWM Control
Unit
MODE<1:0>
PWMxPR
Comparator
PWMxTMR
PRx_match
PWMxDC
Comparator
16-bt Latch
DCx_match
PWMxOF
Comparator
16-bt Latch
OFx_match
PWMxPH
Comparator
16-bt Latch
PHx_match
16-bt Latch
LDx_trigger LDx_trigger LDx_trigger LDx_trigger
PWMxPOL
PWMx
PWMxOUT
To Peripherals
TRIS Control
PWMxOE
set PRIF
set PHIF
set OFIF set DCIF
D
CK
Q
Q4
PWMx_output
Offset
Control
E
RU/D
OFM<1:0>
PRx_match
00
11
10
01
OF3_match
(1)
OF2_match
(1)
OF1_match
(1)
Reserved
OFS
OF_match
EN
PHx_match
DCx_match
Note 1: A PWM module cannot trigger from its own offset match event.
The input corresponding to a PWM module’s own offset match is reserved.
PWM_clock