V
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
1997 Microchip Technology Inc.DS30234D-page 3
PIC16C6X
Table Of Contents
1.0 General Description....................................................................................................................................................................... 5
11.0 Synchronous Serial Port (SSP) Module....................................................................................................................................... 83
13.0 Special Features of the CPU ..................................................................................................................................................... 123
14.0 Instruction Set Summary............................................................................................................................................................ 143
15.0 Development Support ................................................................................................................................................................ 159
16.0 Electrical Characteristics for PIC16C61..................................................................................................................................... 163
17.0 DC and AC Characteristics Graphs and Tables for PIC16C61.................................................................................................. 173
18.0 Electrical Characteristics for PIC16C62/64................................................................................................................................ 183
19.0 Electrical Characteristics for PIC16C62A/R62/64A/R64............................................................................................................ 199
20.0 Electrical Characteristics for PIC16C65..................................................................................................................................... 215
21.0 Electrical Characteristics for PIC16C63/65A ............................................................................................................................. 231
22.0 Electrical Characteristics for PIC16CR63/R65........................................................................................................................... 247
23.0 Electrical Characteristics for PIC16C66/67................................................................................................................................ 263
24.0 DC and AC Characteristics Graphs and Tables for:
PIC16C62, PIC16C62A, PIC16CR62, PIC16C63, PIC16C64, PIC16C64A, PIC16CR64,
25.0 Packaging Information ............................................................................................................................................................... 291
Index .................................................................................................................................................................................................. 317
List of Equation and Examples........................................................................................................................................................... 326
List of Figures..................................................................................................................................................................................... 326
List of Tables...................................................................................................................................................................................... 330
For register and module descriptions in this data sheet, device legends show which de vices apply to those sections . For
example, the legend below shows that some features of only the PIC16C62A, PIC16CR62, PIC16C63, PIC16C64A,
PIC16CR64, and PIC16C65A are described in this section.
Applicable Devices
62 62A R62 63 R63 64 64A R64 65 65A R65 66 67
61
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.
DS30234D-page 4
1997 Microchip Technology Inc.
PIC16C6X
1.0GENERAL DESCRIPTION
The PIC16CXX is a family of
mance, CMOS, fully-static, 8-bit microcontrollers.
All PIC16/17 microcontrollers employ an advanced
RISC architecture. The PIC16CXX microcontroller f amily 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
separate 8-bit wide data. The two stage instruction
pipeline allows all instructions to execute in a single
cycle, except for program branches (which require two
cycles). A total of 35 instructions (reduced instruction
set) are available . Additionally, a large register set gives
some of the architectural innovations used to achie v e a
very high performance.
PIC16CXX microcontrollers typically achieve a 2:1
code compression and a 4:1 speed improvement over
other 8-bit microcontrollers in their class.
The PIC16C61 device has 36 bytes of RAM and 13 I/O
pins. In addition a timer/counter is available.
The PIC16C62/62A/R62 devices have 128 bytes of
RAM and 22 I/O pins. In addition, several peripheral
features are available, including: three timer/counters,
one Capture/Compare/PWM module and one serial
port. The Synchronous Serial Por t can be configured
as either a 3-wire Serial Peripheral Interface (SPI ) or
the two-wire Inter-Integrated Circuit (I
The PIC16C63/R63 devices have 192 bytes of RAM,
while the PIC16C66 has 368 bytes. All three devices
have 22 I/O pins. In addition, several peripheral features are available, including: three timer/counters, two
Capture/Compare/PWM modules and two serial ports.
The Synchronous Serial Port can be configured as
either a 3-wire Serial Peripheral Interface (SPI) or the
two-wire Inter-Integrated Circuit (I
sal Synchronous Asynchronous Receiver Transmitter
(USART) is also know as a Serial Communications
Interface or SCI.
The PIC16C64/64A/R64 devices have 128 bytes of
RAM and 33 I/O pins. In addition, several peripheral
features are available, including: three timer/counters,
one Capture/Compare/PWM module and one serial
port. The Synchronous Serial Por t can be configured
as either a 3-wire Serial Peripheral Interface (SPI) or
the two-wire Inter-Integrated Circuit (I
Parallel Slave Port is also provided.
The PIC16C65/65A/R65 devices have 192 bytes of
RAM, while the PIC16C67 has 368 bytes. All four
devices hav e 33 I/O pins. In addition, se ver al peripheral
features are available, including: three timer/counters,
two Capture/Compare/PWM modules and two serial
ports. The Synchronous Serial Port can be configured
as either a 3-wire Serial Peripheral Interface (SPI) or
the two-wire Inter-Integrated Circuit (I
versal Synchronous Asynchronous Receiver Transmit-
low-cost, high-perfor-
2
C) bus.
2
C) bus. The Univer-
2
C) bus. An 8-bit
2
C) bus. The Uni-
ter (USART) is also known as a Serial Communications
Interface or SCI. An 8-bit P arallel Sla ve Port is also provided.
The PIC16C6X device family has special features to
reduce external components, thus reducing cost,
enhancing system reliability and reducing power consumption. There are f our 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 a power saving
mode. The user can wake the chip from SLEEP
through several external and internal interrupts, and
resets.
A highly reliable Watchdog Timer with its own on-chip
RC oscillator provides protection against software lockup.
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 PIC16C6X family fits perfectly in applications ranging from high-speed automotive and appliance control
to low-power remote sensors, keyboards and telecom
processors. The EPROM technology makes customization of application programs (transmitter codes,
motor speeds, receiver frequencies, 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
PIC16C6X very versatile ev en in areas where no microcontroller use has been considered before (e.g. timer
functions, serial communication, capture and compare,
PWM functions, and co-processor applications).
1.1F
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
PIC16CXX family of devices (Appendix B).
1.2De
PIC16C6X devices are supported by the complete line
of Microchip Development tools.
Please refer to Section 15.0 for more details about
Microchip’s development tools.
amily and Upward Compatibility
velopment Support
1997 Microchip Technology Inc.DS30234D-page 5
PIC16C6X
TABLE 1-1:PIC16C6X FAMILY OF DEVICES
Clock
Memory
Peripherals
Features
PIC16C61
Maximum Frequency
of Operation (MHz)
EPROM Program Memory
(x14 words)
ROM Program Memory
(x14 words)
Data Memory (bytes)36128128192192
Timer Module(s)TMR0TMR0,
Capture/Compare/
PWM Module(s)
Serial Port(s)
2
(SPI/I
C, USART)
Parallel Slave Port—————
Interrupt Sources3771010
I/O Pins1322222222
Voltage Range (Volts)3.0-6.02.5-6.02.5-6.02.5-6.02.5-6.0
In-Circuit Serial ProgrammingYesYesYesYesYes
Brown-out Reset—YesYesYesYes
Packages18-pin DIP, SO 28-pin SDIP,
2020202020
1K2K—4K—
——2K—4K
—1122
—SPI/I
PIC16C62APIC16CR62PIC16C63PIC16CR63
TMR1,
TMR2
2
CSPI/I
SOIC, SSOP
TMR0,
TMR1,
TMR2
2
CSPI/I
28-pin SDIP,
SOIC, SSOP
TMR0,
TMR1,
TMR2
2
C,
USART
28-pin SDIP,
SOIC
TMR0,
TMR1,
TMR2
SPI/I
USART
28-pin SDIP,
SOIC
2
C
PIC16C64A
Clock
Memory
Peripherals
Features
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O current
capability. All PIC16C6X Family devices use serial programming with clock pin RB6 and data pin RB7.
Maximum Frequency
of Operation (MHz)
EPROM Program Memory
(x14 words)
ROM Program Memory (x14
words)
Data Memory (bytes)128128192192368368
Timer Module(s)TMR0,
Capture/Compare/PWM Module(s)
Serial Port(s) (SPI/I
Parallel Slave PortYesYesYesYes—Yes
Interrupt Sources8811111011
I/O Pins333333332233
Voltage Range (Volts)2.5-6.02.5-6.02.5-6.02.5-6.02.5-6.02.5-6.0
In-Circuit Serial ProgrammingYesYesYesYesYesYes
Brown-out ResetYesYesYesYesYesYes
Packages40-pin DIP;
2
C, USART) SPI/I2CSPI/I2CSPI/I2C,
202020202020
2K—4K—8K8K
—2K— 4K——
TMR1,
TMR2
1 1 2 222
44-pin PLCC,
MQFP, TQFP
PIC16CR64 PIC16C65A PIC16CR65 PIC16C66PIC16C67
TMR0,
TMR1,
TMR2
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
TMR0,
TMR1,
TMR2
USART
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
TMR0,
TMR1,
TMR2
SPI/I2C,
USART
40-pin DIP;
44-pin
PLCC,
MQFP,
TQFP
TMR0,
TMR1,
TMR2
SPI/I2C,
USART
28-pin SDIP,
SOIC
TMR0,
TMR1,
TMR2
SPI/I2C,
USART
40-pin DIP;
44-pin
PLCC,
MQFP,
TQFP
DS30234D-page 6
1997 Microchip Technology Inc.
PIC16C6X
2.0PIC16C6X DEVICE VARIETIES
A variety of frequency ranges and packaging options
are available . Depending on application and production
requirements, the proper device option can be selected
using the information in the PIC16C6X Product Identification System section at the end of this data sheet.
When placing orders, please use that page of the data
sheet to specify the correct part number.
For the PIC16C6X family of devices, there are four
device “types” as indicated in the device number:
1. C, as in PIC16C64. These devices have
EPROM type memory and operate over the
standard voltage range.
2. LC, as in PIC16LC64. These devices have
EPROM type memory and operate over an
extended voltage range.
3. CR, as in PIC16CR64. These devices have
ROM program memory and operate over the
standard voltage range.
4. LCR, as in PIC16LCR64. These devices have
ROM program memory and operate over an
extended voltage range.
2.1UV Erasable Devices
The UV erasable version, offered in CERDIP package
is optimal for prototype development and pilot
programs. This version can be erased and
reprogrammed to any of the oscillator modes.
Microchip's PICSTART
programmers both support programming of the
PIC16C6X.
2.2One-Time-Programmable (OTP)
Devices
The availability of OTP devices is especially useful for
customers who need the flexibility for frequent code
updates and small volume applications.
The OTP devices, packaged in plastic packages, permit the user to program them once. In addition to the
program memory, the configuration bits must also be
programmed.
Plus and PRO MATE II
2.3Quick-Turnaround-Production (QTP)
Devices
Microchip offers a QTP Programming Service for factory production orders. This ser vice is made available
for users who choose not to program a medium to high
quantity of units and whose code patterns have stabilized. The devices are identical to the OTP devices but
with all EPROM locations and configuration options
already programmed by the factory. Certain code and
prototype verification procedures apply before production shipments are available. Please contact your local
Microchip Technology sales office for more details.
2.4Serialized Quick-Turnaround
Production (SQTPSM) Devices
Microchip offers a unique programming service where
a few user-defined locations in each device are programmed with different serial numbers. The serial numbers may be random, pseudo-random, or sequential.
Serial programming allows each device to have a
unique number which can serve as an entry-code,
password, or ID number.
ROM devices do not allow serialization information in
the program memory space. The user may have this
information programmed in the data memory space.
For information on submitting ROM code, please contact your regional sales office.
2.5Read Only Memory (ROM) Devices
Microchip offers masked ROM versions of several of
the highest volume parts, thus giving customers a low
cost option for high volume, mature products.
For information on submitting ROM code, please contact your regional sales office.
1997 Microchip Technology Inc.DS30234D-page 7
PIC16C6X
NOTES:
DS30234D-page 8 1997 Microchip Technology Inc.
PIC16C6X
3.0ARCHITECTURAL OVERVIEW
The high performance of the PIC16CXX family can be
attributed to a number of architectural features commonly found in RISC microprocessors. To begin with,
the PIC16CXX uses a Harvard architecture, in which,
program and data are accessed from separate memories using separate buses. This improves bandwidth
over traditional von Neumann architecture where program and data may be fetched from the same memory
using the same bus. Separ ating program and data b usses further allows instructions to be sized differently
than 8-bit wide data words. Instruction opcodes are
14-bits wide making it possible to have all single word
instructions. A 14-bit wide program memory access
bus fetches a 14-bit instruction in a single cycle. A twostage pipeline overlaps fetch and execution of instructions (Example 3-1). Consequently, all instructions execute in a single cycle (200 ns @ 20 MHz) except for
program branches.
The PIC16C61 addresses 1K x 14 of program memory.
The PIC16C62/62A/R62/64/64A/R64 address 2K x 14 of
program memory, and the PIC16C63/R63/65/65A/R65
devices address 4K x 14 of program memory. The
PIC16C66/67 address 8K x 14 program memory. All
program memory is internal.
The PIC16CXX can directly or indirectly address its
register files or data memory. All special function registers including the program counter are mapped in
the data memory. The PIC16CXX has an orthogonal
(symmetrical) instruction set that makes it possible to
carry out any operation on any register using any
addressing mode. This symmetrical nature and lack of
“special optimal situations” makes programming with
the PIC16CXX simple yet efficient, thus significantly
reducing the learning curve.
The PIC16CXX device contains an 8-bit ALU and working register (W). The ALU is a general pur pose arithmetic unit. It perf orms arithmetic and Boolean functions
between data in the working register and any register
file.
The ALU is 8-bits wide and capable of addition, subtraction, shift, and logical operations. Unless otherwise
mentioned, arithmetic operations are two's complement in nature. In two-operand instructions, typically
one operand is the working register (W register), the
other operand is a file register or an immediate constant. In single operand instructions, the operand is
either the W register or a file register.
The W register is an 8-bit working register used for ALU
operations. It is not an addressable register.
Depending upon the instruction executed, the ALU ma y
affect the values of the Carry (C), Digit Carry (DC), and
Zero (Z) bits in the STATUS register. Bits C and DC
operate as a borro
tively, in subtraction. See the SUBLW and SUBWF
instructions for examples.
w and digit borrow out bit, respec-
1997 Microchip Technology Inc.DS30234D-page 9
PIC16C6X
FIGURE 3-1:PIC16C61 BLOCK DIAGRAM
Program
Bus
OSC1/CLKIN
OSC2/CLKOUT
EPROM
Program
Memory
1K x 14
14
Instruction reg
Instruction
Decode &
Control
Timing
Generation
13
Program Counter
8 Level Stack
Direct Addr
8
Power-up
Oscillator
Start-up Timer
Power-on
Watchdog
MCLR
(13-bit)
Timer
Reset
Timer
VDD, VSS
RAM Addr
7
3
8
Data Bus
RAM
File
Registers
36 x 8
(1)
Addr MUX
FSR reg
STATUS reg
ALU
W reg
Timer0
9
8
MUX
8
Indirect
Addr
PORTA
RA0
RA1
RA2
RA3
RA4/T0CKI
PORTB
RB0/INT
RB7:RB1
Note 1: Higher order bits are from the STATUS register.
Note 1: Higher order bits are from the STATUS register.
2: PORTD, PORTE and the Parallel Slave Port are not available on the PIC16C62/62A/R62.
3: Brown-out Reset is not available on the PIC16C62/64.
4: Pin functions T1OSI and T1OSO are swapped on the PIC16C62/64.
Note 1: Higher order bits are from the STATUS register.
2: PORTD, PORTE and the Parallel Slave Port are not available on the PIC16C66.
RE1/WR
RE2/CS
(Note 2)
CCP2CCP1
1997 Microchip Technology Inc.DS30234D-page 13
PIC16C6X
TABLE 3-1:PIC16C61 PINOUT DESCRIPTION
Pin Name
OSC1/CLKIN1616I
OSC2/CLKOUT1515O—Oscillator crystal output. Connects to crystal or resonator in crystal
MCLR
/VPP
RA01717I/OTTL
RA11818I/OTTL
RA211I/OTTL
RA322I/OTTL
RA4/T0CKI33I/OSTRA4 can also be the clock input to the Timer0 timer/counter.
RB0/INT66I/OTTL/ST
RB177I/OTTL
RB288I/OTTL
RB399I/OTTL
RB41010I/OTTLInterrupt on change pin.
RB51111I/OTTLInterrupt on change pin.
RB61212I/OTTL/ST
RB71313I/OTTL/ST
VSS55P—Ground reference for logic and I/O pins.
VDD1414P—Positive supply for logic and I/O pins.
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
2: This buffer is a Schmitt Trigger input when configured as the external interrupt.
3: This buffer is a Schmitt Trigger input when used in serial programming mode.
OSC2/CLKOUT10O—Oscillator crystal output. Connects to crystal or resonator in crys-
tal oscillator mode. In RC mode, the pin outputs CLKOUT which
has 1/4 the frequency of OSC1, and denotes the instruction cycle
rate.
M
CLR/VPP
1I/PSTMaster clear reset input or programming voltage input. This pin is
an active low reset to the device.
PORTA is a bi-directional I/O port.
RA02I/OTTL
RA13I/OTTL
RA24I/OTTL
RA35I/OTTL
RA4/T0CKI6I/OSTRA4 can also be the clock input to the Timer0 timer/counter.
Output is open drain type.
RA5/SS7I/OTTLRA5 can also be the slave select for the synchronous serial
port.
PORTB is a bi-directional I/O port. PORTB can be software pro-
grammed for internal weak pull-up on all inputs.
RB0/INT21I/OTTL/ST
(4)
RB0 can also be the external interrupt pin.
RB122I/OTTL
RB223I/OTTL
RB324I/OTTL
RB425I/OTTLInterrupt on change pin.
RB526I/OTTLInterrupt on change pin.
RB627I/OTTL/ST
RB728I/OTTL/ST
(5)
(5)
Interrupt on change pin. Serial programming clock.
Interrupt on change pin. Serial programming data.
PORTC is a bi-directional I/O port.
.
(1)
or Timer1
(1)
or Capture2
RC0/T1OSO
RC1/T1OSI
(1)
(1)
/T1CKI
/CCP2
11I/OSTRC0 can also be the Timer1 oscillator output
clock input.
(2)
12I/OSTRC1 can also be the Timer1 oscillator input
input/Compare2 output/PWM2 output
(2)
RC2/CCP113I/OSTRC2 can also be the Capture1 input/Compare1 out-
put/PWM1 output.
RC3/SCK/SCL14I/OSTRC3 can also be the synchronous ser ial clock input/output
for both SPI and I
2
C modes.
RC4/SDI/SDA15I/OSTRC4 can also be the SPI Data In (SPI mode) or
data I/O (I2C mode).
RC5/SDO16I/OSTRC5 can also be the SPI Data Out (SPI mode).
RC6/TX/CK
RC7/RX/DT
(2)
(2)
17I/OSTRC6 can also be the USART Asynchronous Transmit
Synchronous Clock
18I/OSTRC7 can also be the USART Asynchronous Receive
Synchronous Data
(2)
.
(2)
.
(2)
or
(2)
or
VSS8,19P—Ground reference for logic and I/O pins.
VDD20P—Positive supply for logic and I/O pins.
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: Pin functions T1OSO and T1OSI are reversed on the PIC16C62.
2: The USART and CCP2 are not available on the PIC16C62/62A/R62.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
4: This buffer is a Schmitt Trigger input when configured as the external interrupt.
5: This buffer is a Schmitt Trigger input when used in serial programming mode.
OSC2/CLKOUT141531O—Oscillator crystal output. Connects to crystal or resonator in
crystal oscillator mode. In RC mode, the pin outputs CLKOUT which has 1/4 the frequency of OSC1, and denotes the
instruction cycle rate.
MCLR
/VPP
1218I/PSTMaster clear reset input or programming voltage input. This
pin is an active low reset to the device.
PORTA is a bi-directional I/O port.
RA02319I/OTTL
RA13420I/OTTL
RA24521I/OTTL
RA35622I/OTTL
RA4/T0CKI6723I/OSTRA4 can also be the clock input to the Timer0
timer/counter. Output is open drain type.
RA5/SS7824I/OTTLRA5 can also be the slave select for the synchronous
serial port.
PORTB is a bi-directional I/O port. PORTB can be software
programmed for internal weak pull-up on all inputs.
RB0/INT33368I/OTTL/ST
(4)
RB0 can also be the external interrupt pin.
RB134379I/OTTL
RB2353810I/OTTL
RB3363911I/OTTL
RB4374114I/OTTLInterrupt on change pin.
RB5384215I/OTTLInterrupt on change pin.
RB6394316I/OTTL/ST
RB7404417I/OTTL/ST
(5)
(5)
Interrupt on change pin. Serial programming clock.
Interrupt on change pin. Serial programming data.
PORTC is a bi-directional I/O port.
RC0/T1OSO
(1)
/T1CKI151632I/OSTRC0 can also be the Timer1 oscillator output
(1)
Timer1 clock input.
RC1/T1OSI
(1)
/CCP2
(2)
161835I/OSTRC1 can also be the Timer1 oscillator input
Capture2 input/Compare2 output/PWM2 output
(1)
or
(2)
.
RC2/CCP1171936I/OSTRC2 can also be the Capture1 input/Compare1 out-
put/PWM1 output.
RC3/SCK/SCL182037I/OSTRC3 can also be the synchronous serial clock input/out-
put for both SPI and I
2
C modes.
RC4/SDI/SDA232542I/OSTRC4 can also be the SPI Data In (SPI mode) or
data I/O (I2C mode).
RC5/SDO242643I/OSTRC5 can also be the SPI Data Out (SPI mode).
RC6/TX/CK
RC7/RX/DT
(2)
(2)
252744I/OSTRC6 can also be the USART Asynchronous Transmit
or Synchronous Clock
26291I/OSTRC7 can also be the USART Asynchronous Receive
or Synchronous Data
(2)
.
(2)
.
(2)
(2)
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: Pin functions T1OSO and T1OSI are reversed on the PIC16C64.
2: CCP2 and the USART are not available on the PIC16C64/64A/R64.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
4: This buffer is a Schmitt Trigger input when configured as the external interrupt.
5: This buffer is a Schmitt Trigger input when used in serial programming mode.
6: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel Slav e
Port mode (for interfacing to a microprocessor bus).
RE0 can also be read control for the parallel slav e port.
RE1 can also be write control for the parallel slave port.
RE2 can also be select control for the parallel slav e port.
VSS12,31 13,346,29P—Ground reference for logic and I/O pins.
VDD11,3212,357,28P—Positive supply for logic and I/O pins.
NC—1,17,
28,40
12,13,
33,34
——These pins are not internally connected. These pins should
be left unconnected.
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: Pin functions T1OSO and T1OSI are reversed on the PIC16C64.
2: CCP2 and the USART are not available on the PIC16C64/64A/R64.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
4: This buffer is a Schmitt Trigger input when configured as the external interrupt.
5: This buffer is a Schmitt Trigger input when used in serial programming mode.
6: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel Slav e
Port mode (for interfacing to a microprocessor bus).
1997 Microchip Technology Inc.DS30234D-page 17
PIC16C6X
3.1Clocking Scheme/Instruction Cycle
The clock input (from OSC1) is internally divided by
four to generate four non-overlapping quadrature
clocks namely Q1, Q2, Q3, and Q4. Internally, the program counter (PC) is incremented every Q1, the
instruction is fetched from the program memory and
latched into the instruction register in Q4. The instr uction is decoded and executed during the following Q1
through Q4. The clock and instruction execution flow is
shown in Figure 3-5.
FIGURE 3-5:CLOCK/INSTRUCTION CYCLE
Q2Q3Q4
OSC1
Q1
Q2
Q3
Q4
(Program counter)
OSC2/CLKOUT
PC
(RC mode)
Q1
PCPC+1PC+2
Fetch INST (PC)
Execute INST (PC-1)
Q1
3.2Instruction Flow/Pipelining
An “Instruction Cycle” consists of four Q cycles (Q1,
Q2, Q3, and Q4). The instruction fetch and execute are
pipelined such that fetch takes one instruction cycle
while decode and execute takes another instruction
cycle. However, due to the pipelining, each instruction
effectively executes in one cycle. If an instruction
causes the program counter to change (e.g. GOTO)
then two cycles are required to complete the instruction
(Example 3-1).
A fetch cycle begins with the program counter (PC)
incrementing in Q1.
In the execution cycle , the fetched instruction is latched
into the “Instruction Register (IR)” in cycle Q1. This
instruction is then decoded and executed during the
Q2, Q3, and Q4 cycles. Data memory is read during Q2
(operand read) and written during Q4 (destination
write).
All instructions are single cycle, except for any program branches. These take two cycles since the fetch
instruction is “flushed” from the pipeline while the new instruction is being fetched and then executed.
DS30234D-page 18 1997 Microchip Technology Inc.
Fetch 1Execute 1
Fetch 2Execute 2
Fetch 3Execute 3
Fetch 4Flush
Fetch SUB_1 Execute SUB_1
PIC16C6X
4.0MEMORY ORGANIZATION
Applicable Devices
61 62 62A R62 63 R63 64 64A R64 65 65A R65 66 67
4.1Program Memory Organization
The PIC16C6X family has a 13-bit program counter
capable of addressing an 8K x 14 program memory
space. The amount of program memory available to
each device is listed below:
Device
PIC16C611K x 140000h-03FFh
PIC16C622K x 140000h-07FFh
PIC16C62A2K x 140000h-07FFh
PIC16CR622K x 140000h-07FFh
PIC16C634K x 140000h-0FFFh
PIC16CR634K x 140000h-0FFFh
PIC16C642K x 140000h-07FFh
PIC16C64A2K x 140000h-07FFh
PIC16CR642K x 140000h-07FFh
PIC16C654K x 140000h-0FFFh
PIC16C65A4K x 140000h-0FFFh
PIC16CR654K x 140000h-0FFFh
PIC16C668K x 140000h-1FFFh
PIC16C678K x 140000h-1FFFh
For those devices with less than 8K program memory,
accessing a location above the physically implemented
address will cause a wraparound.
The reset vector is at 0000h and the interrupt vector is
at 0004h.
FIGURE 4-1:PIC16C61 PROGRAM
CALL, RETURN
RETFIE, RETLW
Space
User Memory
Program
Memory
Address Range
MEMORY MAP AND STACK
PC<12:0>
Stack Level 1
Stack Level 8
Reset Vector
Peripheral Interrupt Vector
On-chip Program
Memory
13
•
•
•
0000h
0004h
0005h
03FFh
0400h
FIGURE 4-2:PIC16C62/62A/R62/64/64A/
R64 PROGRAM MEMORY
MAP AND STACK
CALL, RETURN
RETFIE, RETLW
Peripheral Interrupt Vector
Space
User Memory
PC<12:0>
Stack Level 1
Stack Level 8
Reset Vector
On-chip Program
Memory
13
•
•
•
0000h
0004h
0005h
07FFh
0800h
1FFFh
FIGURE 4-3:PIC16C63/R63/65/65A/R65
PROGRAM MEMORY MAP
AND STACK
CALL, RETURN
RETFIE, RETLW
Peripheral Interrupt Vector
Space
User Memory
PC<12:0>
Stack Level 1
•
•
•
Stack Level 8
Reset Vector
On-chip Program
Memory (Page 0)
On-chip Program
Memory (Page 1)
13
0000h
0004h
0005h
07FFh
0800h
0FFFh
1000h
1FFFh
1FFFh
1997 Microchip Technology Inc.DS30234D-page 19
PIC16C6X
FIGURE 4-4:PIC16C66/67 PROGRAM
MEMORY MAP AND STACK
CALL, RETURN
RETFIE, RETLW
Peripheral Interrupt Vector
Space
User Memory
PC<12:0>
Stack Level 1
•
•
•
Stack Level 8
Reset Vector
On-chip Program
Memory (Page 0)
On-chip Program
Memory (Page 1)
On-chip Program
Memory (Page 2)
On-chip Program
Memory (Page 3)
13
0000h
0004h
0005h
07FFh
0800h
0FFFh
1000h
17FFh
1800h
1FFFh
4.2Data Memory Organization
Applicable Devices
61 62 62A R62 63 R63 64 64A R64 65 65A R65 66 67
The data memory is partitioned into multiple banks
which contain the General Purpose Registers and the
Special Function Registers. Bits RP1 and RP0 are the
bank select bits.
Each bank extends up to 7Fh (128 bytes). The lower
locations of each bank are reserved for the Special
Function Registers. Above the Special Function Registers are General Purpose Registers, implemented as
static RAM. All implemented banks contain special
function registers. Some “high use” special function
registers from one bank may be mirrored in another
bank for code reduction and quicker access.
For the PIC16C61, general purpose register locations
8Ch-AFh of Bank 1 are not physically implemented.
These locations are mapped into 0Ch-2Fh of Bank 0.
FIGURE 4-5:PIC16C61 REGISTER FILE
MAP
File Address
(1)
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
2Fh
30h
7Fh
Unimplemented data memory location; read as '0'.
Note 1: Not a physical register.
INDF
TMR0OPTION
PCL
STATUS
FSR
PORTA
PORTB
PCLATH
INTCON
General
Purpose
Register
Bank 0
2: These locations are unimplemented in
Bank 1. Any access to these locations will
access the corresponding Bank 0 register.
INDF
PCL
STATUS
FSR
TRISA
TRISB
PCLATH
INTCON
Mapped
in Bank 0
Bank 1
File Address
(1)
(2)
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
AFh
B0h
FFh
4.2.1GENERAL PURPOSE REGISTERS
These registers are accessed either directly or indi-
rectly through the File Select Register (FSR)
(Section 4.5).
*Not a physical register.
These registers are not implemented on the PIC16C66.
General
Purpose
Register
General
Purpose
Register
General
Purpose
Register
80 Bytes80 Bytes80 Bytes
accesses
70h-7Fh
in Bank 0
Bank 1
EFh
F0h
FFh
accesses
70h-7Fh
in Bank 0
Bank 2
16Fh
170h
17Fh
accesses
70h-7Fh
in Bank 0
Bank 3
1EFh
1F0h
1FFh
Note:The upper 16 bytes of data memory in banks 1, 2, and 3 are mapped in Bank 0. This ma y require
relocation of data memory usage in the user application code if upgrading to the PIC16C66/67.
DS30234D-page 22 1997 Microchip Technology Inc.
PIC16C6X
4.2.2SPECIAL FUNCTION REGISTERS:
The special function registers can be classified into two
sets (core and peripheral). The registers associated
The Special Function Registers are registers used by
the CPU and peripheral modules for controlling the
desired operation of the device. These registers are
implemented as static RAM.
with the “core” functions are described in this section
and those related to the operation of the peripheral features are described in the section of that peripheral feature.
TABLE 4-1:SPECIAL FUNCTION REGISTERS FOR THE PIC16C61
Write Buffer for the upper 5 bits of the Program Counter
——
——
---0 0000 ---0 0000
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented locations read as '0'.
Shaded locations are unimplemented and read as ‘0’
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose con-
tents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer Reset.
4: The IRP and RP1 bits are reserved on the PIC16C61, always maintain these bits clear.
Value on
all other
resets
(3)
1997 Microchip Technology Inc.DS30234D-page 23
PIC16C6X
TABLE 4-2:SPECIAL FUNCTION REGISTERS FOR THE PIC16C62/62A/R62
05hPORTA
06hPORTBPORTB Data Latch when written: PORTB pins when readxxxx xxxx uuuu uuuu
07hPORTCPORTC Data Latch when written: PORTC pins when readxxxx xxxx uuuu uuuu
08h—Unimplemented——
09h—Unimplemented——
0Ah
0Bh
0ChPIR1
0Dh—Unimplemented——
0EhTMR1LHolding register for the Least Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
0FhTMR1HHolding register for the Most Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
10hT1CON——T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
11hTMR2Timer2 module’s register0000 0000 0000 0000
12hT2CON—TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
13hSSPBUFSynchronous Serial Port Receive Buffer/Transmit Registerxxxx xxxx uuuu uuuu
14hSSPCONWCOLSSPOVSSPENCKPSSPM3SSPM2SSPM1SSPM00000 0000 0000 0000
15hCCPR1LCapture/Compare/PWM1 (LSB)xxxx xxxx uuuu uuuu
16hCCPR1HCapture/Compare/PWM1 (MSB)xxxx xxxx uuuu uuuu
17hCCP1CON——CCP1XCCP1YCCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
18h-1Fh
INDFAddressing this location uses contents of FSR to address data memory (not a physical register)0000 0000 0000 0000
(1)
PCLProgram Counter's (PC) Least Significant Byte0000 0000 0000 0000
(1)
STATUS
(1)
FSRIndirect data memory address pointerxxxx xxxx uuuu uuuu
Write Buffer for the upper 5 bits of the Program Counter
---0 0000 ---0 0000
——
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The BOR bit is reserved on the PIC16C62, always maintain this bit set.
5: The IRP and RP1 bits are reserved on the PIC16C62/62A/R62, always maintain these bits clear.
6: PIE1<7:6> and PIR1<7:6> are reserved on the PIC16C62/62A/R62, always maintain these bits clear.
Value on
all other
resets
(3)
DS30234D-page 24 1997 Microchip Technology Inc.
PIC16C6X
TABLE 4-2:SPECIAL FUNCTION REGISTERS FOR THE PIC16C62/62A/R62 (Cont.’d)
85hTRISA
86hTRISBPORTB Data Direction Register1111 1111 1111 1111
87hTRISCPORTC Data Direction Register1111 1111 1111 1111
88h—Unimplemented——
89h—Unimplemented——
Write Buffer for the upper 5 bits of the Program Counter
BOR
2
C mode) Address Register
Value on:
POR,
BOR
---0 0000 ---0 0000
(4)
---- --qq ---- --uu
0000 0000 0000 0000
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR
and the Watchdog Timer reset.
4: The BOR bit is reserved on the PIC16C62, always maintain this bit set.
5: The IRP and RP1 bits are reserved on the PIC16C62/62A/R62, always maintain these bits clear.
6: PIE1<7:6> and PIR1<7:6> are reserved on the PIC16C62/62A/R62, always maintain these bits clear.
Value on
all other
(3)
resets
1997 Microchip Technology Inc.DS30234D-page 25
PIC16C6X
TABLE 4-3:SPECIAL FUNCTION REGISTERS FOR THE PIC16C63/R63
05hPORTA
06hPORTBPORTB Data Latch when written: PORTB pins when readxxxx xxxx uuuu uuuu
07hPORTCPORTC Data Latch when written: PORTC pins when readxxxx xxxx uuuu uuuu
08h—Unimplemented——
09h—Unimplemented——
0Ah
0Bh
0ChPIR1
0DhPIR2
0EhTMR1LHolding register for the Least Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
0FhTMR1HHolding register for the Most Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
10hT1CON
11hTMR2Timer2 module’s register0000 0000 0000 0000
12hT2CON—TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
13hSSPBUFSynchronous Serial Port Receive Buffer/Transmit Registerxxxx xxxx uuuu uuuu
14hSSPCONWCOLSSPOVSSPENCKPSSPM3SSPM2SSPM1SSPM00000 0000 0000 0000
15hCCPR1LCapture/Compare/PWM1 (LSB)xxxx xxxx uuuu uuuu
16hCCPR1HCapture/Compare/PWM1 (MSB)xxxx xxxx uuuu uuuu
17hCCP1CON——CCP1XCCP1YCCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
Write Buffer for the upper 5 bits of the Program Counter
RCIFTXIF
SSPIFCCP1IFTMR2IFTMR1IF 0000 0000 0000 0000
—FERROERRRX9D0000 -00x 0000 -00x
---0 0000 ---0 0000
——
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The IRP and RP1 bits are reserved on the PIC16C63/R63, always maintain these bits clear.
5: PIE1<7:6> and PIR1<7:6> are reserved on the PIC16C63/R63, always maintain these bits clear.
Value on
all other
(3)
resets
1997 Microchip Technology Inc.DS30234D-page 26
PIC16C6X
TABLE 4-3:SPECIAL FUNCTION REGISTERS FOR THE PIC16C63/R63 (Cont.’d)
85hTRISA
86hTRISBPORTB Data Direction Register1111 1111 1111 1111
87hTRISCPORTC Data Direction Register1111 1111 1111 1111
88h—Unimplemented——
89h—Unimplemented——
Write Buffer for the upper 5 bits of the Program Counter
RCIETXIE
2
C mode) Address Register
SSPIECCP1IETMR2IETMR1IE 0000 0000 0000 0000
Value on:
POR,
BOR
---0 0000 ---0 0000
0000 0000 0000 0000
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The IRP and RP1 bits are reserved on the PIC16C63/R63, always maintain these bits clear.
5: PIE1<7:6> and PIR1<7:6> are reserved on the PIC16C63/R63, always maintain these bits clear.
Value on
all other
(3)
resets
1997 Microchip Technology Inc.DS30234D-page 27
PIC16C6X
TABLE 4-4:SPECIAL FUNCTION REGISTERS FOR THE PIC16C64/64A/R64
05hPORTA
06hPORTBPORTB Data Latch when written: PORTB pins when readxxxx xxxx uuuu uuuu
07hPORTCPORTC Data Latch when written: PORTC pins when readxxxx xxxx uuuu uuuu
08h
09h
0Ah
0Bh
0ChPIR1
0Dh—Unimplemented——
0EhTMR1LHolding register for the Least Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
0FhTMR1HHolding register for the Most Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
10hT1CON——T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
11hTMR2Timer2 module’s register0000 0000 0000 0000
12hT2CON
13hSSPBUFSynchronous Serial Port Receive Buffer/Transmit Registerxxxx xxxx uuuu uuuu
14hSSPCONWCOLSSPOVSSPENCKPSSPM3SSPM2SSPM1SSPM00000 0000 0000 0000
15hCCPR1LCapture/Compare/PWM1 (LSB)xxxx xxxx uuuu uuuu
16hCCPR1HCapture/Compare/PWM1 (MSB)xxxx xxxx uuuu uuuu
17hCCP1CON——CCP1XCCP1YCCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
18h-1Fh
INDFAddressing this location uses contents of FSR to address data memory (not a physical register)0000 0000 0000 0000
(1)
PCLProgram Counter's (PC) Least Significant Byte0000 0000 0000 0000
(1)
STATUS
(1)
FSRIndirect data memory address pointerxxxx xxxx uuuu uuuu
Write Buffer for the upper 5 bits of the Program Counter
---0 0000 ---0 0000
——
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The BOR bit is reserved on the PIC16C64, always maintain this bit set.
5: The IRP and RP1 bits are reserved on the PIC16C64/64A/R64, always maintain these bits clear.
6: PIE1<6> and PIR1<6> are reserved on the PIC16C64/64A/R64, always maintain these bits clear.
Value on
all other
resets
(3)
DS30234D-page 28 1997 Microchip Technology Inc.
PIC16C6X
TABLE 4-4:SPECIAL FUNCTION REGISTERS FOR THE PIC16C64/64A/R64 (Cont.’d)
——PORTA Data Direction Register--11 1111 --11 1111
PORTD Data Direction Register1111 1111 1111 1111
IBFOBFIBOVPSPMODE
PSPIE
——————POR
Synchronous Serial Port (I
(5)
RP1
(6)——SSPIECCP1IETMR2IETMR1IE 00-- 0000 00-- 0000
RP0TOPDZDCC0001 1xxx 000q quuu
—PORTE Data Direction Bits0000 -111 0000 -111
Write Buffer for the upper 5 bits of the Program Counter
BOR
2
C mode) Address Register
Value on:
POR,
BOR
---0 0000 ---0 0000
(4)
---- --qq ---- --uu
0000 0000 0000 0000
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The BOR bit is reserved on the PIC16C64, always maintain this bit set.
5: The IRP and RP1 bits are reserved on the PIC16C64/64A/R64, always maintain these bits clear.
6: PIE1<6> and PIR1<6> are reserved on the PIC16C64/64A/R64, always maintain these bits clear.
Value on
all other
(3)
resets
1997 Microchip Technology Inc.DS30234D-page 29
PIC16C6X
TABLE 4-5:SPECIAL FUNCTION REGISTERS FOR THE PIC16C65/65A/R65
05hPORTA
06hPORTBPORTB Data Latch when written: PORTB pins when readxxxx xxxx uuuu uuuu
07hPORTCPORTC Data Latch when written: PORTC pins when readxxxx xxxx uuuu uuuu
08h
09h
0Ah
0Bh
0ChPIR1
0DhPIR2
0EhTMR1LHolding register for the Least Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
0FhTMR1HHolding register for the Most Significant Byte of the 16-bit TMR1 registerxxxx xxxx uuuu uuuu
10hT1CON
11hTMR2Timer2 module’s register0000 0000 0000 0000
12hT2CON—TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
13hSSPBUFSynchronous Serial Port Receive Buffer/Transmit Registerxxxx xxxx uuuu uuuu
14hSSPCONWCOLSSPOVSSPENCKPSSPM3SSPM2SSPM1SSPM00000 0000 0000 0000
15hCCPR1LCapture/Compare/PWM1 (LSB)xxxx xxxx uuuu uuuu
16hCCPR1HCapture/Compare/PWM1 (MSB)xxxx xxxx uuuu uuuu
17hCCP1CON——CCP1XCCP1YCCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
Write Buffer for the upper 5 bits of the Program Counter
RCIFTXIF
SSPIFCCP1IFTMR2IFTMR1IF 0000 0000 0000 0000
—FERROERRRX9D0000 -00x 0000 -00x
---0 0000 ---0 0000
——
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented location read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: These registers can be addressed from either bank.
2: The upper byte of the Program Counter (PC) is not directly accessible. PCLATH is a holding register for the PC whose
contents are transferred to the upper byte of the program counter. (PC<12:8>)
3: Other (non power-up) resets include external reset through MCLR and the Watchdog Timer reset.
4: The BOR bit is reserved on the PIC16C65, always maintain this bit set.
5: The IRP and RP1 bits are reserved on the PIC16C65/65A/R65, always maintain these bits clear.
6: PIE1<6> and PIR1<6> are reserved on the PIC16C65/65A/R65, always maintain these bits clear.
Value on
all other
resets
(3)
DS30234D-page 30 1997 Microchip Technology Inc.
Loading...
+ 306 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.