V
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
RC7/RX/DT
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
V
VDD
RB0/INT
RB1
RB2
RB3
SS
4443424140393837363534
1
2
3
4
5
PIC16C74A
6
7
PIC16C77
8
9
10
11
NC
NC
RB7
RB6
RB5
RB4
/VPP
MCLR
RA2/AN2
RA1/AN1
RA0/AN0
NC
33
32
RC0/T1OSO/T1CKI
31
OSC2/CLKOUT
30
OSC1/CLKIN
29
28
27
26
25
24
23
2221201918171615141312
RA3/AN3/VREF
SS
V
VDD
RE2/CS/AN7
RE1/WR
/AN6
/AN5
RE0/RD
/AN4
RA5/SS
RA4/T0CKI
1997 Microchip Technology Inc.DS30390E-page 3
PIC16C7X
Table of Contents
1.0 General Description....................................................................................................................................................................... 5
11.0 Synchronous Serial Port (SSP) Module....................................................................................................................................... 77
14.0 Special Features of the CPU ..................................................................................................................................................... 129
15.0 Instruction Set Summary............................................................................................................................................................ 147
16.0 Development Support................................................................................................................................................................ 163
17.0 Electrical Characteristics for PIC16C72..................................................................................................................................... 167
18.0 Electrical Characteristics for PIC16C73/74................................................................................................................................ 183
19.0 Electrical Characteristics for PIC16C73A/74A........................................................................................................................... 201
20.0 Electrical Characteristics for PIC16C76/77................................................................................................................................ 219
21.0 DC and AC Characteristics Graphs and Tables ........................................................................................................................ 241
Index .................................................................................................................................................................................................. 273
List of Examples................................................................................................................................................................................. 279
List of Figures..................................................................................................................................................................................... 280
List of Tables...................................................................................................................................................................................... 283
For register and module descriptions in this data sheet, device legends show which devices apply to those sections. As
an example, the legend below would mean that the following section applies only to the PIC16C72, PIC16C73A and
PIC16C74A devices.
Applicable Devices
73 73A 74 74A 76 77
72
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.
DS30390E-page 4
1997 Microchip Technology Inc.
PIC16C7X
1.0GENERAL DESCRIPTION
The PIC16C7X is a family of
mance, CMOS, fully-static, 8-bit microcontrollers with
integrated analog-to-digital (A/D) converters, in the
PIC16CXX mid-range family.
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
the 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 PIC16C72 has 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 Port can be configured as either a 3-wire Serial
Peripheral Interface (SPI) or the two-wire Inter-Integrated Circuit (I
8-bit A/D is provided. The 8-bit resolution is ideally
suited for applications requiring low-cost analog interface, e.g. thermostat control, pressure sensing, etc.
The PIC16C73/73A devices have 192 bytes of RAM,
while the PIC16C76 has 368 byes of RAM. Each de vice
has 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
chronous Asynchronous Receiver Transmitter
(USART) is also known as the Serial Communications
Interface or SCI. Also a 5-channel high-speed 8-bit A/
D is provided.The 8-bit resolution is ideally suited for
applications requiring low-cost analog interface, e.g.
thermostat control, pressure sensing, etc.
The PIC16C74/74A devices have 192 bytes of RAM,
while the PIC16C77 has 368 bytes of RAM. Each
device has 33 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
versal Synchronous Asynchronous Receiver Transmitter (USART) is also known as the Serial
Communications Interface or SCI. An 8-bit Parallel
Slave Port is provided. Also an 8-channel high-speed
2
C) bus. Also a 5-channel high-speed
low-cost, high-perfor-
2
C) bus. The Universal Syn-
2
C) bus. The Uni-
8-bit A/D is provided. The 8-bit resolution is ideally
suited for applications requiring low-cost analog interface, e.g. thermostat control, pressure sensing, etc.
The PIC16C7X family has 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) feature provides a power saving
mode. The user can wake up 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-TimeProgrammable (OTP) version is suitable for production
in any volume.
The PIC16C7X family fits perfectly in applications ranging from security and remote sensors to appliance control and automotive. 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 perf ormance, ease of use and I/O fle xibility
make the PIC16C7X 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 coprocessor applications).
1.1F
Users familiar with the PIC16C5X microcontroller family 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 the
PIC16C5X can be easily ported to the PIC16CXX family of devices (Appendix B).
1.2De
PIC16C7X devices are supported by the complete line
of Microchip Development tools.
Please refer to Section 16.0 for more details about
Microchip’s development tools.
amily and Upward Compatibility
velopment Support
1997 Microchip Technology Inc.DS30390E-page 5
PIC16C7X
TABLE 1-1:PIC16C7XX FAMILY OF DEVCES
PIC16C710
Clock
Memory
Peripherals
Features
Maximum Frequency
of Operation (MHz)
EPROM Program Memory
(x14 words)
ROM Program Memory
(14K words)
Data Memory (bytes)363668128128128
Timer Module(s)TMR0TMR0TMR0TMR0TMR0,
Capture/Compare/
PWM Module(s)
Serial Port(s)
2
(SPI/I
C, USART)
Parallel Slave Port——————
A/D Converter (8-bit) Channels 444455
Interrupt Sources444488
I/O Pins131313132222
Voltage Range (Volts)3.0-6.03.0-6.03.0-6.03.0-5.52.5-6.03.0-5.5
In-Circuit Serial Programming YesYesYesYesYesYes
Brown-out ResetYes—YesYesYesYes
Packages18-pin DIP,
202020202020
5121K1K2K2K—
—————2K
————1 1
————SPI/I
18-pin DIP,
SOIC;
SOIC
20-pin SSOP
PIC16C71 PIC16C711 PIC16C715PIC16C72 PIC16CR72
TMR0,
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
TMR1,
TMR2
2
CSPI/I
28-pin SDIP,
SOIC, SSOP
TMR1,
TMR2
2
C
28-pin SDIP,
SOIC, SSOP
(1)
PIC16C74APIC16C76PIC16C77
Clock
Memory
Maximum Frequency of Operation (MHz)
EPROM Program Memory
(x14 words)
PIC16C73A
20202020
4K4K8K8K
Data Memory (bytes)192192368368
Peripherals
Timer Module(s)TMR0,
TMR1,
TMR2
Capture/Compare/PWM Mod-
2222
ule(s)
2
Serial Port(s) (SPI/I
C, US-
SPI/I
2
C, USARTSPI/I
TMR0,
TMR1,
TMR2
2
C, USARTSPI/I
TMR0,
TMR1,
TMR2
2
C, USARTSPI/I
TMR0,
TMR1,
TMR2
2
C, USART
ART)
Parallel Slave Port—Yes—Yes
A/D Converter (8-bit) Channels 5858
Interrupt Sources11121112
I/O Pins22332233
Voltage Range (Volts)2.5-6.02.5-6.02.5-6.02.5-6.0
Features
In-Circuit Serial Programming YesYesYesYes
Brown-out ResetYesYesYesYes
Packages28-pin SDIP,
SOIC
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
28-pin SDIP,
SOIC
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
All PIC16/17 Family devices ha ve Pow er-on Reset, selectab le Watchdog Timer, selectab le code protect and high I/O current capability. All PIC16C7XX Family devices use serial programming with clock pin RB6 and data pin RB7.
Note 1: Please contact your local Microchip sales office for availability of these devices.
DS30390E-page 6
1997 Microchip Technology Inc.
PIC16C7X
2.0PIC16C7X 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 PIC16C7X 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 PIC16C7X family, there are two device “types”
as indicated in the device number:
1. C , as in PIC16 C 74. These devices have
EPROM type memory and operate over the
standard voltage range.
2. LC , as in PIC16 LC 74. These devices have
EPROM type memory and operate over an
extended voltage range.
2.1UV Erasab
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
PIC16C7X.
le Devices
Plus and PRO MATE
2.3Q
uick-Turnaround-Production (QTP)
Devices
Microchip offers a QTP Programming Service for factory production orders. This service 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.4Serializ
Production (SQTP
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.
II
ed Quick-Turnaround
SM
Devices
)
2.2O
ne-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.
1997 Microchip Technology Inc.DS30390E-page 7
PIC16C7X
NOTES:
DS30390E-page 8
1997 Microchip Technology Inc.
PIC16C7X
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 v on Neumann architecture in which program and data are fetched from the same memory
using the same bus. Separating program and data
buses further allows instructions to be sized differently
than the 8-bit wide data word. 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 (35)
execute in a single cycle (200 ns @ 20 MHz) e xcept f or
program branches.
The table below lists program memory (EPROM) and
data memory (RAM) for each PIC16C7X device.
Device
PIC16C722K x 14128 x 8
PIC16C734K x 14192 x 8
PIC16C73A4K x 14192 x 8
PIC16C744K x 14192 x 8
PIC16C74A4K x 14192 x 8
PIC16C768K x 14368 x 8
PIC16C778K x 14386 x 8
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’ make programming with the
PIC16CXX simple yet efficient. In addition, the learning
curve is reduced significantly.
Program
Memory
Data Memory
PIC16CXX devices contain an 8-bit ALU and working
register. The ALU is a general purpose arithmetic unit.
It performs arithmetic and Boolean functions between
the 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 on the instruction executed, the ALU may
affect the values of the Carry (C), Digit Carry (DC), and
Zero (Z) bits in the STATUS register. The C and DC bits
operate as a borro
respectively, in subtraction. See the SUBLW and SUBWF
instructions for examples.
Note 1: Higher order bits are from the STATUS register.
2: Brown-out Reset is not available on the PIC16C74.
Parallel Slave Port
A/DTimer0Timer1Timer2
USART
PORTE
RE0/RD
RE1/WR
RE2/CS
/AN5
/AN6
/AN7
DS30390E-page 12 1997 Microchip Technology Inc.
PIC16C7X
TABLE 3-1:PIC16C72 PINOUT DESCRIPTION
DIP
Pin Name
OSC1/CLKIN999I
OSC2/CLKOUT101010O—Oscillator crystal output. Connects to crystal or resonator in
MCLR
/VPP
RA0/AN0222I/OTTLRA0 can also be analog input0
RA1/AN1333I/OTTLRA1 can also be analog input1
RA2/AN2444I/OTTLRA2 can also be analog input2
RA3/AN3/VREF555I/OTTLRA3 can also be analog input3 or analog reference voltage
RA4/T0CKI666I/OSTRA4 can also be the clock input to the Timer0 module.
RA5/SS/AN4777I/OTTLRA5 can also be analog input4 or the slave select for the
RB0/INT212121I/OTTL/ST
RB1222222I/OTTL
RB2232323I/OTTL
RB3242424I/OTTL
RB4252525I/OTTLInterrupt on change pin.
RB5262626I/OTTLInterrupt on change pin.
RB6272727I/OTTL/ST
RB7282828I/OTTL/ST
RC0/T1OSO/T1CKI111111I/OSTRC0 can also be the Timer1 oscillator output or Timer1
RC1/T1OSI121212I/OSTRC1 can also be the Timer1 oscillator input.
RC2/CCP1131313I/OSTRC2 can also be the Capture1 input/Compare1 output/
RC3/SCK/SCL141414I/OSTRC3 can also be the synchronous serial clock input/output
RC4/SDI/SDA151515I/OSTRC4 can also be the SPI Data In (SPI mode) or
RC5/SDO161616I/OSTRC5 can also be the SPI Data Out (SPI mode).
RC6171717I/OST
RC7181818I/OST
VSS8, 198, 198, 19P—Ground reference for logic and I/O pins.
VDD202020P—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 as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in serial programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
SSOP
Pin#
Pin#
111I/PSTMaster clear (reset) input or programming voltage input. This
crystal oscillator mode. In RC mode, the OSC2 pin outputs
CLKOUT which has 1/4 the frequency of OSC1, and denotes
the instruction cycle rate.
pin is an active low reset to the device.
PORTA is a bi-directional I/O port.
Output is open drain type.
synchronous serial port.
PORTB is a bi-directional I/O port. PORTB can be software
programmed for internal weak pull-up on all inputs.
(1)
(2)
(2)
RB0 can also be the external interrupt pin.
Interrupt on change pin. Serial programming clock.
Interrupt on change pin. Serial programming data.
PORTC is a bi-directional I/O port.
clock input.
PWM1 output.
2
for both SPI and I
data I/O (I2C mode).
C modes.
1997 Microchip Technology Inc.DS30390E-page 13
PIC16C7X
TABLE 3-2:PIC16C73/73A/76 PINOUT DESCRIPTION
Pin Name
OSC1/CLKIN99I
OSC2/CLKOUT1010O—Oscillator crystal output. Connects to crystal or resonator in
MCLR
/VPP
RA0/AN022I/OTTLRA0 can also be analog input0
RA1/AN133I/OTTLRA1 can also be analog input1
RA2/AN244I/OTTLRA2 can also be analog input2
RA3/AN3/VREF55I/OTTLRA3 can also be analog input3 or analog reference voltage
RA4/T0CKI66I/OSTRA4 can also be the clock input to the Timer0 module.
RA5/SS/AN477I/OTTLRA5 can also be analog input4 or the slave select for the
RB0/INT2121I/OTTL/ST
RB12222I/OTTL
RB22323I/OTTL
RB32424I/OTTL
RB42525I/OTTLInterrupt on change pin.
RB52626I/OTTLInterrupt on change pin.
RB62727I/OTTL/ST
RB72828I/OTTL/ST
RC0/T1OSO/T1CKI1111I/OSTRC0 can also be the Timer1 oscillator output or Timer1
RC1/T1OSI/CCP21212I/OSTRC1 can also be the Timer1 oscillator input or Capture2
RC2/CCP11313I/OSTRC2 can also be the Capture1 input/Compare1 output/
RC3/SCK/SCL1414I/OSTRC3 can also be the synchronous serial clock input/output
RC4/SDI/SDA1515I/OSTRC4 can also be the SPI Data In (SPI mode) or
RC5/SDO1616I/OSTRC5 can also be the SPI Data Out (SPI mode).
RC6/TX/CK1717I/OSTRC6 can also be the USART Asynchronous Transmit or
RC7/RX/DT1818I/OSTRC7 can also be the USART Asynchronous Receive or
VSS8, 198, 19P—Ground reference for logic and I/O pins.
VDD2020P—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 as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in serial programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
crystal oscillator mode. In RC mode, the OSC2 pin outputs
CLKOUT which has 1/4 the frequency of OSC1, and denotes
the instruction cycle rate.
pin is an active low reset to the device.
PORTA is a bi-directional I/O port.
Output is open drain type.
synchronous serial port.
PORTB is a bi-directional I/O port. PORTB can be software
programmed for internal weak pull-up on all inputs.
(1)
(2)
(2)
RB0 can also be the external interrupt pin.
Interrupt on change pin. Serial programming clock.
Interrupt on change pin. Serial programming data.
PORTC is a bi-directional I/O port.
clock input.
input/Compare2 output/PWM2 output.
PWM1 output.
2
for both SPI and I
data I/O (I2C mode).
Synchronous Clock.
Synchronous Data.
C modes.
DS30390E-page 14 1997 Microchip Technology Inc.
PIC16C7X
TABLE 3-3:PIC16C74/74A/77 PINOUT DESCRIPTION
DIP
Pin Name
OSC1/CLKIN131430IST/CMOS
OSC2/CLKOUT141531O—Oscillator crystal output. Connects to crystal or resonator in
MCLR/VPP1218I/PSTMaster clear (reset) input or programming voltage input.
RA0/AN02319I/OTTLRA0 can also be analog input0
RA1/AN13420I/OTTLRA1 can also be analog input1
RA2/AN24521I/OTTLRA2 can also be analog input2
RA3/AN3/VREF5622I/OTTLRA3 can also be analog input3 or analog reference
RA4/T0CKI6723I/OSTRA4 can also be the clock input to the Timer0 timer/
RA5/SS/AN47824I/OTTLRA5 can also be analog input4 or the slave select for
RB0/INT33368I/OTTL/ST
RB134379I/OTTL
RB2353810I/OTTL
RB3363911I/OTTL
RB4374114I/OTTLInterrupt on change pin.
RB5384215I/OTTLInterrupt on change pin.
RB6394316I/OTTL/ST
RB7404417I/OTTL/ST
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: This buffer is a Schmitt Trigger input when configured as an external interrupt.
2: This buffer is a Schmitt Trigger input when used in serial programming mode.
3: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel
Slave Port mode (for interfacing to a microprocessor bus).
4: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
Note 1: This buffer is a Schmitt Trigger input when configured as an external interrupt.
2: This buffer is a Schmitt Trigger input when used in serial programming mode.
3: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel
Slave Port mode (for interfacing to a microprocessor bus).
4: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
QFP
Pin#
33,34
I/O/P
Type
Buffer
Type
Description
PORTC is a bi-directional I/O port.
Timer1 clock input.
Capture2 input/Compare2 output/PWM2 output.
PWM1 output.
output for both SPI and I2C modes.
data I/O (I2C mode).
(SPI mode).
Synchronous Clock.
Synchronous Data.
PORTD is a bi-directional I/O port or parallel slave port
when interfacing to a microprocessor bus.
(3)
(3)
(3)
(3)
(3)
(3)
(3)
(3)
PORTE is a bi-directional I/O port.
(3)
RE0 can also be read control for the parallel slav e port,
or analog input5.
(3)
RE1 can also be write control for the parallel slave port,
or analog input6.
(3)
RE2 can also be select control for the parallel slave
port, or analog input7.
—These pins are not internally connected. These pins should
be left unconnected.
DS30390E-page 16 1997 Microchip Technology Inc.
PIC16C7X
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 instruction is decoded and executed during the following Q1
through Q4. The clocks and instruction execution flow
is shown in Figure 3-4.
FIGURE 3-4:CLOCK/INSTRUCTION CYCLE
Q2Q3Q4
OSC1
Q1
Q2
Q3
Q4
PC
OSC2/CLKOUT
(RC mode)
Q1
PCPC+1PC+2
Fetch INST (PC)
Execute INST (PC-1)Fetch INST (PC+1)
Q1
3.2Instruction Flow/Pipelining
An “Instruction Cycle” consists of four Q cycles (Q1,
Q2, Q3 and Q4). The instr uction 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).
Q2Q3Q4
Execute INST (PC)Fetch INST (PC+2)
Q2Q3Q4
Q1
Execute INST (PC+1)
Internal
phase
clock
EXAMPLE 3-1:INSTRUCTION PIPELINE FLOW
Tcy0Tcy1Tcy2Tcy3Tcy4Tcy5
1. MOVLW 55h
2. MOVWF PORTB
3. CALL SUB_1
4. BSF PORTA, BIT3 (Forced NOP)
5. Instruction @ address SUB_1
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.
1997 Microchip Technology Inc.DS30390E-page 17
Fetch 1Execute 1
Fetch 2Execute 2
Fetch 3Execute 3
Fetch 4Flush
Fetch SUB_1 Execute SUB_1
PIC16C7X
NOTES:
DS30390E-page 18 1997 Microchip Technology Inc.
PIC16C7X
4.0MEMORY ORGANIZATION
Applicable Devices
72 73 73A 74 74A 76 77
4.1Program Memory Organization
The PIC16C7X 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
PIC16C722K x 140000h-07FFh
PIC16C734K x 140000h-0FFFh
PIC16C73A4K x 140000h-0FFFh
PIC16C744K x 140000h-0FFFh
PIC16C74A4K x 140000h-0FFFh
PIC16C768K x 140000h-1FFFh
PIC16C778K 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:PIC16C72 PROGRAM
CALL, RETURN
RETFIE, RETLW
Program
Memory
Address Range
MEMORY MAP AND STACK
PC<12:0>
13
FIGURE 4-2:PIC16C73/73A/74/74A
PROGRAM MEMORY MAP
AND STACK
PC<12:0>
CALL, RETURN
RETFIE, RETLW
Stack Level 1
Stack Level 8
Reset V ector
Interrupt Vector
On-chip Program
Memory (Page 0)
Space
User Memory
On-chip Program
Memory (Page 1)
13
0000h
0004h
0005h
07FFh
0800h
0FFFh
1000h
1FFFh
User Memory
Space
Stack Level 1
Stack Level 8
Reset V ector
Interrupt Vector
On-chip Program
Memory
0000h
0004h
0005h
07FFh
0800h
1FFFh
1997 Microchip Technology Inc.DS30390E-page 19
PIC16C7X
FIGURE 4-3:PIC16C76/77 PROGRAM
MEMORY MAP AND STACK
PC<12:0>
CALL, RETURN
RETFIE, RETLW
Space
User Memory
Stack Level 1
Stack Level 2
Stack Level 8
Reset V ector
Interrupt Vector
On-Chip
On-Chip
On-Chip
On-Chip
13
Page 0
Page 1
Page 2
Page 3
0000h
0004h
0005h
07FFh
0800h
0FFFh
1000h
17FFh
1800h
1FFFh
4.2Data Memory Organization
Applicable Devices
72 73 73A 74 74A 76 77
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.
4.2.1GENERAL PURPOSE REGISTER FILE
The register file can be accessed either directly , or indi-
rectly through the File Select Register FSR
(Section 4.5).
Note 1: PORTD, PORTE, TRISD, and TRISE are unimplemented on the PIC16C76, read as '0'.
General
Purpose
Register
General
Purpose
Register
General
Purpose
Register
80 Bytes80 Bytes80 Bytes
accesses
70h-7Fh
Bank 1
EFh
F0h
FFh
accesses
70h-7Fh
Bank 2
16Fh
170h
17Fh
accesses
70h - 7Fh
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 may require
relocation of data memory usage in the user application code if upgrading to the PIC16C76/77.
DS30390E-page 22 1997 Microchip Technology Inc.
PIC16C7X
4.2.2SPECIAL FUNCTION REGISTERS
The special function registers can be classified into two
sets (core and peripheral). Those 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:PIC16C72 SPECIAL FUNCTION REGISTER SUMMARY
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented 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 is not directly accessible. PCLATH is a holding register for the PC<12:8> whose
contents are transferred to the upper byte of the program counter.
3: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
4: The IRP and RP1 bits are reserved on the PIC16C72, always maintain these bits clear.
Value on all
other resets
(3)
1997 Microchip Technology Inc.DS30390E-page 23
PIC16C7X
TABLE 4-1:PIC16C72 SPECIAL FUNCTION REGISTER SUMMARY (Cont.’d)
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented 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 is not directly accessible. PCLATH is a holding register for the PC<12:8> whose
contents are transferred to the upper byte of the program counter.
3: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
4: The IRP and RP1 bits are reserved on the PIC16C72, always maintain these bits clear.
Value on all
other resets
(3)
DS30390E-page 24 1997 Microchip Technology Inc.
PIC16C7X
TABLE 4-2:PIC16C73/73A/74/74A SPECIAL FUNCTION REGISTER SUMMARY
tents are transferred to the upper byte of the program counter.
2: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A, always maintain these bits clear.
4: These registers can be addressed from either bank.
5: PORTD and PORTE are not physically implemented on the PIC16C73/73A, read as ‘0’.
6: Brown-out Reset is not implemented on the PIC16C73 or the PIC16C74, read as '0'.
7: The IRP and RP1 bits are reserved on the PIC16C73/73A/74/74A, always maintain these bits clear.
Value on all
other resets
(2)
1997 Microchip Technology Inc.DS30390E-page 25
PIC16C7X
TABLE 4-2:PIC16C73/73A/74/74A SPECIAL FUNCTION REGISTER SUMMARY (Cont.’d)
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8> whose con-
tents are transferred to the upper byte of the program counter.
2: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A, always maintain these bits clear.
4: These registers can be addressed from either bank.
5: PORTD and PORTE are not physically implemented on the PIC16C73/73A, read as ‘0’.
6: Brown-out Reset is not implemented on the PIC16C73 or the PIC16C74, read as '0'.
7: The IRP and RP1 bits are reserved on the PIC16C73/73A/74/74A, always maintain these bits clear.
Value on all
other resets
(2)
DS30390E-page 26 1997 Microchip Technology Inc.
PIC16C7X
TABLE 4-3:PIC16C76/77 SPECIAL FUNCTION REGISTER SUMMARY
tents are transferred to the upper byte of the program counter.
2: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the PIC16C76, always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD and PORTE are not physically implemented on the PIC16C76, read as ‘0’.
Value on all
other resets
(2)
1997 Microchip Technology Inc.DS30390E-page 27
PIC16C7X
TABLE 4-3:PIC16C76/77 SPECIAL FUNCTION REGISTER SUMMARY (Cont.’d)
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8> whose con-
tents are transferred to the upper byte of the program counter.
2: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the PIC16C76, always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD and PORTE are not physically implemented on the PIC16C76, read as ‘0’.
Value on all
other resets
(2)
DS30390E-page 28 1997 Microchip Technology Inc.
PIC16C7X
TABLE 4-3:PIC16C76/77 SPECIAL FUNCTION REGISTER SUMMARY (Cont.’d)
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 read as '0'.
Shaded locations are unimplemented, read as ‘0’.
Note 1: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8> whose con-
tents are transferred to the upper byte of the program counter.
2: Other (non power-up) resets include external reset through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the PIC16C76, always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD and PORTE are not physically implemented on the PIC16C76, read as ‘0’.
Value on all
other resets
(2)
1997 Microchip Technology Inc.DS30390E-page 29
PIC16C7X
4.2.2.1STATUS REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
The ST ATUS register, shown in Figure 4-7, contains the
arithmetic status of the ALU, the RESET status and the
bank select bits for data memory.
The STATUS register can be the destination for any
instruction, as with any other register. If the STATUS
register is the destination for an instruction that affects
the Z, DC or C bits, then the write to these three bits is
disabled. These bits are set or cleared according to the
device logic. Furthermore, the T
writable. Therefore, the result of an instruction with the
STATUS register as destination may be different than
intended.
O and PD bits are not
For example, CLRF STATUS will clear the upper-three
bits and set the Z bit. This leaves the STATUS register
as 000u u1uu (where u = unchanged).
It is recommended, therefore, that only BCF, BSF,SWAPF and MOVWF instructions are used to alter the
STATUS register because these instructions do not
affect the Z, C or DC bits from the STA TUS register. For
other instructions, not affecting any status bits, see the
"Instruction Set Summary."
Note 1: For those devices that do not use bits IRP
and RP1 (STATUS<7:6>), maintain these
bits clear to ensure upward compatibility
with future products.
Note 2: The C and DC bits operate as a borro
and digit borrow bit, respectively, in subtraction. See the SUBLW and SUBWF
instructions for examples.
bit 7:IRP: Register Bank Select bit (used for indirect addressing)
1 = Bank 2, 3 (100h - 1FFh)
0 = Bank 0, 1 (00h - FFh)
bit 6-5: RP1:RP0: Register Bank Select bits (used for direct addressing)
11 = Bank 3 (180h - 1FFh)
10 = Bank 2 (100h - 17Fh)
01 = Bank 1 (80h - FFh)
00 = Bank 0 (00h - 7Fh)
Each bank is 128 bytes
bit 4:T
bit 3:PD
bit 2:Z: Zero bit
bit 1:DC: Digit carry/borro
bit 0:C: Carry/borro
O: Time-out bit
1 = After power-up, CLRWDT instruction, or SLEEP instruction
0 = A WDT time-out occurred
: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
w bit (ADDWF, ADDLW,SUBLW,SUBWF instructions) (for borrow the polarity is reversed)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result
w bit (ADDWF, ADDLW,SUBLW,SUBWF instructions)
1 = A carry-out from the most significant bit of the result occurred
0 = No carry-out from the most significant bit of the result occurred
Note: For borro
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low order bit of
the source register.
w the polarity is reversed. A subtraction is executed by adding the two’s complement of the
W = Writable bit
U = Unimplemented bit,
read as ‘0’
- n = Value at POR reset
w
DS30390E-page 30 1997 Microchip Technology Inc.
Loading...
+ 258 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.