PIC16F785-I/P Microchip Technology Inc., PIC16F785-I/P Datasheet - Page 93

no-image

PIC16F785-I/P

Manufacturer Part Number
PIC16F785-I/P
Description
MCU, 8-Bit, 2KW Flash, 128 RAM, 18 I/O, DIP-20
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F785-I/P

A/d Inputs
12-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
17
Memory Type
Flash
Number Of Bits
8
Package Type
20-pin PDIP
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device
13.0
The two-phase PWM (Pulse Width Modulator) is a
stand-alone peripheral that supports:
• Single or dual-phase PWM
• Single complementary output PWM with overlap/
• Sync input/output to cascade devices for
Setting either, or both, of the PH1EN or PH2EN bits of
the PWMCON0 register will activate the PWM module
(see Register 13-1). If PH1 is used then TRISC<1>
must be cleared to configure the pin as an output. The
same is true for TRISC<4> when using PH2. Both
PH1EN and PH2EN must be set when using
Complementary mode.
13.1
The PWM period is derived from the main clock (F
the PWM prescaler and the period counter (see
Figure 13-1). The prescale bits (PWMP<1:0>, see
Register 13-2) determine the value of the clock divider
which divides the system clock (F
This pwm_clk is used to drive the PWM counter. In
Master mode, the PWM counter is reset when the
count reaches the period count (PER<4:0>, see
Register 13-2), which determines the frequency of the
PWM. The relationship between the PWM frequency,
prescale and period count is shown in Equation 13-1.
EQUATION 13-1:
The maximum PWM frequency is F
period count must be greater than zero.
In Slave mode, the period counter is reset by the SYNC
input, which is the master device period counter reset.
For proper operation, the slave period count should be
equal to or greater than that of the master.
13.2
Each enabled phase output is driven active when the
phase counter matches the corresponding PWM phase
count (PH<4:0>, see Register 13-3 and Register 13-4).
The phase output remains true until terminated by a
feedback signal from either of the comparators or the
auto-shutdown activates.
Phase granularity is a function of the period count
value. For example, if PER<4:0> = 3, each output can
be shifted in 90 steps (see Equation 13-2)
© 2006 Microchip Technology Inc.
delay
additional phases
PWM
TWO-PHASE PWM
PWM Period
PWM Phase
FREQ
=
(2
PWM FREQUENCY
PWMP
F
• (PER + 1)
OSC
OSC
) to the pwm_clk.
OSC
/2, since the
OSC
Preliminary
),
EQUATION 13-2:
13.3
Each PWM output is driven inactive, terminating the
drive period, by asynchronous feedback through the
internal comparators. The duty cycle resolution is in
effect infinitely adjustable. Either or both comparators
can be used to reset the PWM by setting the corre-
sponding
Register 13-3). Duty cycles of 100% can be obtained
by suppressing the feedback which would otherwise
terminate the pulse.
The comparator outputs can be “held off”, or blanked,
by enabling the corresponding BLANK bit (BLANKx,
see Register 13-1) for each phase. The blank bit
disables the comparator outputs for 1/2 of a system
clock (F
for the PWM output. Blanking avoids early termination
of the PWM output which may result due to switching
transients at the beginning of the cycle.
13.4
Multiple chips can operate together to achieve addi-
tional phases by operating one as the master and the
others as slaves. When the PWM is configured as a
master, the RB7/SYNC pin is an output and generates
a high output for one pwm_clk period at the end of each
PWM period (see Figure 13-4).
When the PWM is configured as a slave, the RB7/
SYNC pin is an input. The high input from a master in
this configuration resets the PWM period counter which
synchronizes the slave unit at the end of each PWM
period. Proper operation of a slave device requires a
common external F
ter and slave. The PWM prescale value of the slave
device must also be identical to that of the master. As
mentioned previously, the slave period count value
must be greater than or equal to that of the master.
The PWM Counter will be reset and held at zero when
both PH1EN and PH2EN (PWMCON0<1:0>) are false.
If the PWM is configured as a slave, the PWM Counter
will remain reset at zero until the first SYNC input is
received.
PIC16F785/HV785
OSC
PWM Duty Cycle
Master/Slave Operation
Phase
comparator
), thus ensuring at least T
DEG
OSC
=
PHASE RESOLUTION
clock source to drive the mas-
enable
(PER + 1)
360
bit
DS41249D-page 91
OSC
(CxEN,
/2 active time
see

Related parts for PIC16F785-I/P