PIC16F785-E/SS Microchip Technology, PIC16F785-E/SS Datasheet - Page 93

20 PIN, 3.5 KB STD FLASH, 128 RAM, 18 I/O PB FREE,

PIC16F785-E/SS

Manufacturer Part Number
PIC16F785-E/SS
Description
20 PIN, 3.5 KB STD FLASH, 128 RAM, 18 I/O PB FREE,
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F785-E/SS

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
17
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 5.5 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Package / Case
20-SSOP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
XLT20SS1-1 - SOCKET TRANSITION 20DIP 20SSOPAC162060 - HEADER INTRFC MPLAB ICD2 20PIN
Connectivity
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
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 of the PWMP Register,
(see Register 13-2) determine the value of the clock
divider which divides the system clock (F
pwm_clk. 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 of the PER
Register, (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 in the PH Register (see Register 13-3 and
Register 13-4). The phase output remains true until ter-
minated by a feedback signal from either of the com-
parators 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).
© 2008 Microchip Technology Inc.
delay
additional phases
PWM
TWO-PHASE PWM
PWM Period
PWM Phase
FREQ
=
(2
PWM FREQUENCY
PWMP
F
• (PER + 1)
OSC
OSC
/2, since the
OSC
) to the
OSC
),
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 of the PWMCON0 Register
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
DS41249E-page 91
OSC
(CxEN,
/2 active time
see

Related parts for PIC16F785-E/SS