PIC16C781/782
8-Bit CMOS Microcontrollers with A/D, D/A, OPAMP,
Comparators and PSMC
Microcontroller Core Features:
• High performance RISC CPU
• Only 35 single word instructions to learn
• All single cycle instructions except for program
branches which are two cycle
• Direct, indirect and relative addressing modes
- Operating speed: DC - 20 MHz clock input
DC - 200 ns instruction cycle
Device
PIC16C781
PIC16C782
Program
Memory
X14
1K
2K
Data Memory
X8
128
128
Microcontroller Core Features (Continued):
• Low power, high speed CMOS EPROM
technology
• Fully static design
• Low power consumption:
- < 2 mA @ 5V, 4 MHz
- < 1
A
typical standby current.
Pin Diagram
PDIP, Windowed CERDIP, SOIC, SSOP
RA0/AN0/OPA+
RA1/AN1/OPA-
RA4/T0CKI
RA5/MCLR/V
PP
V
SS
AV
SS
RA2/AN2/V
REF
2
RA3/AN3/V
REF
1
RB0/INT/AN4/V
R
RB1/AN5/V
DAC
•1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
20
19
18
17
16
15
14
13
12
11
RB3/AN7/OPA
RB2/AN6
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT/T1CKI
V
DD
AV
DD
RB7/C2/PSMC1B/T1G
RB6/C1/PSMC1A
RB5
RB4
PIC16C781/782
• 8-level deep hardware stack
• Interrupt capability (up to 8 internal/external
interrupt sources)
• 16 I/O pins:
- Individual direction control (13 pins)
- Input only (3 pins), low leakage (2 pins)
- Digital/Analog inputs (8 pins)
• Programmable PORTB interrupt-on-change (8 pins)
• Programmable PORTB weak pull-ups (8 pins)
• Power-on Reset (POR)
• Power-up Timer (PWRT) and
Oscillator Start-up Timer (OST)
• Watchdog Timer (WDT) with a software enabled
option and its own on-chip RC oscillator for
reliable operation
• Programmable Brown-out Reset (BOR)
• Programmable Low Voltage Detection (LVD)
• Internal/external MCLR
• Programmable code protection
• Power saving SLEEP mode
• Selectable oscillator options:
HS, XT, LP, EC, RC, INTRC (4 MHz/37 kHz)
• In-Circuit Serial Programming™ (ISCP™)
• Program Memory Read (PMR) capability
• Four user programmable ID locations
• Wide operating voltage range:
- 2.5V to 5.5V for commercial and industrial
temperature ranges
- Extended temperature range available
Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Enhanced Timer1:
- 16-bit timer/counter with prescaler
- External Gate Input mode
- Option to use OSC1 and OSC2 in LP mode
as Timer1 oscillator, if INTRC oscillator mode
selected
• Analog-to-Digital Converter (ADC):
- 8-bit resolution
- Programmable 8-channel input
- Internal voltages available for self-
diagnostics
• Digital-to-Analog Converter (DAC):
- 8-bit resolution
- Reference from AV
DD
, V
REF
1, or V
R
module
- Output configurable to V
DAC
pin, Compara-
tors, and ADC reference
• Operational Amplifier module (OPA):
- Firmware initiated input offset voltage Auto
Calibration module
- Low leakage inputs
- Programmable Gain Bandwidth Product
(GBWP)
2001-2013 Microchip Technology Inc.
Preliminary
DS41171B-page 1
PIC16C781/782
Peripheral Features (Continued):
• Dual Analog Comparator module with:
- Individual enable and interrupt bits
- Programmable speed and output polarity
- Fully configurable inputs and outputs
- Reference from DAC, or V
REF
1/V
REF
2
- Low input offset voltage.
• V
R
voltage reference module:
- 3.072V +/- 0.7% @25C, AV
DD
= 5V
- Configurable output to ADC reference, DAC
reference, and V
R
pin
- 5 mA sink/source
• Programmable Switch Mode Controller module:
- PWM and PSM modes
- Programmable switching frequency
- Configurable for either single or dual
feedback inputs
- Configurable single or dual outputs
- Slope compensation output available in
single output mode
Key Features
PIC
®
Mid-Range
Reference Manual
(DS33023)
Operating Frequency
RESETS (and Delays)
Program Memory (14 bit words)
Data Memory (bytes)
Interrupts
I/O Ports
Timers
Programmable Switch Mode Controller
8-bit Analog-to-Digital Module
ADC channels
8-bit Digital-to-Analog Module
Comparators
Comparator Channels
Operational Amplifier
Voltage Reference
Brown-out Reset
Programmable Low Voltage Detect
Instruction Set
PIC16C781
PIC16C782
DC - 20 MHz
1K
128
8
13 + 3 Input only
2
1
1
8 External, 2 Internal
1
2
4 (AN<7:4>)
1
1
Yes
Yes
35 Instructions
DC - 20 MHZ
2K
128
8
13 + 3 Input only
2
1
1
8 External, 2 Internal
1
2
4 (AN<7:4>)
1
1
Yes
Yes
35 Instructions
POR, BOR, MCLR, WDT (PWRT, OST) POR, BOR, MCLR, WDT (PWRT, OST)
DS41171B-page 2
Preliminary
2001-2013 Microchip Technology Inc.
PIC16C781/782
Table of Contents
1.0 Device Overview ......................................................................................................................................................................... 5
2.0 Memory Organization ................................................................................................................................................................ 11
3.0 I/O Ports .................................................................................................................................................................................... 25
4.0 Program Memory Read (PMR) .................................................................................................................................................. 47
5.0 Timer0 Module .......................................................................................................................................................................... 51
6.0 Timer1 Module with Gate Control .............................................................................................................................................. 55
7.0 Voltage Reference Module (V
R
) ................................................................................................................................................ 61
8.0 Programmable Low Voltage Detect Module (PLVD) ................................................................................................................. 63
9.0 Analog-to-Digital Converter (ADC) Module ............................................................................................................................... 69
10.0 Digital-to-Analog Converter (DAC) Module ............................................................................................................................... 79
11.0 Operational Amplifier (OPA) Module ......................................................................................................................................... 83
12.0 Comparator Module ................................................................................................................................................................... 89
13.0 Programmable Switch Mode Controller (PSMC) ....................................................................................................................... 99
14.0 Special Features of The CPU .................................................................................................................................................. 117
15.0 Instruction Set Summary ......................................................................................................................................................... 133
16.0 Development Support .............................................................................................................................................................. 141
17.0 Electrical Characteristics ......................................................................................................................................................... 147
18.0 DC and AC Characteristics Graphs and Tables ...................................................................................................................... 167
19.0 Packaging Information ............................................................................................................................................................. 169
Index .................................................................................................................................................................................................. 175
On-Line Support................................................................................................................................................................................. 181
Reader Response .............................................................................................................................................................................. 182
PIC16C781/782 Product Identification System .................................................................................................................................. 183
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at
docerrors@mail.microchip.com
or fax the
Reader Response Form
in the back of this data sheet to (480) 792-4150.
We welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
• The Microchip Corporate Literature Center; U.S. FAX: (480) 792-7277
When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include liter-
ature number) you are using.
Customer Notification System
Register on our web site at
www.microchip.com/cn
to receive the most current information on all of our products.
2001-2013 Microchip Technology Inc.
Preliminary
DS41171B-page 3
PIC16C781/782
NOTES:
DS41171B-page 4
Preliminary
2001-2013 Microchip Technology Inc.
PIC16C781/782
1.0
DEVICE OVERVIEW
This document contains device-specific information.
Additional information may be found in the PIC Mid-
Range Reference Manual (DS33023), which may be
obtained from your local Microchip Sales Representa-
tive or downloaded from the Microchip website. The
Reference manual should be considered a comple-
mentary document to this data sheet. The Reference
manual is highly recommended reading for a better
understanding of the device architecture and operation
of the peripheral modules.
This data sheet covers two devices: PIC16C781 and
PIC16C782. Both devices come in a variety of 20-pin
packages.
The following figures are block diagrams of the
PIC16C781 and the PIC16C782.
FIGURE 1-1:
PIC16C781 BLOCK DIAGRAM
13
EPROM
Program Counter
Data Bus
8
PORTA
RA0/AN0/OPA+
RA1/AN1/OPA-
RA2/AN2/V
REF
2
RA3/AN3/V
REF
1
RA4/T0CKI
RA5/MCLR/V
PP
RA6/OSC2/CLKOUT/T1CKI
RA7/OSC1/CLKIN
PORTB
Program
Memory
1K x 14
8 Level Stack
(13-bit)
Program Memory
Read (PMR)
RAM
Program 14
Bus
Instruction reg
File
Registers
128 x 8
RAM
9
Addr
Addr MUX
Direct Addr
7
Indirect
8 Addr
FSR reg
8
3
STATUS reg
Power-up
Timer
Instruction
Decode &
Control
Timing
Generation
OSC2/
CLKOUT
Internal
RC
Oscillator
INTRC
Oscillator
Start-up Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
MUX
RB0/INT/AN4/V
R
RB1/AN5/V
DAC
RB2/AN6
RB3/AN7/OPA
RB4
RB5
RB6/C1/PSMC1A
RB7/C2/PSMC1B/T1G
OSC1/
CLKIN
ALU
8
W reg
AV
DD
, AV
SS
(1)
V
DD
, V
SS
Timer1
(TMR1)
Voltage Reference
(V
R
) Module
Programmable
Low Voltage Detect
(PLVD)
Timer0
(TMR0)
Comparator
(C1)
Comparator
(C2)
8-bit ADC
Programmable Switch
Mode Controller
(PSMC)
OPAMP
(OPA)
8-bit
DAC
Note 1:
AV
DD
and AV
SS
pins are used by the following modules: C1, C2, OPA, DAC, ADC, and V
R
.
2001-2013 Microchip Technology Inc.
Preliminary
DS41171B-page 5