PIC16F785-I/SO Microchip Technology, PIC16F785-I/SO Datasheet - Page 60

IC PIC MCU FLASH 2KX14 20SOIC

PIC16F785-I/SO

Manufacturer Part Number
PIC16F785-I/SO
Description
IC PIC MCU FLASH 2KX14 20SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F785-I/SO

Program Memory Type
FLASH
Program Memory Size
3.5KB (2K x 14)
Package / Case
20-SOIC (7.5mm Width)
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
17
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 ~ 85°C
Processor Series
PIC16F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
128 B
Interface Type
RS- 232/USB
Maximum Clock Frequency
20 MHz
Number Of Programmable I/os
17
Number Of Timers
3
Operating Supply Voltage
2 V to 5.5 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, ICE2000, DV164120, DM163029
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
XLT20SO1-1 - SOCKET TRANS ICE 20DIP TO 20SOICXLT18SO-1 - SOCKET TRANSITION 18SOIC 300MILAC162060 - HEADER INTRFC MPLAB ICD2 20PINAC164039 - MODULE SKT PROMATE II 20DIP/SOIC
Connectivity
-
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F785-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
PIC16F785
DS41249A-page 58
8.3
In Pulse Width Modulation (PWM) mode, the CCP
module produces up to a 10-bit resolution PWM output
on the RC5/CCP1 pin. Since the RC5/CCP1 pin is
multiplexed with the PORTC data latch, the TRISC<5>
must be cleared to make the RC5/CCP1 pin an output.
Figure 8-3 shows a simplified block diagram of PWM
operation.
For a step by step procedure on how to set up the CCP
module for PWM operation, see Section 8.3.5 “Setup
for PWM Operation”.
FIGURE 8-3:
The PWM output (Figure 8-4) has a time base (period)
and a time that the output stays high (duty cycle). The
frequency of the PWM is the inverse of the period
(1/period).
FIGURE 8-4:
Note 1:
Note:
CCPR1H (Slave)
Duty Cycle Registers
DUTY CYCLE
Comparator
TMR2 = 0
CCP PWM Mode
CCPR1L
PR2
TMR2
Comparator
Clearing the CCP1CON register will force
the PWM output latch to the default
inactive levels. This is not the PORTC I/O
data latch.
PERIOD
The 8-bit timer TMR2 register is concate-
nated with the 2-bit internal Q clock, or 2 bits
of the prescaler, to create the 10-bit time
base.
(1)
TMR2 = DUTY CYCLE
SIMPLIFIED PWM BLOCK
DIAGRAM
CCP PWM OUTPUT
Clear Timer2,
toggle PWM pin and
latch duty cycle
CCP1CON<5:4>
TMR2 = PR2
S
R
Q
TRISC<5>
RC5/CCP1
Preliminary
8.3.1
The PWM period is specified by writing to the PR2
register. The PWM period can be calculated using the
formula of Equation 8-1.
EQUATION 8-1:
PWM frequency is defined as 1 / [PWM period].
When TMR2 is equal to PR2, the following three events
occur on the next increment cycle:
• TMR2 is cleared
• The RC5/CCP1 pin is set. (exception: if PWM
• The PWM duty cycle is latched from CCPR1L into
8.3.2
The PWM duty cycle is specified by writing to the
CCPR1L
(CCP1CON<5:4>) bits. Up to 10 bits of resolution is
available. The CCPR1L contains the eight MSbs and
the DC1B<1:0> contains the two LSbs. CCPR1L and
DC1B<1:0> can be written to at any time. In PWM
mode, CCPR1H is a read-only register. This 10-bit
value is represented by CCPR1L (CCP1CON<5:4>).
Equation 8-2 is used to calculate the PWM duty cycle
in time.
EQUATION 8-2:
PWM duty cycle
duty cycle = 0%, the pin will not be set)
CCPR1H
Note:
PWM period
The Timer2 postscaler (see Section 7.1
“Timer2 Operation”) is not used in the
determination of the PWM frequency. The
postscaler could be used to have a servo
update rate at a different frequency than
the PWM output.
PWM PERIOD
PWM DUTY CYCLE
register
=
=
T
CCPR1L:CCP1CON<5:4>
OSC
(TMR2 prescale value)
 2004 Microchip Technology Inc.
and
PR2
+
(TMR2 prescale value)
to
1
4 T
the
OSC
DC1B<1:0>

Related parts for PIC16F785-I/SO