PIC16C64X & PIC16C66X
8-Bit EPROM Microcontrollers with Analog Comparators
Devices included in this data sheet:
•
•
•
•
PIC16C641
PIC16C642
PIC16C661
PIC16C662
Pin Diagrams
PDIP, SOIC, Windowed CERDIP
MCLR/V
PP
RA0/AN0
RA1/AN1
RA2/AN2/V
REF
RA3/AN3
RA4/T0CKI
RA5
V
SS
OSC1/CLKIN
OSC2/CLKOUT
RC0
RC1
RC2
RC3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28
27
26
25
24
23
22
21
20
19
18
17
16
15
High Performance RISC CPU:
• Only 35 instructions to learn
• All single-cycle instructions (200 ns), except for
program branches which are two-cycle
• Operating speed:
- DC - 20 MHz clock input
- DC - 200 ns instruction cycle
Device
PIC16C641
PIC16C642
PIC16C661
PIC16C662
Program
Memory x14
2K
4K
2K
4K
Data
Memory x8
128
176
128
176
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0/INT
V
DD
V
SS
RC7
RC6
RC5
RC4
PDIP, Windowed CERDIP
MCLR/V
PP
RA0/AN0
RA1/AN1
RA2/AN2/V
REF
RA3/AN3
RA4/T0CKI
RA5
RE0/RD
RE1/WR
RE2/CS
V
DD
V
SS
OSC1/CLKIN
OSC2/CLKOUT
RC0
RC1
RC2
RC3
RD0/PSP0
RD1/PSP1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0/INT
V
DD
V
SS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7
RC6
RC5
RC4
RD3/PSP3
RD2/PSP2
PIC16C64X
PIC16C66X
• Interrupt capability
• 8-level deep hardware stack
• Direct, Indirect and Relative addressing modes
Peripheral Features:
• Up to 33 I/O pins with individual direction control
• High current sink/source for direct LED drive
• Analog comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(V
REF
) module
- Programmable input multiplexing from device
inputs and internal voltage reference
- Comparator outputs can be output signals
• Timer0: 8-bit timer/counter with 8-bit
programmable prescaler
Special Microcontroller Features:
• Power-on Reset (POR)
• Power-up Timer (PWRT) and
Oscillator Start-up Timer (OST)
• Brown-out Reset
• Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
• Programmable code protection
• Power saving SLEEP mode
• Selectable oscillator options
• Serial in-circuit programming (via two pins)
• Four user programmable ID locations
• Program Memory Parity Error checking circuitry
with Parity Error Reset (PER)
•
CMOS Technology:
• Low-power, high-speed CMOS EPROM technology
• Fully static design
• Wide operating voltage range: 3.0V to 6.0V
• Commercial, Industrial and Automotive
temperature ranges
• Low power consumption
- < 2.0 mA @ 5.0V, 4.0 MHz
- 15
µ
A typical @ 3.0V, 32 kHz
- < 1.0
µ
A typical standby current @ 3.0V
©
1996 Microchip Technology Inc.
Preliminary
This document was created with FrameMaker 4 0 4
DS30559A-page 1
PIC16C64X & PIC16C66X
Pin Diagrams (Cont.’d)
TQFP
RC6
RC5
RC4
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3
RC2
RC1
NC
44 43 42 41 40 39 38 37 36 35 34
33
32
31
30
29
28
27
26
25
24
23
RC7
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
V
SS
V
DD
RB0/INT
RB1
RB2
RB3
1
2
3
4
5
6
7
8
9
10
11
PIC16C66X
NC
RC0
OSC2/CLKOUT
OSC1/CLKIN
V
SS
V
DD
RE2/CS
RE1/WR
RE0/RD
RA5
RA4/T0CKI
12 1314 15 16 17 1819 20 21 22
RA4/T0CKI
RA5
RE0/RD
RE1/WR
RE2/CS
V
DD
V
SS
OSC1/CLKIN
OSC2/CLKOUT
RC0
NC
6 5 4 3 2 1 44 43 42 4140
39
38
37
36
35
34
33
32
31
30
16
29
17
18 19 20 21 2223 24 2526 27 28
7
8
9
10
11
12
13
14
15
RA3/AN3
RA2/AN2/V
REF
RA1/AN1
RA0/AN0
MCLR/V
PP
NC
RB7
RB6
RB5
RB4
NC
RA3/AN3
RA2/AN2/V
REF
RA1/AN1
RA0/AN0
MCLR/V
PP
RB7
RB6
RB5
RB4
NC
NC
PLCC
PIC16C66X
RB3
RB2
RB1
RB0/INT
V
DD
V
SS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7
NC
RC6
RC5
RC4
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3
RC2
RC1
DS30559A-page 2
Preliminary
©
1996 Microchip Technology Inc.
PIC16C64X & PIC16C66X
Table of Contents
1.0
General Description .......................................................................................................................................... 5
2.0
PIC16C64X & PIC16C66X Device Varieties .................................................................................................... 7
3.0
Architectural Overview...................................................................................................................................... 9
4.0
Memory Organization ..................................................................................................................................... 17
5.0
I/O Ports.......................................................................................................................................................... 29
6.0
Timer0 Module................................................................................................................................................ 41
7.0
Comparator Module ........................................................................................................................................ 47
8.0
Voltage Reference Module ............................................................................................................................. 53
9.0
Special Features of the CPU .......................................................................................................................... 55
10.0
Instruction Set Summary ................................................................................................................................ 73
11.0
Development Support ..................................................................................................................................... 87
12.0
Electrical Specifications .................................................................................................................................. 91
13.0
Device Characterization Information............................................................................................................. 103
14.0
Packaging Information .................................................................................................................................. 105
Appendix A: Enhancements...................................................................................................................................... 115
Appendix B: Compatibility ......................................................................................................................................... 115
Appendix C: What’s New .......................................................................................................................................... 116
Appendix D: What’s Changed ................................................................................................................................... 116
Appendix E: PIC16/17 Microcontrollers ..................................................................................................................... 117
Pin Compatibility ......................................................................................................................................................... 125
Index ........................................................................................................................................................................... 127
List of Examples.......................................................................................................................................................... 129
List of Figures.............................................................................................................................................................. 129
List of Tables............................................................................................................................................................... 130
On-Line Support.......................................................................................................................................................... 131
Reader Response ....................................................................................................................................................... 132
PIC16C64X & PIC16C66X Product Identification System .......................................................................................... 135
To Our Valued Customers
We constantly strive to improve the quality of all our products and documentation. We have spent an exceptional
amount of time to ensure that these documents are correct. However, we realize that we may have missed a few
things. If you find any information that is missing or appears in error, please use the reader response form in the
back of this data sheet to inform us. We appreciate your assistance in making this a better document.
©
1996 Microchip Technology Inc.
Preliminary
DS30559A-page 3
PIC16C64X & PIC16C66X
NOTES:
DS30559A-page 4
Preliminary
©
1996 Microchip Technology Inc.
PIC16C64X & PIC16C66X
1.0
GENERAL DESCRIPTION
PIC16C64X & PIC16C66X devices are 28-pin and
40-pin EPROM-based members of the versatile
PIC16CXXX family of low-cost, high-performance,
CMOS, fully-static, 8-bit microcontrollers.
All PIC16/17 microcontrollers employ an advanced
RISC architecture. The PIC16CXXX family has
enhanced core features, eight-level deep stack, and
multiple internal and external interrupt sources. The
separate instruction and data buses of the Harvard
architecture allow a 14-bit wide instruction word with
the separate 8-bit wide data. The two-stage instruction
pipeline allows all instructions to execute in a sin-
gle-cycle, except for program branches (which require
two cycles). A total of 35 instructions (reduced instruc-
tion set) are available. Additionally, a large register set
gives some of the architectural innovations used to
achieve a very high performance.
PIC16CXXX microcontrollers typically achieve a 2:1
code compression and a 4:1 speed improvement over
other 8-bit microcontrollers in its class.
The PIC16C641 has 128 bytes of RAM and the
PIC16C642 has 176 bytes of RAM. Both devices have
22 I/O pins, and an 8-bit timer/counter with an 8-bit pro-
grammable prescaler. In addition, they have two analog
comparators with a programmable on-chip voltage ref-
erence module. Program Memory has internal parity
error detection circuitry with a Parity Error Reset. The
comparator module is ideally suited for applications
requiring a low-cost analog interface (e.g., battery
chargers,
threshold
detectors,
white
goods
controllers, etc.).
The PIC16C661 has 128 bytes of RAM and the
PIC16C662 has 176 bytes of RAM. Both devices have
33 I/O pins, and an 8-bit timer/counter with an 8-bit pro-
grammable prescaler. They also have an 8-bit Parallel
Slave Port. In addition, the devices have two analog
comparators with a programmable on-chip voltage ref-
erence module. Program Memory has internal parity
error detection circuitry with a Parity Error Reset. The
comparator module is ideally suited for applications
requiring a low-cost analog interface (e.g., battery
chargers,
threshold
detectors,
white
goods
controllers, etc.).
PIC16CXXX devices have special features to reduce
external components, thus reducing cost, enhancing
system reliability and reducing power consumption.
There are four oscillator options, of which the single pin
RC oscillator provides a low-cost solution, the LP
oscillator minimizes power consumption, XT is a
standard crystal, and the HS is for High Speed crystals.
The SLEEP (power-down) mode offers power saving.
The user can wake-up the chip from SLEEP through
several external and internal interrupts and resets.
A highly reliable Watchdog Timer (WDT) with its own
on-chip RC oscillator provides protection against soft-
ware lock-up.
A UV-erasable CERDIP-packaged version is ideal for
code development while the cost-effective One-Time
Programmable (OTP) version is suitable for production
in any volume.
The PIC16CXXX series fit perfectly in applications
ranging from battery chargers to low-power remote
sensors.
The
EPROM
technology
makes
customization of application programs (detection
levels, pulse generation, timers, etc.) extremely fast
and convenient. The small footprint packages make
this microcontroller series perfect for all applications
with space limitations. Low-cost, low-power,
high-performance, ease of use, and I/O flexibility make
the PIC16C64X & PIC16C66X very versatile.
1.1
Family and Upward Compatibility
Those users familiar with the PIC16C5X family of
microcontrollers will realize that this is an enhanced
version of the PIC16C5X architecture. Please refer to
Appendix A for a detailed list of enhancements. Code
written for PIC16C5X can be easily ported to the
PIC16C64X & PIC16C66X (Appendix B).
1.2
Development Support
PIC16C64X & PIC16C66X devices are supported by
the complete line of Microchip Development tools,
including:
• MPLAB Integrated Development Environment
including MPLAB-Simulator.
• MPASM Universal Assembler and MPLAB-C Uni-
versal C compiler.
• PRO MATE II and PICSTART Plus device pro-
grammers.
• PICMASTER In-circuit Emulator System
•
fuzzyTECH-MP
Fuzzy Logic Development Tools
• DriveWay Visual Programming Tool
Please refer to Section 11.0 for more details about
these and other Microchip development tools.
©
1996 Microchip Technology Inc.
Preliminary
This document was created with FrameMaker 4 0 4
DS30559A-page 5