Professional Documents
Culture Documents
PIC16C74A
PIC16C73
PIC16C76
PIC16C73A
PIC16C77
PIC16C74
72
73
73A
74
74A
76
77
2K
4K
4K
4K
4K
8K
8K
128
192
192
192
192
368
368
I/O Pins
22
22
22
33
33
22
33
Yes
Yes
Yes
Capture/Compare/PWM Modules
Timer Modules
A/D Channels
SPI/I2C
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Brown-out Reset
Yes
Yes
Yes
Yes
Yes
Interrupt Sources
11
11
12
12
11
12
Serial Communication
DS30390E-page 1
PIC16C7X
Pin Diagrams
SDIP, SOIC, Windowed Side Brazed Ceramic
SSOP
28
RB7
MCLR/VPP
28
RB7
RA0/AN0
27
RB6
RA0/AN0
27
RB6
RA1/AN1
26
RB5
RA1/AN1
26
RB5
RA2/AN2
25
RB4
RA2/AN2
25
RB4
RA3/AN3/VREF
24
RB3
RA3/AN3/VREF
24
RB3
RA4/T0CKI
23
RB2
RA4/T0CKI
23
RB2
RA5/SS/AN4
VSS
7
8
22
21
RB1
RB0/INT
RA5/SS/AN4
VSS
7
8
22
21
RB1
RB0/INT
OSC1/CLKIN
MCLR/VPP
20
VDD
OSC1/CLKIN
20
VDD
OSC2/CLKOUT
10
19
VSS
OSC2/CLKOUT
10
19
VSS
RC0/T1OSO/T1CKI
11
18
RC7
RC0/T1OSO/T1CKI
11
18
RC7
RC1/T1OSI
12
17
RC6
RC1/T1OSI
12
17
RC6
RC2/CCP1
13
16
RC5/SDO
RC2/CCP1
13
16
RC5/SDO
RC3/SCK/SCL
14
15
RC4/SDI/SDA
RC3/SCK/SCL
14
15
RC4/SDI/SDA
PIC16C72
PIC16C72
28
RB7
RA0/AN0
27
RB6
RA1/AN1
26
RB5
MCLR/VPP
RA2/AN2
25
RB4
RA3/AN3/VREF
24
RB3
RA4/T0CKI
23
RB2
RA5/SS/AN4
VSS
7
8
22
21
RB1
RB0/INT
OSC1/CLKIN
20
VDD
OSC2/CLKOUT
10
19
VSS
RC0/T1OSO/T1CKI
11
18
RC7/RX/DT
RC1/T1OSI/CCP2
12
17
RC6/TX/CK
RC2/CCP1
13
16
RC5/SDO
RC3/SCK/SCL
14
15
RC4/SDI/SDA
PIC16C73
PIC16C73A
PIC16C76
DS30390E-page 2
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
VDD
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
PIC16C74
PIC16C74A
PIC16C77
PIC16C7X
1
2
3
4
5
6
7
8
9
10
11
PIC16C74
33
32
31
30
29
28
27
26
25
24
23
NC
RC0/T1OSO/T1CKI
OSC2/CLKOUT
OSC1/CLKIN
VSS
VDD
RE2/CS/AN7
RE1/WR/AN6
RE0/RD/AN5
RA5/SS/AN4
RA4/T0CKI
MQFP
TQFP
RC7/RX/DT
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
VSS
VDD
RB0/INT
RB1
RB2
RB3
1
2
3
4
5
6
7
8
9
10
11
PIC16C74A
PIC16C77
12
13
14
15
16
17
18
19
20
21
22
RB3
RB2
RB1
RB0/INT
VDD
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
NC
NC
RB4
RB5
RB6
RB7
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
PIC16C74
PIC16C74A
PIC16C77
39
38
37
36
35
34
33
32
31
30
29
18
19
20
21
22
23
24
25
26
27
28
7
8
9
10
11
12
13
14
15
16
17
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
NC
RA4/T0CKI
RA5/SS/AN4
RE0/RD/AN5
RE1/WR/AN6
RE2/CS/AN7
VDD
VSS
OSC1/CLKIN
OSC2/CLKOUT
RC0/T1OSO/T1CKI
NC
44
43
42
41
40
39
38
37
36
35
34
6
5
4
3
2
1
44
43
42
41
40
PLCC
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3/SCK/SCL
RC2/CCP1
RC1/T1OSI/CCP2
NC
RA3/AN3/VREF
RA2/AN2
RA1/AN1
RA0/AN0
MCLR/VPP
NC
RB7
RB6
RB5
RB4
NC
NC
NC
RB4
RB5
RB6
RB7
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
12
13
14
15
16
17
18
19
20
21
22
RC7/RX/DT
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
VSS
VDD
RB0/INT
RB1
RB2
RB3
44
43
42
41
40
39
38
37
36
35
34
MQFP
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3/SCK/SCL
RC2/CCP1
RC1/T1OSI/CCP2
NC
33
32
31
30
29
28
27
26
25
24
23
NC
RC0/T1OSO/T1CKI
OSC2/CLKOUT
OSC1/CLKIN
VSS
VDD
RE2/CS/AN7
RE1/WR/AN6
RE0/RD/AN5
RA5/SS/AN4
RA4/T0CKI
DS30390E-page 3
PIC16C7X
Table of Contents
1.0 General Description ....................................................................................................................................................................... 5
2.0 PIC16C7X Device Varieties ........................................................................................................................................................... 7
3.0 Architectural Overview ................................................................................................................................................................... 9
4.0 Memory Organization................................................................................................................................................................... 19
5.0 I/O Ports....................................................................................................................................................................................... 43
6.0 Overview of Timer Modules ......................................................................................................................................................... 57
7.0 Timer0 Module ............................................................................................................................................................................. 59
8.0 Timer1 Module ............................................................................................................................................................................. 65
9.0 Timer2 Module ............................................................................................................................................................................. 69
10.0 Capture/Compare/PWM Module(s).............................................................................................................................................. 71
11.0 Synchronous Serial Port (SSP) Module....................................................................................................................................... 77
12.0 Universal Synchronous Asynchronous Receiver Transmitter (USART) ...................................................................................... 99
13.0 Analog-to-Digital Converter (A/D) Module ................................................................................................................................. 117
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
22.0 Packaging Information ............................................................................................................................................................... 251
Appendix A: ................................................................................................................................................................................... 263
Appendix B:
Compatibility ............................................................................................................................................................. 263
Appendix C:
Whats New............................................................................................................................................................... 264
Appendix D:
Whats Changed ....................................................................................................................................................... 264
Appendix E:
PIC16/17 Microcontrollers ....................................................................................................................................... 265
Pin Compatibility ................................................................................................................................................................................ 271
Index .................................................................................................................................................................................................. 273
List of Examples................................................................................................................................................................................. 279
List of Figures..................................................................................................................................................................................... 280
List of Tables...................................................................................................................................................................................... 283
Reader Response .............................................................................................................................................................................. 286
PIC16C7X Product Identification System........................................................................................................................................... 287
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
72 73 73A 74 74A 76 77
DS30390E-page 4
PIC16C7X
1.0
GENERAL DESCRIPTION
The PIC16C7X is a family of low-cost, high-performance, 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 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 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 achieve 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 2C) bus. 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 PIC16C73/73A devices have 192 bytes of RAM,
while the PIC16C76 has 368 byes of RAM. Each device
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 2C) bus. The Universal Synchronous
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 (I2C) bus. The Universal 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
1.1
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.2
Development Support
DS30390E-page 5
PIC16C7X
TABLE 1-1:
PIC16C71
PIC16C711
PIC16C715
PIC16C72
PIC16CR72(1)
Maximum Frequency
of Operation (MHz)
20
20
20
20
20
20
512
1K
1K
2K
2K
2K
36
36
68
128
128
128
Timer Module(s)
TMR0
TMR0
TMR0
TMR0
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
Capture/Compare/
Peripherals PWM Module(s)
Serial Port(s)
(SPI/I2C, USART)
SPI/I2C
SPI/I2C
Clock
Memory
Features
Interrupt Sources
I/O Pins
13
13
13
13
22
22
3.0-6.0
3.0-6.0
3.0-6.0
3.0-5.5
2.5-6.0
3.0-5.5
Yes
Yes
Yes
Yes
Yes
Yes
Brown-out Reset
Yes
Yes
Yes
Yes
Yes
Packages
18-pin DIP, 18-pin DIP, 18-pin DIP, 18-pin DIP, 28-pin SDIP, 28-pin SDIP,
SOIC;
SOIC
SOIC;
SOIC;
SOIC, SSOP SOIC, SSOP
20-pin SSOP
20-pin SSOP 20-pin SSOP
PIC16C74A
PIC16C73A
Clock
Memory
PIC16C77
20
20
20
4K
4K
8K
8K
192
192
368
368
Timer Module(s)
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
SPI/I2C, USART
SPI/I2C, USART
SPI/I2C, USART
Yes
Yes
Capture/Compare/PWM Mod- 2
Peripherals ule(s)
Features
PIC16C76
Interrupt Sources
11
12
11
12
I/O Pins
22
33
22
33
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
Yes
Yes
Yes
Yes
Brown-out Reset
Yes
Yes
Yes
Yes
Packages
28-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 have Power-on Reset, selectable Watchdog Timer, selectable 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
PIC16C7X
2.0
2.
2.1
UV Erasable Devices
2.3
Quick-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.4
Serialized Quick-Turnaround
Production (SQTPSM) Devices
2.2
One-Time-Programmable (OTP)
Devices
DS30390E-page 7
PIC16C7X
NOTES:
DS30390E-page 8
PIC16C7X
3.0
ARCHITECTURAL OVERVIEW
Program
Memory
2K x 14
4K x 14
4K x 14
4K x 14
4K x 14
8K x 14
8K x 14
Data Memory
128 x 8
192 x 8
192 x 8
192 x 8
192 x 8
368 x 8
386 x 8
DS30390E-page 9
PIC16C7X
FIGURE 3-1:
Program
Memory
Program
Bus
14
PORTA
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
RA5/SS/AN4
RAM
File
Registers
128 x 8
8 Level Stack
(13-bit)
2K x 14
Data Bus
Program Counter
EPROM
RAM Addr(1)
PORTB
Addr MUX
Instruction reg
7
Direct Addr
RB0/INT
Indirect
Addr
RB7:RB1
FSR reg
STATUS reg
8
3
Power-up
Timer
Oscillator
Start-up Timer
Instruction
Decode &
Control
Power-on
Reset
Timing
Generation
ALU
MCLR
RC0/T1OSO/T1CKI
RC1/T1OSI
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6
RC7
Watchdog
Timer
Brown-out
Reset
OSC1/CLKIN
OSC2/CLKOUT
MUX
PORTC
W reg
VDD, VSS
Timer0
Timer1
Timer2
A/D
Synchronous
Serial Port
CCP1
DS30390E-page 10
PIC16C7X
FIGURE 3-2:
Device
PIC16C73
PIC16C73A
PIC16C76
4K x 14
4K x 14
8K x 14
192 x 8
192 x 8
368 x 8
13
Data Bus
Program Counter
PORTA
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
RA5/SS/AN4
EPROM
Program
Memory
Program
Bus
RAM
File
Registers
8 Level Stack
(13-bit)
14
RAM Addr(1)
PORTB
Addr MUX
Instruction reg
7
Direct Addr
RB0/INT
Indirect
Addr
RB7:RB1
FSR reg
STATUS reg
8
3
MUX
Power-up
Timer
Instruction
Decode &
Control
Oscillator
Start-up Timer
Timing
Generation
Watchdog
Timer
Brown-out
Reset(2)
OSC1/CLKIN
OSC2/CLKOUT
Power-on
Reset
MCLR
ALU
PORTC
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
RC7/RX/DT
8
W reg
VDD, VSS
Timer0
Timer1
Timer2
A/D
CCP1
CCP2
Synchronous
Serial Port
USART
DS30390E-page 11
PIC16C7X
FIGURE 3-3:
Device
PIC16C74
PIC16C74A
PIC16C77
4K x 14
4K x 14
8K x 14
192 x 8
192 x 8
368 x 8
13
Data Bus
Program Counter
PORTA
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
RA5/SS/AN4
EPROM
Program
Memory
Program
Bus
RAM
File
Registers
8 Level Stack
(13-bit)
14
PORTB
Addr MUX
Instruction reg
Direct Addr
RB0/INT
Indirect
Addr
RB7:RB1
FSR reg
STATUS reg
8
3
Power-up
Timer
Instruction
Decode &
Control
Timing
Generation
OSC1/CLKIN
OSC2/CLKOUT
Oscillator
Start-up Timer
Power-on
Reset
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
RC7/RX/DT
MUX
ALU
PORTD
Watchdog
Timer
Brown-out
Reset(2)
W reg
RD7/PSP7:RD0/PSP0
PORTC
VDD, VSS
PORTE
RE0/RD/AN5
RE1/WR/AN6
Timer0
Timer1
Timer2
A/D
CCP1
CCP2
Synchronous
Serial Port
USART
RE2/CS/AN7
DS30390E-page 12
PIC16C7X
TABLE 3-1:
SSOP
Pin#
SOIC
Pin#
I/O/P
Type
OSC1/CLKIN
OSC2/CLKOUT
10
10
10
MCLR/VPP
I/P
ST
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
2
3
4
5
6
2
3
4
5
6
2
3
4
5
6
I/O
I/O
I/O
I/O
I/O
TTL
TTL
TTL
TTL
ST
RA5/SS/AN4
I/O
TTL
RB0/INT
RB1
RB2
RB3
RB4
RB5
RB6
RB7
21
22
23
24
25
26
27
28
21
22
23
24
25
26
27
28
21
22
23
24
25
26
27
28
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
TTL/ST(1)
TTL
TTL
TTL
TTL
TTL
TTL/ST(2)
TTL/ST(2)
RC0/T1OSO/T1CKI
11
11
11
I/O
ST
RC1/T1OSI
RC2/CCP1
12
13
12
13
12
13
I/O
I/O
ST
ST
RC3/SCK/SCL
14
14
14
I/O
ST
RC4/SDI/SDA
15
15
15
I/O
ST
Pin Name
RC5/SDO
RC6
RC7
VSS
VDD
Legend: I = input
Buffer
Type
Description
16
16
16
I/O
ST
17
17
17
I/O
ST
18
18
18
I/O
ST
8, 19 8, 19
8, 19
P
DS30390E-page 13
PIC16C7X
TABLE 3-2:
SOIC
Pin#
I/O/P
Type
OSC1/CLKIN
OSC2/CLKOUT
10
10
MCLR/VPP
I/P
ST
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
2
3
4
5
6
2
3
4
5
6
I/O
I/O
I/O
I/O
I/O
TTL
TTL
TTL
TTL
ST
RA5/SS/AN4
I/O
TTL
RB0/INT
RB1
RB2
RB3
RB4
RB5
RB6
RB7
21
22
23
24
25
26
27
28
21
22
23
24
25
26
27
28
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
TTL/ST(1)
TTL
TTL
TTL
TTL
TTL
TTL/ST(2)
TTL/ST(2)
Pin Name
Buffer
Type
Description
DS30390E-page 14
PIC16C7X
TABLE 3-3:
PLCC
Pin#
QFP
Pin#
I/O/P
Type
OSC1/CLKIN
13
14
30
OSC2/CLKOUT
14
15
31
MCLR/VPP
18
I/P
ST
RA0/AN0
19
I/O
TTL
RA1/AN1
20
I/O
TTL
RA2/AN2
21
I/O
TTL
RA3/AN3/VREF
22
I/O
TTL
RA4/T0CKI
23
I/O
ST
RA5/SS/AN4
24
I/O
TTL
Pin Name
Buffer
Type
Description
33
36
I/O
TTL/ST(1)
RB1
34
37
I/O
TTL
RB2
35
38
10
I/O
TTL
RB3
36
39
11
I/O
TTL
RB4
37
41
14
I/O
TTL
RB5
38
42
15
I/O
TTL
I/O
TTL/ST(2)
RB6
39
43
16
40
44
17
I/O
TTL/ST(2)
Interrupt on change pin. Serial programming data.
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as an external interrupt.
This buffer is a Schmitt Trigger input when used in serial programming mode.
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).
This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
RB7
Legend: I = input
Note 1:
2:
3:
4:
DS30390E-page 15
PIC16C7X
TABLE 3-3:
Pin Name
DIP
Pin#
PLCC
Pin#
QFP
Pin#
I/O/P
Type
Buffer
Type
Description
PORTC is a bi-directional I/O port.
RC0/T1OSO/T1CKI
15
16
32
I/O
ST
RC1/T1OSI/CCP2
16
18
35
I/O
ST
RC2/CCP1
17
19
36
I/O
ST
RC3/SCK/SCL
18
20
37
I/O
ST
RC4/SDI/SDA
23
25
42
I/O
ST
RC5/SDO
24
26
43
I/O
ST
RC6/TX/CK
25
27
44
I/O
ST
RC7/RX/DT
26
29
I/O
ST
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
19
20
21
22
27
28
29
30
21
22
23
24
30
31
32
33
38
39
40
41
2
3
4
5
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
ST/TTL(3)
RE0/RD/AN5
25
I/O
ST/TTL(3)
RE0 can also be read control for the parallel slave port,
or analog input5.
RE1/WR/AN6
10
26
I/O
ST/TTL(3)
RE1 can also be write control for the parallel slave port,
or analog input6.
RE2/CS/AN7
10
11
27
I/O
ST/TTL(3)
12,31
11,32
13,34
12,35
1,17,28,
40
6,29
7,28
12,13,
33,34
P
P
VSS
VDD
NC
Legend: I = input
Note 1:
2:
3:
4:
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as an external interrupt.
This buffer is a Schmitt Trigger input when used in serial programming mode.
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).
This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
DS30390E-page 16
PIC16C7X
3.1
3.2
Instruction Flow/Pipelining
FIGURE 3-4:
CLOCK/INSTRUCTION CYCLE
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
Q1
Q2
Internal
phase
clock
Q3
Q4
PC
OSC2/CLKOUT
(RC mode)
EXAMPLE 3-1:
PC
PC+1
PC+2
1. MOVLW 55h
Tcy0
Tcy1
Fetch 1
Execute 1
2. MOVWF PORTB
3. CALL
SUB_1
4. BSF
Fetch 2
Tcy2
Tcy3
Tcy4
Tcy5
Execute 2
Fetch 3
Execute 3
Fetch 4
Flush
Fetch SUB_1 Execute 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.
DS30390E-page 17
PIC16C7X
NOTES:
DS30390E-page 18
PIC16C7X
4.0
MEMORY ORGANIZATION
FIGURE 4-2:
Applicable Devices
72 73 73A 74 74A 76 77
Program
Memory
Address Range
CALL, RETURN
RETFIE, RETLW
13
Stack Level 1
Stack Level 8
PIC16C72
2K x 14
0000h-07FFh
PIC16C73
4K x 14
0000h-0FFFh
PIC16C73A
4K x 14
0000h-0FFFh
PIC16C74
4K x 14
0000h-0FFFh
PIC16C74A
4K x 14
0000h-0FFFh
PIC16C76
8K x 14
0000h-1FFFh
PIC16C77
8K x 14
0000h-1FFFh
FIGURE 4-1:
PC<12:0>
PIC16C72 PROGRAM
MEMORY MAP AND STACK
User Memory
Space
4.1
PIC16C73/73A/74/74A
PROGRAM MEMORY MAP
AND STACK
Reset Vector
0000h
Interrupt Vector
0004h
0005h
On-chip Program
Memory (Page 0)
07FFh
On-chip Program
Memory (Page 1)
0800h
0FFFh
1000h
1FFFh
PC<12:0>
CALL, RETURN
RETFIE, RETLW
13
Stack Level 1
User Memory
Space
Stack Level 8
Reset Vector
0000h
Interrupt Vector
0004h
0005h
On-chip Program
Memory
07FFh
0800h
1FFFh
DS30390E-page 19
PIC16C7X
FIGURE 4-3:
PIC16C76/77 PROGRAM
MEMORY MAP AND STACK
4.2
Applicable Devices
72 73 73A 74 74A 76 77
PC<12:0>
CALL, RETURN
RETFIE, RETLW
13
Stack Level 1
RP1:RP0 (STATUS<6:5>)
= 00 Bank0
= 01 Bank1
= 10 Bank2
= 11 Bank3
Stack Level 2
User Memory
Space
Stack Level 8
Reset Vector
0000h
Interrupt Vector
0004h
0005h
On-Chip
On-Chip
On-Chip
Page 0
07FFh
0800h
Page 1
0FFFh
1000h
On-Chip
4.2.1
The register file can be accessed either directly, or indirectly through the File Select Register FSR
(Section 4.5).
Page 2
Page 3
17FFh
1800h
1FFFh
DS30390E-page 20
PIC16C7X
FIGURE 4-4:
File
Address
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
20h
INDF(1)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
PORTC
INDF(1)
OPTION
PCL
STATUS
FSR
TRISA
TRISB
TRISC
PCLATH
INTCON
PIR1
PCLATH
INTCON
PIE1
TMR1L
TMR1H
T1CON
TMR2
T2CON
SSPBUF
SSPCON
CCPR1L
CCPR1H
CCP1CON
PCON
ADRES
ADCON0
General
Purpose
Register
PR2
SSPADD
SSPSTAT
ADCON1
General
Purpose
Register
FIGURE 4-5:
File
Address
File
Address
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
20h
A0h
PIC16C73/73A/74/74A
REGISTER FILE MAP
File
Address
INDF(1)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
PORTC
PORTD(2)
PORTE(2)
PCLATH
INTCON
PIR1
PIR2
TMR1L
TMR1H
T1CON
TMR2
T2CON
SSPBUF
SSPCON
CCPR1L
CCPR1H
CCP1CON
RCSTA
TXREG
RCREG
CCPR2L
CCPR2H
CCP2CON
ADRES
ADCON0
General
Purpose
Register
BFh
C0h
INDF(1)
OPTION
PCL
STATUS
FSR
TRISA
TRISB
TRISC
TRISD(2)
TRISE(2)
PCLATH
INTCON
PIE1
PIE2
PCON
PR2
SSPADD
SSPSTAT
TXSTA
SPBRG
ADCON1
General
Purpose
Register
FFh
7Fh
Bank 0
7Fh
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
A0h
Bank 1
FFh
Bank 0
Bank 1
DS30390E-page 21
PIC16C7X
FIGURE 4-6:
Indirect addr.(*)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
PORTC
PORTD (1)
PORTE (1)
PCLATH
INTCON
PIR1
PIR2
TMR1L
TMR1H
T1CON
TMR2
T2CON
SSPBUF
SSPCON
CCPR1L
CCPR1H
CCP1CON
RCSTA
TXREG
RCREG
CCPR2L
CCPR2H
CCP2CON
ADRES
ADCON0
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
20h
General
Purpose
Register
Indirect addr.(*)
OPTION
PCL
STATUS
FSR
TRISA
TRISB
TRISC
TRISD (1)
TRISE (1)
PCLATH
INTCON
PIE1
PIE2
PCON
PR2
SSPADD
SSPSTAT
TXSTA
SPBRG
ADCON1
accesses
70h-7Fh
7Fh
Bank 0
Indirect addr.(*)
TMR0
PCL
STATUS
FSR
PORTB
PCLATH
INTCON
General
Purpose
Register
16 Bytes
A0h
General
Purpose
Register
80 Bytes
96 Bytes
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
EFh
F0h
FFh
Bank 1
General
Purpose
Register
80 Bytes
accesses
70h-7Fh
100h
101h
102h
103h
104h
105h
106h
107h
108h
109h
10Ah
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
Indirect addr.(*)
OPTION
PCL
STATUS
FSR
TRISB
PCLATH
INTCON
General
Purpose
Register
16 Bytes
180h
181h
182h
183h
184h
185h
186h
187h
188h
189h
18Ah
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
General
Purpose
Register
80 Bytes
16Fh
170h
accesses
70h - 7Fh
17Fh
1EFh
1F0h
1FFh
Bank 3
Bank 2
Note:
DS30390E-page 22
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.
PIC16C7X
4.2.2
TABLE 4-1:
Address Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(3)
Bank 0
00h(1)
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
01h
TMR0
02h(1)
PCL
(1)
03h
STATUS
04h(1)
FSR
05h
PORTA
06h
PORTB
07h
PORTC
08h
09h
(4)
IRP
(4)
RP1
RP0
TO
PD
DC
Unimplemented
Unimplemented
0Ah(1,2)
PCLATH
0Bh(1)
INTCON
0Ch
PIR1
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
ADIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
Unimplemented
0Dh
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1 register
10h
T1CON
11h
TMR2
12h
T2CON
13h
SSPBUF
14h
SSPCON
15h
CCPR1L
16h
CCPR1H
T1CKPS1
T1CKPS0 T1OSCEN
T1SYNC
TMR1CS
TMR1ON
TMR2ON
T2CKPS1
SSPM2
SSPM1
SSPOV
CCP1M2
CCP1M1
CCP1M0
Unimplemented
19h
Unimplemented
1Ah
Unimplemented
1Bh
Unimplemented
1Ch
Unimplemented
Unimplemented
ADCON0
CCP1M3
1Fh
CCP1Y
SSPM3
CCP1CON
ADRES
CCP1X
CKP
17h
1Dh
SSPEN
18h
1Eh
ADCS0
CHS1
CHS0
GO/DONE
ADON
DS30390E-page 23
PIC16C7X
TABLE 4-1:
Address Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(3)
Bank 1
80h(1)
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
81h
OPTION
82h(1)
PCL
83h(1)
STATUS
84h(1)
FSR
85h
TRISA
86h
TRISB
87h
TRISC
88h
Unimplemented
Unimplemented
89h
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
RP1(4)
RP0
TO
PD
DC
8Ah(1,2)
PCLATH
8Bh(1)
INTCON
8Ch
PIE1
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
ADIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
POR
BOR
8Dh
8Eh
PCON
8Fh
Unimplemented
90h
Unimplemented
Unimplemented
91h
Unimplemented
92h
PR2
93h
SSPADD
94h
SSPSTAT
D/A
R/W
UA
BF
95h
Unimplemented
96h
Unimplemented
97h
Unimplemented
98h
Unimplemented
99h
Unimplemented
9Ah
Unimplemented
9Bh
Unimplemented
9Ch
Unimplemented
9Dh
Unimplemented
9Eh
Unimplemented
---- -000
---- -000
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
DS30390E-page 24
PIC16C7X
TABLE 4-2:
Address Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(2)
Bank 0
00h(4)
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
01h
TMR0
02h(4)
PCL
(4)
03h
STATUS
04h(4)
FSR
05h
PORTA
06h
PORTB
(7)
(7)
IRP
RP1
RP0
TO
PD
DC
07h
PORTC
08h(5)
PORTD
(5)
09h
PORTE
0Ah(1,4)
PCLATH
0Bh(4)
INTCON
0Ch
PIR1
0Dh
PIR2
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1 register
10h
T1CON
11h
TMR2
12h
T2CON
13h
SSPBUF
14h
SSPCON
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
18h
RCSTA
19h
TXREG
1Ah
RCREG
1Bh
CCPR2L
1Ch
CCPR2H
1Dh
CCP2CON
1Eh
ADRES
1Fh
ADCON0
RE2
RE1
RE0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PSPIF(3)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
CCP2IF
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
TOUTPS3 TOUTPS2
TOUTPS1
TOUTPS0
TMR2ON
T2CKPS1
SSPM2
SSPM1
SSPOV
SSPEN
CKP
SSPM3
CCP1X
CCP1Y
CCP1M3
CCP1M2
CCP1M1
CCP1M0
SPEN
RX9
SREN
CREN
FERR
OERR
RX9D
CCP2X
CCP2Y
CCP2M3
CCP2M2
CCP2M1
CCP2M0
ADCS0
CHS2
CHS1
CHS0
GO/DONE
ADON
DS30390E-page 25
PIC16C7X
TABLE 4-2:
Address Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(2)
Bank 1
80h(4)
INDF
81h
OPTION
82h(4)
PCL
(4)
83h
STATUS
84h(4)
FSR
85h
TRISA
86h
TRISB
Addressing this location uses contents of FSR to address data memory (not a physical register)
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
IRP
(7)
RP1
RP0
TO
PD
DC
87h
TRISC
88h(5)
TRISD
(5)
89h
TRISE
IBF
OBF
IBOV
8Ah(1,4)
PCLATH
8Bh(4)
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
8Ch
PIE1
PSPIE(3)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
8Dh
PIE2
CCP2IE
8Eh
PCON
POR
BOR(6)
8Fh
Unimplemented
90h
Unimplemented
Unimplemented
91h
PSPMODE
92h
PR2
93h
SSPADD
94h
SSPSTAT
95h
Unimplemented
96h
Unimplemented
97h
Unimplemented
98h
TXSTA
99h
SPBRG
CSRC
TX9
D/A
TXEN
SYNC
R/W
BRGH
UA
TRMT
BF
TX9D
9Ah
Unimplemented
9Bh
Unimplemented
9Ch
Unimplemented
9Dh
Unimplemented
9Eh
Unimplemented
---- -000
---- -000
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
DS30390E-page 26
PIC16C7X
TABLE 4-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(2)
Bank 0
00h(4)
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
01h
TMR0
02h(4)
PCL
(4)
03h
STATUS
04h(4)
FSR
05h
PORTA
06h
PORTB
IRP
RP1
RP0
TO
PD
DC
07h
PORTC
08h(5)
PORTD
(5)
09h
PORTE
0Ah(1,4)
PCLATH
0Bh(4)
INTCON
0Ch
PIR1
0Dh
PIR2
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1 register
10h
T1CON
11h
TMR2
12h
T2CON
13h
SSPBUF
14h
SSPCON
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
18h
RCSTA
19h
TXREG
1Ah
RCREG
1Bh
CCPR2L
1Ch
CCPR2H
1Dh
CCP2CON
1Eh
ADRES
1Fh
ADCON0
RE2
RE1
RE0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PSPIF(3)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
CCP2IF
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
TOUTPS3 TOUTPS2
TOUTPS1
TOUTPS0
TMR2ON
T2CKPS1
SSPM2
SSPM1
SSPOV
SSPEN
CKP
SSPM3
CCP1X
CCP1Y
CCP1M3
CCP1M2
CCP1M1
CCP1M0
SPEN
RX9
SREN
CREN
FERR
OERR
RX9D
CCP2X
CCP2Y
CCP2M3
CCP2M2
CCP2M1
CCP2M0
ADCS0
CHS2
CHS1
CHS0
GO/DONE
ADON
DS30390E-page 27
PIC16C7X
TABLE 4-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(2)
Bank 1
80h(4)
INDF
81h
OPTION
82h(4)
PCL
(4)
83h
STATUS
84h(4)
FSR
85h
TRISA
86h
TRISB
Addressing this location uses contents of FSR to address data memory (not a physical register)
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
RP1
RP0
TO
PD
DC
87h
TRISC
88h(5)
TRISD
(5)
89h
TRISE
IBF
OBF
IBOV
8Ah(1,4)
PCLATH
8Bh(4)
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
8Ch
PIE1
PSPIE(3)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
8Dh
PIE2
CCP2IE
8Eh
PCON
POR
BOR
8Fh
Unimplemented
90h
Unimplemented
Unimplemented
91h
PSPMODE
92h
PR2
93h
SSPADD
94h
SSPSTAT
95h
Unimplemented
96h
Unimplemented
Unimplemented
97h
98h
TXSTA
99h
SPBRG
SMP
CKE
CSRC
TX9
D/A
TXEN
SYNC
R/W
BRGH
UA
BF
TRMT
TX9D
9Ah
Unimplemented
9Bh
Unimplemented
9Ch
Unimplemented
9Dh
Unimplemented
9Eh
Unimplemented
---- -000
---- -000
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
DS30390E-page 28
PIC16C7X
TABLE 4-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
(2)
Bank 2
100h(4)
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
101h
TMR0
102h(4)
PCL
103h(4)
STATUS
104h(4)
FSR
IRP
RP1
RP0
TO
PD
DC
105h
106h
PORTB
107h
Unimplemented
108h
Unimplemented
Unimplemented
109h
Unimplemented
(1,4)
PCLATH
(4)
INTCON
GIE
PEIE
T0IE
10Ah
10Bh
10Ch10Fh
RBIE
T0IF
INTF
RBIF
Unimplemented
Bank 3
180h(4)
INDF
181h
OPTION
182h(4)
PCL
183h(4)
STATUS
184h(4)
FSR
Addressing this location uses contents of FSR to address data memory (not a physical register)
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
RP1
RP0
TO
PD
DC
185h
186h
TRISB
187h
Unimplemented
188h
Unimplemented
Unimplemented
189h
Unimplemented
(1,4)
PCLATH
(4)
INTCON
GIE
PEIE
T0IE
18Ah
18Bh
18Ch18Fh
Unimplemented
RBIE
T0IF
INTF
RBIF
DS30390E-page 29
PIC16C7X
4.2.2.1
STATUS REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
FIGURE 4-7:
R/W-0
IRP
bit7
bit 7:
R/W-0
RP1
R/W-0
RP0
R-1
TO
R-1
PD
R/W-x
Z
R/W-x
DC
R/W-x
C
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
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:
bit 3:
bit 2:
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1:
DC: Digit carry/borrow 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
bit 0:
DS30390E-page 30
PIC16C7X
4.2.2.2
OPTION REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
The OPTION register is a readable and writable register which contains various control bits to configure the
TMR0/WDT prescaler, the External INT Interrupt,
TMR0, and the weak pull-ups on PORTB.
FIGURE 4-8:
R/W-1
RBPU
bit7
R/W-1
INTEDG
R/W-1
T0CS
R/W-1
T0SE
R/W-1
PSA
R/W-1
PS2
R/W-1
PS1
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
R/W-1
PS0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
TMR0 Rate
WDT Rate
000
001
010
011
100
101
110
111
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
1:1
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
DS30390E-page 31
PIC16C7X
4.2.2.3
INTCON REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
The INTCON Register is a readable and writable register which contains various enable and flag bits for the
TMR0 register overflow, RB Port change and External
RB0/INT pin interrupts.
FIGURE 4-9:
R/W-0
GIE
bit7
INTCON REGISTER
(ADDRESS 0Bh, 8Bh, 10Bh, 18Bh)
R/W-0
PEIE
R/W-0
T0IE
R/W-0
INTE
R/W-0
RBIE
R/W-0
T0IF
R/W-0
INTF
R/W-x
RBIF
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
Note 1: For the PIC16C73 and PIC16C74, if an interrupt occurs while the GIE bit is being cleared, the GIE bit
may be unintentionally re-enabled by the RETFIE instruction in the users Interrupt Service Routine.
Refer to Section 14.5 for a detailed description.
Interrupt flag bits get set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the
global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt flag bits are clear prior to
enabling an interrupt.
DS30390E-page 32
PIC16C7X
4.2.2.4
PIE1 REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
bit7
R/W-0
ADIE
U-0
U-0
R/W-0
SSPIE
bit 7:
bit 6:
R/W-0
CCP1IE
R/W-0
TMR2IE
R/W-0
TMR1IE
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 2:
bit 1:
bit 0:
DS30390E-page 33
PIC16C7X
FIGURE 4-11: PIE1 REGISTER PIC16C73/73A/74/74A/76/77 (ADDRESS 8Ch)
R/W-0
PSPIE(1)
bit7
R/W-0
ADIE
R/W-0
RCIE
R/W-0
TXIE
R/W-0
SSPIE
R/W-0
CCP1IE
R/W-0
TMR2IE
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
R/W-0
TMR1IE
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
Note 1: PIC16C73/73A/76 devices do not have a Parallel Slave Port implemented, this bit location is reserved
on these devices, always maintain this bit clear.
DS30390E-page 34
PIC16C7X
4.2.2.5
PIR1 REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
bit7
R/W-0
ADIF
U-0
U-0
R/W-0
SSPIF
R/W-0
CCP1IF
R/W-0
TMR2IF
R/W-0
TMR1IF
bit0
bit 7:
bit 6:
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 2:
bit 1:
bit 0:
Interrupt flag bits get set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the
global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt flag bits are clear prior to
enabling an interrupt.
DS30390E-page 35
PIC16C7X
FIGURE 4-13: PIR1 REGISTER PIC16C73/73A/74/74A/76/77 (ADDRESS 0Ch)
R/W-0
PSPIF(1)
bit7
R/W-0
ADIF
R-0
RCIF
R-0
TXIF
R/W-0
SSPIF
R/W-0
CCP1IF
R/W-0
TMR2IF
R/W-0
TMR1IF
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
Note 1: PIC16C73/73A/76 devices do not have a Parallel Slave Port implemented, this bit location is reserved
on these devices, always maintain this bit clear.
Interrupt flag bits get set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the
global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt flag bits are clear prior to
enabling an interrupt.
DS30390E-page 36
PIC16C7X
4.2.2.6
PIE2 REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
bit7
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
CCP2IE
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
DS30390E-page 37
PIC16C7X
4.2.2.7
PIR2 REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
U-0
R/W-0
CCP2IF
bit0
bit7
U-0
U-0
U-0
U-0
U-0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
Interrupt flag bits get set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the
global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt flag bits are clear prior to
enabling an interrupt.
DS30390E-page 38
PIC16C7X
4.2.2.8
PCON REGISTER
Applicable Devices
72 73 73A 74 74A 76 77
Note:
bit7
U-0
U-0
U-0
U-0
U-0
R/W-0
POR
R/W-q
BOR(1)
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 0:
DS30390E-page 39
PIC16C7X
4.3
Applicable Devices
72 73 73A 74 74A 76 77
The program counter (PC) is 13-bits wide. The low byte
comes from the PCL register, which is a readable and
writable register. The upper bits (PC<12:8>) are not
readable, but are indirectly writable through the
PCLATH register. On any reset, the upper bits of the
PC will be cleared. Figure 4-17 shows the two situations for the loading of the PC. The upper example in
the figure shows how the PC is loaded on a write to
PCL (PCLATH<4:0> PCH). The lower example in
the figure shows how the PC is loaded during a CALL
or GOTO instruction (PCLATH<4:3> PCH).
PCL
12
PC
5
PCLATH<4:0>
Instruction with
PCL as
Destination
ALU
PCLATH
PCH
12
11 10
PIC16C7X devices are capable of addressing a continuous 8K word block of program memory. The CALL and
GOTO instructions provide only 11 bits of address to
allow branching within any 2K program memory page.
When doing a CALL or GOTO instruction the upper 2 bits
of the address are provided by PCLATH<4:3>. When
doing a CALL or GOTO instruction, the user must ensure
that the page select bits are programmed so that the
desired program memory page is addressed. If a return
from a CALL instruction (or interrupt) is executed, the
entire 13-bit PC is pushed onto the stack. Therefore,
manipulation of the PCLATH<4:3> bits are not required
for the return instructions (which POPs the address
from the stack).
Note:
GOTO, CALL
PCLATH<4:3>
11
Opcode <10:0>
PCLATH
4.3.1
4.4
PCL
8
PC
2
COMPUTED GOTO
A computed GOTO is accomplished by adding an offset to the program counter (ADDWF PCL). When doing
a table read using a computed GOTO method, care
should be exercised if the table location crosses a PCL
memory boundary (each 256 byte block). Refer to the
application note Implementing a Table Read" (AN556).
4.3.2
STACK
DS30390E-page 40
PIC16C7X
Example 4-1 shows the calling of a subroutine in
page 1 of the program memory. This example assumes
that PCLATH is saved and restored by the interrupt service routine (if interrupts are used).
4.5
EXAMPLE 4-1:
ORG 0x500
BSF
PCLATH,3
BCF
PCLATH,4
CALL
SUB1_P1
:
:
:
ORG 0x900
SUB1_P1:
:
:
RETURN
CALL OF A SUBROUTINE IN
PAGE 1 FROM PAGE 0
Indirect addressing is possible by using the INDF register. Any instruction using the INDF register actually
accesses the register pointed to by the File Select Register, FSR. Reading the INDF register itself indirectly
(FSR = '0') will read 00h. Writing to the INDF register
indirectly results in a no-operation (although status bits
may be affected). An effective 9-bit address is obtained
by concatenating the 8-bit FSR register and the IRP bit
(STATUS<7>), as shown in Figure 4-18.
;called subroutine
;page 1 (800h-FFFh)
EXAMPLE 4-2:
movlw
movwf
clrf
incf
btfss
goto
NEXT
INDIRECT ADDRESSING
0x20
FSR
INDF
FSR,F
FSR,4
NEXT
;initialize pointer
;to RAM
;clear INDF register
;inc pointer
;all done?
;no clear next
CONTINUE
:
;yes continue
Indirect Addressing
from opcode
RP1:RP0
bank select
location select
IRP
bank select
00
00h
01
80h
10
100h
FSR register
location select
11
180h
not used
Data
Memory
7Fh
Bank 0
FFh
Bank 1
17Fh
Bank 2
1FFh
Bank 3
For register file map detail see Figure 4-4, and Figure 4-5.
DS30390E-page 41
PIC16C7X
NOTES:
DS30390E-page 42
PIC16C7X
5.0
I/O PORTS
FIGURE 5-1:
Applicable Devices
72 73 73A 74 74A 76 77
Some pins for these I/O ports are multiplexed with an
alternate function for the peripheral features on the
device. In general, when a peripheral is enabled, that
pin may not be used as a general purpose I/O pin.
5.1
Data
bus
BLOCK DIAGRAM OF
RA3:RA0 AND RA5 PINS
Q
VDD
WR
Port
CK
Data Latch
Applicable Devices
72 73 73A 74 74A 76 77
D
WR
TRIS
On a Power-on Reset, these pins are configured as analog inputs and read as '0'.
TRIS Latch
RD PORT
To A/D Converter
Note 1: I/O pins have protection diodes to VDD and
VSS.
FIGURE 5-2:
Data
bus
EXAMPLE 5-1:
WR
TRIS
STATUS, RP0
STATUS, RP1
PORTA
BSF
MOVLW
STATUS, RP0
0xCF
MOVWF
TRISA
;
;
;
;
;
;
;
;
;
;
;
;
;
PIC16C76/77 only
Initialize PORTA by
clearing output
data latches
Select Bank 1
Value used to
initialize data
direction
Set RA<3:0> as inputs
RA<5:4> as outputs
TRISA<7:6> are always
read as '0'.
EN
WR
PORT
BCF
BCF
CLRF
TTL
input
buffer
RD TRIS
INITIALIZING PORTA
I/O pin(1)
VSS
Analog
input
mode
Setting a TRISA register bit puts the corresponding output driver in a hi-impedance mode. Clearing a bit in the
TRISA register puts the contents of the output latch on
the selected pin(s).
Reading the PORTA register reads the status of the
pins whereas writing to it will write to the port latch. All
write operations are read-modify-write operations.
Therefore a write to a port implies that the port pins are
read, this value is modified, and then written to the port
data latch.
CK
CK
I/O pin(1)
Data Latch
D
CK
VSS
Schmitt
Trigger
input
buffer
TRIS Latch
RD TRIS
Q
D
EN
EN
RD PORT
TMR0 clock input
Note 1: I/O pin has protection diodes to VSS only.
DS30390E-page 43
PIC16C7X
TABLE 5-1:
PORTA FUNCTIONS
Name
Bit#
Buffer
RA0/AN0
RA1/AN1
RA2/AN2
RA3/AN3/VREF
RA4/T0CKI
bit0
bit1
bit2
bit3
bit4
TTL
TTL
TTL
TTL
ST
Function
TABLE 5-2:
Address Name
Bit 7 Bit 6
05h
PORTA
85h
TRISA
9Fh
ADCON1
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
RA5
RA4
RA3
RA2
RA1
RA0
--0x 0000
--0u 0000
--11 1111
--11 1111
---- -000
---- -000
PCFG2
PCFG1
PCFG0
Legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. Shaded cells are not used by PORTA.
DS30390E-page 44
PIC16C7X
5.2
PORTB is an 8-bit wide bi-directional port. The corresponding data direction register is TRISB. Setting a bit
in the TRISB register puts the corresponding output
driver in a hi-impedance input mode. Clearing a bit in
the TRISB register puts the contents of the output latch
on the selected pin(s).
EXAMPLE 5-2:
INITIALIZING PORTB
BCF
CLRF
STATUS, RP0
PORTB
BSF
MOVLW
STATUS, RP0
0xCF
MOVWF
TRISB
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTB by
clearing output
data latches
Select Bank 1
Value used to
initialize data
direction
Set RB<3:0> as inputs
RB<5:4> as outputs
RB<7:6> as inputs
FIGURE 5-3:
BLOCK DIAGRAM OF
RB3:RB0 PINS
VDD
RBPU(2)
Data bus
WR Port
weak
P pull-up
Data Latch
D
Q
I/O
pin(1)
CK
TRIS Latch
D
Q
WR TRIS
TTL
Input
Buffer
CK
RD TRIS
Q
RD Port
D
EN
RB0/INT
Schmitt Trigger
Buffer
RD Port
DS30390E-page 45
PIC16C7X
FIGURE 5-4:
BLOCK DIAGRAM OF
RB7:RB4 PINS (PIC16C73/74)
FIGURE 5-5:
VDD
RBPU(2)
weak
P pull-up
Data Latch
D
Q
Data bus
WR Port
I/O
pin(1)
CK
WR TRIS
VDD
RBPU(2)
Data bus
WR Port
TRIS Latch
D
Q
TTL
Input
Buffer
CK
RD TRIS
Q
BLOCK DIAGRAM OF
RB7:RB4 PINS (PIC16C72/
73A/74A/76/77)
weak
P pull-up
Data Latch
D
Q
I/O
pin(1)
CK
TRIS Latch
D
Q
ST
Buffer
WR TRIS
Latch
D
TTL
Input
Buffer
CK
RD TRIS
Q
ST
Buffer
Latch
D
EN
RD Port
Set RBIF
EN
RD Port
Q1
Set RBIF
From other
RB7:RB4 pins
D
EN
RD Port
From other
RB7:RB4 pins
RD Port
EN
TABLE 5-3:
Name
Q3
PORTB FUNCTIONS
Bit#
Buffer
Function
TTL/ST(1)
RB0/INT
bit0
DS30390E-page 46
PIC16C7X
TABLE 5-4:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
06h, 106h
PORTB
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
uuuu uuuu
86h, 186h
TRISB
1111 1111
1111 1111
81h, 181h
OPTION
1111 1111
1111 1111
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
DS30390E-page 47
PIC16C7X
5.3
FIGURE 5-6:
Applicable Devices
72 73 73A 74 74A 76 77
PORTC is an 8-bit bi-directional port. Each pin is individually configurable as an input or output through the
TRISC register. PORTC is multiplexed with several
peripheral functions (Table 5-5). PORTC pins have
Schmitt Trigger input buffers.
When enabling peripheral functions, care should be
taken in defining TRIS bits for each PORTC pin. Some
peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to
make a pin an input. Since the TRIS bit override is in
effect while the peripheral is enabled, read-modifywrite instructions (BSF, BCF, XORWF) with TRISC as
destination should be avoided. The user should refer to
the corresponding peripheral section for the correct
TRIS bit settings.
EXAMPLE 5-3:
PORT/PERIPHERAL Select(2)
Peripheral Data Out
Data bus
WR
PORT
STATUS, RP0
STATUS, RP1
PORTC
BSF
MOVLW
STATUS, RP0
0xCF
MOVWF
TRISC
;
;
;
;
;
;
;
;
;
;
;
;
Select Bank 0
PIC16C76/77 only
Initialize PORTC by
clearing output
data latches
Select Bank 1
Value used to
initialize data
direction
Set RC<3:0> as inputs
RC<5:4> as outputs
RC<7:6> as inputs
VDD
0
Q
1
CK
Data Latch
WR
TRIS
D
CK
I/O
pin(1)
Q
Q
TRIS Latch
VSS
Schmitt
Trigger
RD TRIS
Peripheral
OE(3)
INITIALIZING PORTC
BCF
BCF
CLRF
TABLE 5-5:
D
EN
RD
PORT
Peripheral input
PORTC FUNCTIONS
Name
Bit#
Buffer Type
Function
RC0/T1OSO/T1CKI
bit0
ST
RC1/T1OSI/CCP2(1)
bit1
ST
RC2/CCP1
bit2
ST
RC3/SCK/SCL
bit3
ST
RC3 can also be the synchronous serial clock for both SPI and I2C
modes.
RC4/SDI/SDA
bit4
ST
RC4 can also be the SPI Data In (SPI mode) or data I/O (I2C mode).
RC5/SDO
bit5
ST
(2)
RC6/TX/CK
bit6
ST
RC7/RX/DT(2)
bit7
ST
DS30390E-page 48
PIC16C7X
TABLE 5-6:
Address Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
07h
PORTC
RC7
RC6
RC5
RC4
RC3
RC2
RC1
RC0
xxxx xxxx
uuuu uuuu
87h
TRISC
1111 1111
1111 1111
DS30390E-page 49
PIC16C7X
5.4
FIGURE 5-7:
Applicable Devices
72 73 73A 74 74A 76 77
Data
bus
PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or
output.
WR
PORT
PORTD can be configured as an 8-bit wide microprocessor port (parallel slave port) by setting control bit
PSPMODE (TRISE<4>). In this mode, the input buffers
are TTL.
I/O pin(1)
CK
Data Latch
D
WR
TRIS
Schmitt
Trigger
input
buffer
CK
TRIS Latch
RD TRIS
Q
D
EN
EN
RD PORT
Note 1: I/O pins have protection diodes to VDD and VSS.
TABLE 5-7:
Name
PORTD FUNCTIONS
Bit#
Buffer Type
bit0
ST/TTL(1)
RD1/PSP1
bit1
(1)
ST/TTL
RD2/PSP2
bit2
ST/TTL(1)
bit3
(1)
(1)
(1)
RD0/PSP0
RD3/PSP3
RD4/PSP4
ST/TTL
bit4
ST/TTL
Function
RD5/PSP5
bit5
ST/TTL
RD6/PSP6
bit6
ST/TTL(1)
(1)
TABLE 5-8:
Address Name
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
RD5
RD4
RD3
RD2
RD1
RD0
xxxx xxxx
uuuu uuuu
1111 1111
1111 1111
0000 -111
0000 -111
08h
PORTD
RD7
88h
TRISD
89h
TRISE
IBF
RD6
OBF
IBOV PSPMODE
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PORTD.
DS30390E-page 50
PIC16C7X
5.5
Note:
Applicable Devices
72 73 73A 74 74A 76 77
FIGURE 5-8:
Data
bus
WR
PORT
I/O PORTE becomes control inputs for the microprocessor port when bit PSPMODE (TRISE<4>) is set. In
this mode, the user must make sure that the
TRISE<2:0> bits are set (pins are configured as digital
inputs) and that register ADCON1 is configured for digital I/O. In this mode the input buffers are TTL.
I/O pin(1)
CK
WR
TRIS
Schmitt
Trigger
input
buffer
CK
TRIS Latch
RD TRIS
Q
R-0
IBF
bit7
Data Latch
Figure 5-9 shows the TRISE register, which also controls the parallel slave port operation.
FIGURE 5-9:
D
EN
EN
RD PORT
Note 1: I/O pins have protection diodes to VDD and VSS.
R-0
OBF
R/W-0
IBOV
R/W-0
PSPMODE
U-0
R/W-1
bit2
R/W-1
bit1
R/W-1
bit0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 7 :
bit 6:
bit 5:
bit 4:
bit 3:
bit 1:
bit 0:
DS30390E-page 51
PIC16C7X
TABLE 5-9:
PORTE FUNCTIONS
Name
Bit#
Buffer Type
Function
RE0/RD/AN5
bit0
ST/TTL(1)
Input/output port pin or read control input in parallel slave port mode or
analog input:
RD
1 = Not a read operation
0 = Read operation. Reads PORTD register (if chip selected)
RE1/WR/AN6
bit1
ST/TTL(1)
Input/output port pin or write control input in parallel slave port mode or
analog input:
WR
1 = Not a write operation
0 = Write operation. Writes PORTD register (if chip selected)
bit2
ST/TTL(1)
Input/output port pin or chip select control input in parallel slave port
mode or analog input:
CS
1 = Device is not selected
0 = Device is selected
Legend: ST = Schmitt Trigger input TTL = TTL input
Note 1: Input buffers are Schmitt Triggers when in I/O mode and TTL buffers when in Parallel Slave Port Mode.
RE2/CS/AN7
TABLE 5-10:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other resets
PORTE
RE2
RE1
RE0
---- -xxx
---- -uuu
89h
TRISE
IBF
OBF
IBOV
PSPMODE
0000 -111
0000 -111
9Fh
ADCON1
---- -000
---- -000
Address
Name
09h
PCFG1
PCFG0
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PORTE.
DS30390E-page 52
PIC16C7X
5.6
EXAMPLE 5-4:
Applicable Devices
72 73 73A 74 74A 76 77
5.6.1
READ-MODIFY-WRITE
INSTRUCTIONS ON AN I/O
PORT
PC
PC + 1
PC + 2
PC + 3
NOP
NOP
RB7:RB0
Port pin
sampled here
TPD
Instruction
executed
NOP
MOVWF PORTB
write to
PORTB
Note:
MOVF PORTB,W
DS30390E-page 53
PIC16C7X
5.7
WR
PORT
RDx
pin
CK
TTL
Q
RD
PORT
D
EN
EN
Read
TTL
RD
Chip Select
TTL
CS
TTL
WR
Write
DS30390E-page 54
PIC16C7X
FIGURE 5-12: PARALLEL SLAVE PORT WRITE WAVEFORMS
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q4
Q1
Q2
Q3
Q4
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
Q2
Q3
Q4
Q1
Q2
Q3
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
TABLE 5-11:
Address Name
Bit 7
Bit 6
08h
PORTD
09h
PORTE
89h
TRISE
IBF
OBF
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
IBOV PSPMODE
RE2
RE1
RE0
Value on:
POR,
BOR
Value on all
other resets
xxxx xxxx
uuuu uuuu
---- -xxx
---- -uuu
0000 -111
0000 -111
0Ch
PIR1
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
8Ch
PIE1
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
0000 0000
0000 0000
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
---- -000
---- -000
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Parallel Slave Port.
DS30390E-page 55
PIC16C7X
NOTES:
DS30390E-page 56
PIC16C7X
6.0
OVERVIEW OF TIMER
MODULES
Applicable Devices
72 73 73A 74 74A 76 77
CCP module, Timer1 is the time-base for 16-bit Capture or the 16-bit Compare and must be synchronized
to the device.
6.3
Applicable Devices
72 73 73A 74 74A 76 77
6.1
Timer0 Overview
Applicable Devices
72 73 73A 74 74A 76 77
6.2
Timer1 Overview
Applicable Devices
72 73 73A 74 74A 76 77
Timer2 Overview
6.4
CCP Overview
Applicable Devices
72 73 73A 74 74A 76 77
DS30390E-page 57
PIC16C7X
NOTES:
DS30390E-page 58
PIC16C7X
7.0
TIMER0 MODULE
Applicable Devices
72 73 73A 74 74A 76 77
The Timer0 module timer/counter has the following features:
8-bit timer/counter
Readable and writable
8-bit software programmable prescaler
Internal or external clock select
Interrupt on overflow from FFh to 00h
Edge select for external clock
7.1
Applicable Devices
72 73 73A 74 74A 76 77
The TMR0 interrupt is generated when the TMR0 register overflows from FFh to 00h. This overflow sets bit
T0IF (INTCON<2>). The interrupt can be masked by
clearing bit T0IE (INTCON<5>). Bit T0IF must be
cleared in software by the Timer0 module interrupt service routine before re-enabling this interrupt. The
TMR0 interrupt cannot awaken the processor from
SLEEP since the timer is shut off during SLEEP. See
Figure 7-4 for Timer0 interrupt timing.
FIGURE 7-1:
Timer0 Interrupt
PSout
1
Sync with
Internal
clocks
1
Programmable
Prescaler
RA4/T0CKI
pin
TMR0
PSout
(2 cycle delay)
T0SE
3
Set interrupt
flag bit T0IF
on overflow
PSA
FIGURE 7-2:
PC
(Program
Counter)
Instruction
Fetch
TMR0
T0
PC
PC+1
MOVWF TMR0
MOVF TMR0,W
T0+1
Instruction
Executed
PC+2
PC+3
T0+2
NT0
NT0
Write TMR0
executed
Read TMR0
reads NT0
Read TMR0
reads NT0
PC+4
MOVF TMR0,W
NT0
Read TMR0
reads NT0
PC+5
PC+6
MOVF TMR0,W
NT0+1
Read TMR0
reads NT0 + 1
NT0+2
T0
Read TMR0
reads NT0 + 2
DS30390E-page 59
PIC16C7X
FIGURE 7-3:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
PC
(Program
Counter)
PC-1
Instruction
Fetch
PC
PC+1
MOVWF TMR0
MOVF TMR0,W
PC+3
Instruction
Execute
PC+5
MOVF TMR0,W
PC+6
MOVF TMR0,W
Read TMR0
reads NT0
Read TMR0
reads NT0
PC+6
NT0+1
NT0
Write TMR0
executed
FIGURE 7-4:
PC+4
MOVF TMR0,W
T0+1
T0
TMR0
PC+2
MOVF TMR0,W
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0 + 1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT(3)
Timer0
FEh
T0IF bit
(INTCON<2>)
FFh
00h
01h
02h
GIE bit
(INTCON<7>)
INSTRUCTION
FLOW
PC
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
PC +1
PC +1
Inst (PC+1)
Inst (PC)
Dummy cycle
0004h
0005h
Inst (0004h)
Inst (0005h)
Dummy cycle
Inst (0004h)
DS30390E-page 60
PIC16C7X
7.2
Applicable Devices
72 73 73A 74 74A 76 77
When an external clock input is used for Timer0, it must
meet certain requirements. The requirements ensure
the external clock can be synchronized with the internal
phase clock (TOSC). Also, there is a delay in the actual
incrementing of Timer0 after synchronization.
7.2.1
FIGURE 7-5:
7.2.2
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Small pulse
misses sampling
(1)
(3)
External Clock/Prescaler
Output after sampling
Increment Timer0 (Q4)
Timer0
T0
T0 + 1
T0 + 2
Note 1: Delay from clock input change to Timer0 increment is 3Tosc to 7Tosc. (Duration of Q = Tosc).
Therefore, the error in measuring the interval between two edges on Timer0 input = 4Tosc max.
2: External clock if no prescaler selected, Prescaler output otherwise.
3: The arrows indicate the points in time where sampling occurs.
DS30390E-page 61
PIC16C7X
7.3
Prescaler
Applicable Devices
72 73 73A 74 74A 76 77
FIGURE 7-6:
Note:
CLKOUT (=Fosc/4)
0
RA4/T0CKI
pin
M
U
X
1
M
U
X
SYNC
2
Cycles
TMR0 reg
T0SE
T0CS
Watchdog
Timer
M
U
X
PSA
8-bit Prescaler
8
8 - to - 1MUX
PS2:PS0
PSA
0
MUX
PSA
WDT
Time-out
Note: T0CS, T0SE, PSA, PS2:PS0 are (OPTION<5:0>).
DS30390E-page 62
PIC16C7X
7.3.1
The prescaler assignment is fully under software control, i.e., it can be changed on the fly during program
execution.
Note:
EXAMPLE 7-1:
1)
BSF
STATUS, RP0
;Bank 1
2)
MOVLW
b'xx0x0xxx'
3)
MOVWF
OPTION_REG
4)
BCF
STATUS, RP0
;Bank 0
5)
CLRF
TMR0
6)
BSF
STATUS, RP1
;Bank 1
7)
MOVLW
b'xxxx1xxx'
8)
MOVWF
OPTION_REG
9)
CLRWDT
10) MOVLW
b'xxxx1xxx'
11) MOVWF
OPTION_REG
12) BCF
STATUS, RP0
;Bank 0
To change prescaler from the WDT to the Timer0 module use the sequence shown in Example 7-2.
EXAMPLE 7-2:
CLRWDT
BSF
MOVLW
MOVWF
BCF
STATUS, RP0
b'xxxx0xxx'
OPTION_REG
STATUS, RP0
TABLE 7-1:
Address
Name
01h,101h
TMR0
0Bh,8Bh,
INTCON
10Bh,18Bh
81h,181h
OPTION
85h
TRISA
Bit 7
Bit 6
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
xxxx xxxx
uuuu uuuu
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
T0CS
T0SE
PSA
PS2
PS1
PS0
1111 1111
1111 1111
--11 1111
--11 1111
Bit 5
PEIE
RBPU INTEDG
Value on all
other resets
Legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. Shaded cells are not used by Timer0.
DS30390E-page 63
PIC16C7X
NOTES:
DS30390E-page 64
PIC16C7X
8.0
TIMER1 MODULE
Applicable Devices
72 73 73A 74 74A 76 77
The Timer1 module is a 16-bit timer/counter consisting
of two 8-bit registers (TMR1H and TMR1L) which are
readable and writable. The TMR1 Register pair
(TMR1H:TMR1L) increments from 0000h to FFFFh
and rolls over to 0000h. The TMR1 Interrupt, if enabled,
is generated on overflow which is latched in interrupt
flag bit TMR1IF (PIR1<0>). This interrupt can be
enabled/disabled by setting/clearing TMR1 interrupt
enable bit TMR1IE (PIE1<0>).
Timer1 can operate in one of two modes:
As a timer
As a counter
The operating mode is determined by the clock select
bit, TMR1CS (T1CON<1>).
FIGURE 8-1:
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
bit7
R/W-0
R/W-0
TMR1CS TMR1ON
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 2:
bit 1:
bit 0:
DS30390E-page 65
PIC16C7X
8.1
8.2.1
Applicable Devices
72 73 73A 74 74A 76 77
When an external clock input is used for Timer1 in synchronized counter mode, it must meet certain requirements. The external clock requirement is due to
internal phase clock (Tosc) synchronization. Also, there
is a delay in the actual incrementing of TMR1 after synchronization.
8.2
FIGURE 8-2:
TMR1
TMR1H
Synchronized
clock input
TMR1L
1
TMR1ON
on/off
T1OSC
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2(2)
T1SYNC
(3)
1
T1OSCEN FOSC/4
Enable
Internal
Oscillator(1) Clock
Prescaler
1, 2, 4, 8
Synchronize
det
0
2
T1CKPS1:T1CKPS0
TMR1CS
SLEEP input
Note 1: When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
2: The CCP2 module is not implemented in the PIC16C72.
3: For the PIC16C73 and PIC16C74, the Schmitt Trigger is not implemented in external clock mode.
DS30390E-page 66
PIC16C7X
8.3
EXAMPLE 8-1:
; All interrupts
MOVF
TMR1H,
MOVWF TMPH
MOVF
TMR1L,
MOVWF TMPL
MOVF
TMR1H,
SUBWF TMPH,
BTFSC
GOTO
are disabled
W ;Read high byte
;
W ;Read low byte
;
W ;Read high byte
W ;Sub 1st read
; with 2nd read
STATUS,Z ;Is result = 0
CONTINUE ;Good 16-bit read
;
; TMR1L may have rolled over between the read
; of the high and low bytes. Reading the high
; and low bytes now will read a good value.
;
MOVF
TMR1H, W ;Read high byte
MOVWF TMPH
;
MOVF
TMR1L, W ;Read low byte
MOVWF TMPL
;
; Re-enable the Interrupt (if required)
CONTINUE
;Continue with your code
8.4
Timer1 Oscillator
Applicable Devices
72 73 73A 74 74A 76 77
TABLE 8-1:
CAPACITOR SELECTION
FOR THE TIMER1
OSCILLATOR
Osc Type
Freq
C1
C2
LP
32 kHz
100 kHz
200 kHz
33 pF
15 pF
15 pF
33 pF
15 pF
15 pF
Crystals Tested:
32.768 kHz Epson C-001R32.768K-A 20 PPM
100 kHz
Epson C-2 100.00 KC-P
20 PPM
200 kHz
STD XTL 200.000 kHz
20 PPM
Note 1: Higher capacitance increases the stability
of oscillator but also increases the start-up
time.
2: Since each resonator/crystal has its own
characteristics, the user should consult the
resonator/crystal manufacturer for appropriate values of external components.
DS30390E-page 67
PIC16C7X
8.5
8.6
Applicable Devices
72 73 73A 74 74A 76 77
Applicable Devices
72 73 73A 74 74A 76 77
Timer1 must be configured for either timer or synchronized counter mode to take advantage of this feature.
If Timer1 is running in asynchronous counter mode, this
reset operation may not work.
8.7
Timer1 Prescaler
Applicable Devices
72 73 73A 74 74A 76 77
In the event that a write to Timer1 coincides with a special event trigger from CCP1 or CCP2, the write will
take precedence.
In this mode of operation, the CCPRxH:CCPRxL registers pair effectively becomes the period register for
Timer1.
TABLE 8-2:
Address
Name
0Bh,8Bh,
INTCON
10Bh,18Bh
Value on:
POR,
BOR
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PIR1
PSPIF(1,2) ADIF
RCIF(2)
TXIF(2)
SSPIF
CCP1IF
TMR2IF
TMR1IF
8Ch
PIE1
PSPIE(1,2)
RCIE(2)
TXIE(2)
SSPIE
CCP1IE
TMR2IE
TMR1IE
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1 register
10h
T1CON
0Ch
ADIE
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer1 module.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
2: The PIC16C72 does not have a Parallel Slave Port or a USART, these bits are unimplemented, read as '0'.
DS30390E-page 68
PIC16C7X
9.0
TIMER2 MODULE
9.1
Applicable Devices
72 73 73A 74 74A 76 77
Applicable Devices
72 73 73A 74 74A 76 77
Timer2 is an 8-bit timer with a prescaler and a
postscaler. It can be used as the PWM time-base for
PWM mode of the CCP module(s). The TMR2 register
is readable and writable, and is cleared on any device
reset.
The input clock (FOSC/4) has a prescale option of 1:1,
1:4
or
1:16,
selected
by
control
bits
T2CKPS1:T2CKPS0 (T2CON<1:0>).
The Timer2 module has an 8-bit period register PR2.
Timer2 increments from 00h until it matches PR2 and
then resets to 00h on the next increment cycle. PR2 is
a readable and writable register. The PR2 register is initialized to FFh upon reset.
The match output of TMR2 goes through a 4-bit
postscaler (which gives a 1:1 to 1:16 scaling inclusive)
to generate a TMR2 interrupt (latched in flag bit
TMR2IF, (PIR1<1>)).
Timer2 can be shut off by clearing control bit TMR2ON
(T2CON<2>) to minimize power consumption.
9.2
Output of TMR2
Applicable Devices
72 73 73A 74 74A 76 77
FIGURE 9-1:
Sets flag
bit TMR2IF
TMR2
output (1)
Reset
Postscaler
1:1 to 1:16
4
EQ
TMR2 reg
Comparator
Prescaler
1:1, 1:4, 1:16
FOSC/4
PR2 reg
DS30390E-page 69
PIC16C7X
FIGURE 9-2:
U-0
bit7
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0
bit0
bit 7:
bit 6-3:
bit 2:
bit 1-0:
TABLE 9-1:
Address
Name
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PIR1
PSPIF(1,2)
ADIF
RCIF(2)
TXIF(2)
SSPIF
CCP1IF
TMR2IF
TMR1IF
8Ch
PIE1
(1,2)
PSPIE
ADIE
(2)
(2)
TMR1IE
11h
TMR2
0Bh,8Bh,
INTCON
10Bh,18Bh
0Ch
12h
T2CON
92h
PR2
Legend:
Note 1:
2:
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer2 module.
Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
The PIC16C72 does not have a Parallel Slave Port or a USART, these bits are unimplemented, read as '0'.
DS30390E-page 70
PIC16C7X
10.0
CAPTURE/COMPARE/PWM
MODULE(s)
Applicable Devices
72 73 73A 74 74A 76 77 CCP1
72 73 73A 74 74A 76 77 CCP2
TABLE 10-2:
CCP1 module:
Capture/Compare/PWM Register1 (CCPR1) is comprised of two 8-bit registers: CCPR1L (low byte) and
CCPR1H (high byte). The CCP1CON register controls
the operation of CCP1. All are readable and writable.
CCP2 module:
Capture/Compare/PWM Register2 (CCPR2) is comprised of two 8-bit registers: CCPR2L (low byte) and
CCPR2H (high byte). The CCP2CON register controls
the operation of CCP2. All are readable and writable.
For use of the CCP modules, refer to the Embedded
Control Handbook, "Using the CCP Modules" (AN594).
TABLE 10-1:
CCP Mode
Timer Resource
Capture
Compare
PWM
Timer1
Timer1
Timer2
Interaction
Capture
Capture
Capture
Compare
The compare should be configured for the special event trigger, which clears TMR1.
Compare
Compare
The compare(s) should be configured for the special event trigger, which clears TMR1.
PWM
PWM
The PWMs will have the same frequency, and update rate (TMR2 interrupt).
PWM
Capture
None
PWM
Compare
None
DS30390E-page 71
PIC16C7X
FIGURE 10-1: CCP1CON REGISTER (ADDRESS 17h)/CCP2CON REGISTER (ADDRESS 1Dh)
U-0
bit7
U-0
R/W-0
CCPxX
R/W-0
R/W-0
CCPxY CCPxM3
R/W-0
CCPxM2
R/W-0
R/W-0
CCPxM1 CCPxM0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
10.1
Capture Mode
Applicable Devices
72 73 73A 74 74A 76 77
In Capture mode, the RC2/CCP1 pin should be configured as an input by setting the TRISC<2> bit.
Note:
If the RC2/CCP1 is configured as an output, a write to the port can cause a capture
condition.
DS30390E-page 72
Prescaler
1, 4, 16
RC2/CCP1
Pin
CCPR1H
CCPR1L
Capture
Enable
and
edge detect
TMR1H
TMR1L
CCP1CON<3:0>
Qs
10.1.2
SOFTWARE INTERRUPT
PIC16C7X
10.1.4
CCP PRESCALER
10.2.1
MOVWF
10.2
CCP1CON
NEW_CAPT_PS
CCP1CON
The user must configure the RC2/CCP1 pin as an output by clearing the TRISC<2> bit.
Note:
10.2.2
Timer1 must be running in Timer mode or Synchronized Counter mode if the CCP module is using the
compare feature. In Asynchronous Counter mode, the
compare operation may not work.
10.2.3
Compare Mode
Applicable Devices
72 73 73A 74 74A 76 77
Note:
Comparator
TMR1H
TMR1L
DS30390E-page 73
PIC16C7X
10.3
PWM Mode
10.3.1
Applicable Devices
72 73 73A 74 74A 76 77
In Pulse Width Modulation (PWM) mode, the CCPx pin
produces up to a 10-bit resolution PWM output. Since
the CCP1 pin is multiplexed with the PORTC data latch,
the TRISC<2> bit must be cleared to make the CCP1
pin an output.
Note:
The PWM period is specified by writing to the PR2 register. The PWM period can be calculated using the following formula:
PWM period = [(PR2) + 1] 4 TOSC
(TMR2 prescale value)
PWM frequency is defined as 1 / [PWM period].
When TMR2 is equal to PR2, the following three events
occur on the next increment cycle:
TMR2 is cleared
The CCP1 pin is set (exception: if PWM duty
cycle = 0%, the CCP1 pin will not be set)
The PWM duty cycle is latched from CCPR1L into
CCPR1H
Note:
10.3.2
CCPR1H (Slave)
Comparator
Q
RC2/CCP1
TMR2
(Note 1)
TRISC<2>
Clear Timer,
CCP1 pin and
latch D.C.
PR2
Comparator
PWM PERIOD
Period
log
FOSC
FPWM
)
bits
log(2)
Duty Cycle
TMR2 = PR2
TMR2 = Duty Cycle
Note:
TMR2 = PR2
DS30390E-page 74
PIC16C7X
EXAMPLE 10-2: PWM PERIOD AND DUTY
CYCLE CALCULATION
In order to achieve higher resolution, the PWM frequency must be decreased. In order to achieve higher
PWM frequency, the resolution must be decreased.
Table 10-3 lists example PWM frequencies and resolutions for Fosc = 20 MHz. The TMR2 prescaler and PR2
values are also shown.
= [(PR2) + 1] 4 50 ns 1
10.3.3
PR2
= 63
1.
=2
256
= 2PWM RESOLUTION
PWM RESOLUTION
2.
50 ns 1
3.
4.
= PWM Resolution
5.
TABLE 10-3:
PWM Frequency
Address
TABLE 10-4:
16
0xFF
10
4
0xFF
10
78.12 kHz
156.3 kHz
208.3 kHz
1
0x3F
8
1
0x1F
7
1
0x17
5.5
1
0xFF
10
Name
0Bh,8Bh, INTCON
10Bh,18Bh
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
RCIF(2)
TXIF(2)
SSPIF
CCP1IF
TMR2IF
PSPIF(1,2) ADIF
Value on:
POR,
BOR
Value on
all other
resets
0Ch
PIR1
0Dh(2)
PIR2
8Ch
PIE1
8Dh(2)
PIE2
87h
TRISC
0Eh
0Fh
10h
T1CON
15h
CCPR1L
16h
CCPR1H
PSPIE(1,2) ADIE
RCIE(2)
TXIE(2)
SSPIE
CCP1IE
TMR2IE
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1register
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
17h
CCP1CON
1Bh(2)
CCPR2L
1Ch(2)
CCPR2H
1Dh(2)
CCP2CON
CCP1X
CCP2X
CCP1Y
CCP2Y
CCP1M3
CCP2M3
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by Capture and Timer1.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
2: The PIC16C72 does not have a Parallel Slave Port, USART or CCP2 module, these bits are unimplemented, read as '0'.
DS30390E-page 75
PIC16C7X
TABLE 10-5:
Address
Name
0Bh,8Bh, INTCON
10Bh,18Bh
0Ch
PIR1
Value on:
POR,
BOR
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PSPIF(1,2)
ADIF
RCIF(2)
TXIF(2)
SSPIF
CCP1IF
TMR2IF
TMR1IF
0Dh(2)
PIR2
CCP2IF
8Ch
PIE1
PSPIE(1,2)
ADIE
RCIE(2)
TXIE(2)
SSPIE
CCP1IE
TMR2IE
TMR1IE
8Dh(2)
PIE2
CCP2IE
87h
TRISC
11h
TMR2
92h
PR2
12h
T2CON
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
1Bh(2)
CCPR2L
1Ch(2)
CCPR2H
1Dh(2)
CCP2CON
Legend:
Note 1:
2:
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
CCP1X
CCP2X
CCP1Y
CCP2Y
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PWM and Timer2.
Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
The PIC16C72 does not have a Parallel Slave Port, USART or CCP2 module, these bits are unimplemented, read as '0'.
DS30390E-page 76
Applicable Devices
72 73 73A 74 74A 76 77
11.0
SYNCHRONOUS SERIAL
PORT (SSP) MODULE
11.1
PIC16C7X
DS30390E-page 77
Applicable Devices
PIC16C7X
11.2
72 73 73A 74 74A 76 77
This section contains register definitions and operational characteristics of the SPI module for the
PIC16C72, PIC16C73, PIC16C73A, PIC16C74,
PIC16C74A.
FIGURE 11-1: SSPSTAT: SYNC SERIAL PORT STATUS REGISTER (ADDRESS 94h)
U-0
bit7
U-0
R-0
D/A
R-0
P
R-0
S
R-0
R/W
R-0
UA
R-0
BF
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 4:
P: Stop bit (I2C mode only. This bit is cleared when the SSP module is disabled, SSPEN is cleared)
1 = Indicates that a stop bit has been detected last (this bit is '0' on RESET)
0 = Stop bit was not detected last
bit 3:
S: Start bit (I2C mode only. This bit is cleared when the SSP module is disabled, SSPEN is cleared)
1 = Indicates that a start bit has been detected last (this bit is '0' on RESET)
0 = Start bit was not detected last
bit 2:
bit 1:
bit 0:
DS30390E-page 78
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
FIGURE 11-2: SSPCON: SYNC SERIAL PORT CONTROL REGISTER (ADDRESS 14h)
R/W-0
WCOL
bit7
R/W-0
SSPOV
R/W-0
SSPEN
R/W-0
CKP
R/W-0
SSPM3
R/W-0
SSPM2
R/W-0
SSPM1
R/W-0
SSPM0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
DS30390E-page 79
PIC16C7X
11.2.1
Applicable Devices
72 73 73A 74 74A 76 77
The SPI mode allows 8-bits of data to be synchronously transmitted and received simultaneously. To
accomplish communication, typically three pins are
used:
Serial Data Out (SDO)
Serial Data In (SDI)
Serial Clock (SCK)
Additionally a fourth pin may be used when in a slave
mode of operation:
Slave Select (SS)
When initializing the SPI, several options need to be
specified. This is done by programming the appropriate
control bits in the SSPCON register (SSPCON<5:0>).
These control bits allow the following to be specified:
Master Mode (SCK is the clock output)
Slave Mode (SCK is the clock input)
Clock Polarity (Output/Input data on the Rising/
Falling edge of SCK)
Clock Rate (Master mode only)
Slave Select Mode (Slave mode only)
The SSP consists of a transmit/receive Shift Register
(SSPSR) and a Buffer register (SSPBUF). The SSPSR
shifts the data in and out of the device, MSb first. The
SSPBUF holds the data that was written to the SSPSR,
until the received data is ready. Once the 8-bits of data
have been received, that byte is moved to the SSPBUF
register. Then the Buffer Full bit, BF (SSPSTAT<0>)
and flag bit SSPIF are set. This double buffering of the
received data (SSPBUF) allows the next byte to start
reception before reading the data that was just
received. Any write to the SSPBUF register during
transmission/reception of data will be ignored, and the
write collision detect bit, WCOL (SSPCON<7>) will be
set. User software must clear bit WCOL so that it can
be determined if the following write(s) to the SSPBUF
completed successfully. When the application software
is expecting to receive valid data, the SSPBUF register
should be read before the next byte of data to transfer
is written to the SSPBUF register. The Buffer Full bit BF
(SSPSTAT<0>) indicates when the SSPBUF register
has been loaded with the received data (transmission
is complete). When the SSPBUF is read, bit BF is
cleared. This data may be irrelevant if the SPI is only a
transmitter. Generally the SSP Interrupt is used to
determine when the transmission/reception has completed. The SSPBUF register must be read and/or written. If the interrupt method is not going to be used, then
software polling can be done to ensure that a write collision does not occur. Example 11-1 shows the loading
of the SSPBUF (SSPSR) register for data transmission.
The shaded instruction is only required if the received
data is meaningful.
DS30390E-page 80
GOTO
BCF
MOVF
;Specify Bank 1
;Has data been
;received
;(transmit
;complete)?
;No
;Specify Bank 0
;W reg = contents
;of SSPBUF
;Save in user RAM
;W reg = contents
; of TXDATA
;New data to xmit
LOOP
STATUS, RP0
SSPBUF, W
MOVWF RXDATA
MOVF TXDATA, W
MOVWF SSPBUF
Internal
data bus
Read
Write
SSPBUF reg
SSPSR reg
RC4/SDI/SDA
shift
clock
bit0
RC5/SDO
SS Control
Enable
RA5/SS/AN4
Edge
Select
2
Clock Select
SSPM3:SSPM0
4
Edge
Select
RC3/SCK/
SCL
TMR2 output
2
Prescaler TCY
4, 16, 64
TRISC<3>
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
SDI
SDI
Shift Register
(SSPSR)
MSb
SDO
LSb
Shift Register
(SSPSR)
MSb
LSb
Serial Clock
SCK
PROCESSOR 1
SCK
PROCESSOR 2
DS30390E-page 81
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
FIGURE 11-5: SPI MODE TIMING, MASTER MODE OR SLAVE MODE W/O SS CONTROL
SCK
(CKP = 0)
SCK
(CKP = 1)
bit7
SDO
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SDI
bit7
bit0
SSPIF
bit6
bit7
SDO
bit5
bit4
bit3
bit2
bit1
bit0
SDI
bit7
bit0
SSPIF
TABLE 11-1:
Bit 5
Bit 4
T0IE
INTE
0Bh,8Bh
INTCON
GIE
PEIE
0Ch
PIR1
PSPIF(1,2)
ADIF
RCIF(2) TXIF(2)
SSPIF
8Ch
PIE1
PSPIE(1,2)
ADIE
RCIE(2) TXIE(2)
SSPIE
87h
TRISC
13h
SSPBUF
14h
SSPCON
SSPOV SSPEN
85h
TRISA
94h
SSPSTAT
CKP
Bit 3
RBIE
Bit 2
Bit 1
Bit 0
T0IF
INTF
RBIF
Value on
all other
resets
Name
WCOL
Bit 6
Value on:
POR,
BOR
Address
SSPM3 SSPM2
SSPM1
R/W
BF
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the SSP in SPI mode.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A, always maintain these bits clear.
2: The PIC16C72 does not have a Parallel Slave Port or USART, these bits are unimplemented, read as '0'.
DS30390E-page 82
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
11.3
This section contains register definitions and operational characteristics of the SPI module on the
PIC16C76 and PIC16C77 only.
FIGURE 11-7: SSPSTAT: SYNC SERIAL PORT STATUS REGISTER (ADDRESS 94h)(PIC16C76/77)
R/W-0 R/W-0
SMP
CKE
R-0
R-0
R-0
R-0
R-0
R-0
D/A
R/W
UA
BF
bit7
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 7:
bit 6:
CKE: SPI Clock Edge Select (Figure 11-11, Figure 11-12, and Figure 11-13)
CKP = 0
1 = Data transmitted on rising edge of SCK
0 = Data transmitted on falling edge of SCK
CKP = 1
1 = Data transmitted on falling edge of SCK
0 = Data transmitted on rising edge of SCK
bit 5:
bit 4:
P: Stop bit (I2C mode only. This bit is cleared when the SSP module is disabled, or when the Start bit is
detected last, SSPEN is cleared)
1 = Indicates that a stop bit has been detected last (this bit is '0' on RESET)
0 = Stop bit was not detected last
bit 3:
S: Start bit (I2C mode only. This bit is cleared when the SSP module is disabled, or when the Stop bit is
detected last, SSPEN is cleared)
1 = Indicates that a start bit has been detected last (this bit is '0' on RESET)
0 = Start bit was not detected last
bit 2:
bit 1:
bit 0:
DS30390E-page 83
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
FIGURE 11-8: SSPCON: SYNC SERIAL PORT CONTROL REGISTER (ADDRESS 14h)(PIC16C76/77)
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
bit7
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
DS30390E-page 84
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
11.3.1
The SPI mode allows 8-bits of data to be synchronously transmitted and received simultaneously. To
accomplish communication, typically three pins are
used:
Serial Data Out (SDO) RC5/SDO
Serial Data In (SDI) RC4/SDI/SDA
Serial Clock (SCK) RC3/SCK/SCL
Additionally a fourth pin may be used when in a slave
mode of operation:
GOTO
BCF
MOVF
;Specify Bank 1
;
;Has data been
;received
;(transmit
;complete)?
;No
;Specify Bank 0
;W reg = contents
; of SSPBUF
;Save in user RAM
LOOP
STATUS, RP0
SSPBUF, W
MOVWF RXDATA
MOVF
TXDATA, W
;W reg = contents
; of TXDATA
;New data to xmit
MOVWF SSPBUF
Write
SSPBUF reg
SSPSR reg
RC4/SDI/SDA
shift
clock
bit0
RC5/SDO
SS Control
Enable
RA5/SS/AN4
Edge
Select
2
Clock Select
SSPM3:SSPM0
4
Edge
Select
RC3/SCK/
SCL
TMR2 output
2
Prescaler TCY
4, 16, 64
TRISC<3>
DS30390E-page 85
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
SDI
SDI
Shift Register
(SSPSR)
MSb
SDO
LSb
Shift Register
(SSPSR)
MSb
LSb
Serial Clock
SCK
PROCESSOR 1
DS30390E-page 86
SCK
PROCESSOR 2
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
.
Note:
Note:
SDO
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SDI (SMP = 0)
bit7
bit0
SDI (SMP = 1)
bit7
bit0
SSPIF
FIGURE 11-12: SPI MODE TIMING (SLAVE MODE WITH CKE = 0) (PIC16C76/77)
SS (optional)
SCK (CKP = 0)
SCK (CKP = 1)
bit7
SDO
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SDI (SMP = 0)
bit7
bit0
SSPIF
DS30390E-page 87
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
FIGURE 11-13: SPI MODE TIMING (SLAVE MODE WITH CKE = 1) (PIC16C76/77)
SS
(not optional)
SCK (CKP = 0)
SCK (CKP = 1)
SDO
bit7
bit6
bit5
bit3
bit4
bit2
bit1
bit0
SDI (SMP = 0)
bit7
bit0
SSPIF
TABLE 11-2:
Address
Name
Value on:
POR,
BOR
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
8Ch
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
SSPIE
87h
TRISC
13h
SSPBUF
14h
SSPCON WCOL
85h
TRISA
94h
SSPSTAT
0Bh,8Bh.
INTCON
10Bh,18Bh
0Ch
SMP
CKE
SSPM1
SSPM0
R/W
UA
BF
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the SSP in SPI mode.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C76, always maintain these bits clear.
DS30390E-page 88
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
I 2C Overview
11.4
This section provides an overview of the Inter-Integrated Circuit (I 2C) bus, with Section 11.5 discussing
the operation of the SSP module in I2C mode.
The I 2C bus is a two-wire serial interface developed by
the Philips Corporation. The original specification, or
standard mode, was for data transfers of up to 100
Kbps. The enhanced specification (fast mode) is also
supported. This device will communicate with both
standard and fast mode devices if attached to the same
bus. The clock will determine the data rate.
The I 2C interface employs a comprehensive protocol to
ensure reliable transmission and reception of data.
When transmitting data, one device is the master
which initiates transfer on the bus and generates the
clock signals to permit that transfer, while the other
device(s) acts as the slave. All portions of the slave
protocol are implemented in the SSP modules hardware, except general call support, while portions of the
master protocol need to be addressed in the
PIC16CXX software. Table 11-3 defines some of the
I 2C bus terminology. For additional information on the
I 2C interface specification, refer to the Philips document The I 2C bus and how to use it. #939839340011,
which can be obtained from the Philips Corporation.
In the I 2C interface protocol each device has an
address. When a master wishes to initiate a data transfer, it first transmits the address of the device that it
wishes to talk to. All devices listen to see if this is
their address. Within this address, a bit specifies if the
master wishes to read-from/write-to the slave device.
The master and slave are always in opposite modes
(transmitter/receiver) of operation during a data transfer. That is they can be thought of as operating in either
of these two relations:
SDA
SCL
Start
Condition
TABLE 11-3:
P
Change
of Data
Allowed
Change
of Data
Allowed
Stop
Condition
Term
Description
Transmitter
Receiver
Master
The device which initiates the transfer, generates the clock and terminates the transfer.
Slave
Multi-master
More than one master device in a system. These masters can attempt to control the bus at the
same time without corrupting the message.
Arbitration
Procedure that ensures that only one of the master devices will control the bus. This ensure that
the transfer data does not get corrupted.
Synchronization
Procedure where the clock signals of two or more devices are synchronized.
DS30390E-page 89
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
ADDRESSING I 2C DEVICES
11.4.2
Data
Output by
Transmitter
Data
Output by
Receiver
R/W ACK
slave address
S
R/W
ACK
Sent by
Slave
Start Condition
Read/Write pulse
Acknowledge
sent by slave
= 0 for write
11.4.3
S
R/W
ACK
S
Start
Condition
LSb
acknowledge
SCL from
Master
not acknowledge
- Start Condition
- Read/Write Pulse
- Acknowledge
TRANSFER ACKNOWLEDGE
acknowledgment
signal from receiver
byte complete
interrupt with receiver
acknowledgment
signal from receiver
S
Start
Condition
DS30390E-page 90
2
Address
R/W
ACK
1
Wait
State
2
Data
38
9
ACK
P
Stop
Condition
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
SCL is high), but occurs after a data transfer acknowledge pulse (not the bus-free state). This allows a master to send commands to the slave and then receive
the requested information or to address a different
slave device. This sequence is shown in Figure 11-21.
Figure 11-19 and Figure 11-20 show Master-transmitter and Master-receiver data transfer sequences.
When a master does not wish to relinquish the bus (by
generating a STOP condition), a repeated START condition (Sr) must be generated. This condition is identical to the start condition (SDA goes high-to-low while
data transferred
(n bytes - acknowledge)
A master transmitter addresses a slave receiver with a
7-bit address. The transfer direction is not changed.
From master to slave
From slave to master
(write)
Data A
Data A/A P
data transferred
(n bytes - acknowledge)
A master reads a slave immediately after the first byte.
(write)
Data A P
(read)
A master transmitter addresses a slave receiver
with a 10-bit address.
Sr = repeated
Start Condition
(write)
Direction of transfer
may change at this point
Data A P
(read)
(write)
Combined format - A master addresses a slave with a 10-bit address, then transmits
data to this slave and reads data from this slave.
From master to slave
From slave to master
DS30390E-page 91
Applicable Devices
PIC16C7X
11.4.4
72 73 73A 74 74A 76 77
MULTI-MASTER
ARBITRATION
wait
state
DATA 1
DATA 2
start counting
HIGH period
CLK
1
SDA
CLK
2
counter
reset
SCL
SCL
DS30390E-page 92
Applicable Devices
72 73 73A 74 74A 76 77
11.5
SSP I 2C Operation
Write
SSPBUF reg
RC3/SCK/SCL
shift
clock
SSPSR reg
RC4/
SDI/
SDA
MSb
LSb
Match detect
Addr Match
SSPADD reg
Start and
Stop bit detect
Set, Reset
S, P bits
(SSPSTAT reg)
PIC16C7X
The SSPCON register allows control of the I2C operation. Four mode selection bits (SSPCON<3:0>) allow
one of the following I 2C modes to be selected:
I 2C Slave mode (7-bit address)
I 2C Slave mode (10-bit address)
I 2C Slave mode (7-bit address), with start and
stop bit interrupts enabled
I 2C Slave mode (10-bit address), with start and
stop bit interrupts enabled
I 2C Firmware controlled Master Mode, slave is
idle
Selection of any I 2C mode, with the SSPEN bit set,
forces the SCL and SDA pins to be open drain, provided these pins are programmed to inputs by setting
the appropriate TRISC bits.
The SSPSTAT register gives the status of the data
transfer. This information includes detection of a
START or STOP bit, specifies if the received byte was
data or address if the next byte is the completion of
10-bit address, and if this will be a read or write data
transfer. The SSPSTAT register is read only.
The SSPBUF is the register to which transfer data is
written to or read from. The SSPSR register shifts the
data in or out of the device. In receive operations, the
SSPBUF and SSPSR create a doubled buffered
receiver. This allows reception of the next byte to begin
before reading the last byte of received data. When the
complete byte is received, it is transferred to the
SSPBUF register and flag bit SSPIF is set. If another
complete byte is received before the SSPBUF register
is read, a receiver overflow has occurred and bit
SSPOV (SSPCON<6>) is set and the byte in the
SSPSR is lost.
The SSPADD register holds the slave address. In 10-bit
mode, the user first needs to write the high byte of the
address (1111 0 A9 A8 0). Following the high byte
address match, the low byte of the address needs to be
loaded (A7:A0).
DS30390E-page 93
Applicable Devices
PIC16C7X
11.5.1
72 73 73A 74 74A 76 77
SLAVE MODE
In slave mode, the SCL and SDA pins must be configured as inputs (TRISC<4:3> set). The SSP module will
override the input state with the output data when
required (slave-transmitter).
When an address is matched or the data transfer after
an address match is received, the hardware automatically will generate the acknowledge (ACK) pulse, and
then load the SSPBUF register with the received value
currently in the SSPSR register.
There are certain conditions that will cause the SSP
module not to give this ACK pulse. These are if either
(or both):
a)
b)
3.
4.
5.
ADDRESSING
TABLE 11-4:
6.
7.
8.
9.
BF
SSPOV
SSPSR SSPBUF
Generate ACK
Pulse
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
No
Yes
DS30390E-page 94
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
11.5.1.2
RECEPTION
SDA
SCL
SSPIF (PIR1<3>)
BF (SSPSTAT<0>)
Cleared in software
Bus Master
terminates
transfer
SSPOV (SSPCON<6>)
Bit SSPOV is set because the SSPBUF register is still full.
ACK is not sent.
DS30390E-page 95
Applicable Devices
PIC16C7X
11.5.1.3
72 73 73A 74 74A 76 77
TRANSMISSION
SCL
A7
A6
1
2
Data in
sampled
SSPIF (PIR1<3>)
R/W = 1
A5
A4
A3
A2
A1
ACK
Transmitting Data
ACK
D7
1
SCL held low
while CPU
responds to SSPIF
D6
D5
D4
D3
D2
D1
D0
cleared in software
BF (SSPSTAT<0>)
SSPBUF is written in software
CKP (SSPCON<4>)
Set bit after writing to SSPBUF
(the SSPBUF must be written-to
before the CKP bit can be set)
DS30390E-page 96
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
11.5.2
11.5.3
MASTER MODE
In multi-master operation, the SDA line must be monitored to see if the signal level is the expected output
level. This check only needs to be done when a high
level is output. If a high level is expected and a low level
is present, the device needs to release the SDA and
SCL lines (set TRISC<4:3>). There are two stages
where this arbitration can be lost, these are:
Address Transfer
Data Transfer
START condition
STOP condition
Data transfer byte transmitted/received
TABLE 11-5:
MULTI-MASTER MODE
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR,
BOR
Value on all
other resets
0Bh, 8Bh,
10Bh,18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
0000 0000
0000 0000
8Ch
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
0000 0000
0000 0000
13h
xxxx xxxx
uuuu uuuu
93h
0000 0000
0000 0000
14h
SSPCON
WCOL
SSPOV SSPEN
0000 0000
0000 0000
94h
SSPSTAT
SMP(2)
CKE(2)
0000 0000
0000 0000
87h
TRISC
1111 1111
1111 1111
D/A
CKP
P
R/W
UA
BF
DS30390E-page 97
Applicable Devices
PIC16C7X
72 73 73A 74 74A 76 77
Set interrupt;
if (R/W = 1)
Send ACK = 0;
set XMIT_MODE;
}
else if (R/W = 0) set RCV_MODE;
}
RCV_MODE:
if ((SSPBUF=Full) OR (SSPOV = 1))
{
Set SSPOV;
Do not acknowledge;
}
else
{
transfer SSPSR SSPBUF;
send ACK = 0;
}
Receive 8-bits in SSPSR;
Set interrupt;
XMIT_MODE:
While ((SSPBUF = Empty) AND (CKP=0)) Hold SCL Low;
Send byte;
Set interrupt;
if ( ACK Received = 1)
{
End of transmission;
Go back to IDLE_MODE;
}
else if ( ACK Received = 0) Go back to XMIT_MODE;
IDLE_MODE (10-Bit):
If (High_byte_addr_match AND (R/W = 0))
{
PRIOR_ADDR_MATCH = FALSE;
Set interrupt;
if ((SSPBUF = Full) OR ((SSPOV = 1))
{
Set SSPOV;
Do not acknowledge;
}
else
{
Set UA = 1;
Send ACK = 0;
While (SSPADD not updated) Hold SCL low;
Clear UA = 0;
Receive Low_addr_byte;
Set interrupt;
Set UA = 1;
If (Low_byte_addr_match)
{
PRIOR_ADDR_MATCH = TRUE;
Send ACK = 0;
while (SSPADD not updated) Hold SCL low;
Clear UA = 0;
Set RCV_MODE;
}
}
}
else if (High_byte_addr_match AND (R/W = 1)
{
if (PRIOR_ADDR_MATCH)
{
send ACK = 0;
set XMIT_MODE;
}
else PRIOR_ADDR_MATCH = FALSE;
}
DS30390E-page 98
PIC16C7X
12.0
UNIVERSAL SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (USART)
as a half duplex synchronous system that can communicate with peripheral devices such as A/D or D/A integrated circuits, Serial EEPROMs etc.
The USART can be configured in the following modes:
Applicable Devices
72 73 73A 74 74A 76 77
FIGURE 12-1: TXSTA: TRANSMIT STATUS AND CONTROL REGISTER (ADDRESS 98h)
R/W-0
CSRC
bit7
bit 7:
R/W-0
TX9
R/W-0
TXEN
R/W-0
SYNC
U-0
R/W-0
BRGH
R-1
TRMT
R/W-0
TX9D
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
DS30390E-page 99
PIC16C7X
FIGURE 12-2: RCSTA: RECEIVE STATUS AND CONTROL REGISTER (ADDRESS 18h)
R/W-0
SPEN
bit7
R/W-0
RX9
R/W-0
SREN
R/W-0
CREN
U-0
R-0
FERR
R-0
OERR
R-x
RX9D
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n =Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
DS30390E-page 100
PIC16C7X
12.1
Applicable Devices
72 73 73A 74 74A 76 77
The BRG supports both the Asynchronous and Synchronous modes of the USART. It is a dedicated 8-bit
baud rate generator. The SPBRG register controls the
period of a free running 8-bit timer. In asynchronous
mode bit BRGH (TXSTA<2>) also controls the baud
rate. In synchronous mode bit BRGH is ignored.
Table 12-1 shows the formula for computation of the
baud rate for different USART modes which only apply
in master mode (internal clock).
9600 =
25.042 = 25
Given the desired baud rate and Fosc, the nearest integer value for the SPBRG register can be calculated
using the formula in Table 12-1. From this, the error in
baud rate can be determined.
9615
(Calculated Baud Rate - Desired Baud Rate)
Desired Baud Rate
0.16%
Note:
TABLE 12-1:
SYNC
0
1
TABLE 12-2:
Value on:
POR,
BOR
Value on all
other resets
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
0000 -010
18h
RCSTA
SPEN
RX9
SREN CREN
FERR
0000 -00x
99h
SPBRG
0000 0000
0000 0000
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used by the BRG.
DS30390E-page 101
PIC16C7X
TABLE 12-3:
BAUD
RATE
(K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
FOSC = 20 MHz
KBAUD
NA
NA
NA
NA
19.53
76.92
96.15
294.1
500
5000
19.53
16 MHz
SPBRG
value
%
KBAUD
ERROR (decimal)
+1.73
+0.16
+0.16
-1.96
0
-
255
64
51
16
9
0
255
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
+0.16
+0.16
-0.79
+2.56
0
-
207
51
41
12
7
0
255
4 MHz
NA
NA
NA
9.766
19.23
75.76
96.15
312.5
500
2500
9.766
7.15909 MHz
SPBRG
SPBRG
value
value
%
%
KBAUD
ERROR (decimal)
ERROR (decimal)
+1.73
+0.16
-1.36
+0.16
+4.17
0
-
255
129
32
25
7
4
0
255
3.579545 MHz
NA
NA
NA
9.622
19.24
77.82
94.20
298.3
NA
1789.8
6.991
+0.23
+0.23
+1.32
-1.88
-0.57
-
1 MHz
185
92
22
18
5
0
255
32.768 kHz
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
KBAUD
%
value KBAUD
%
value
KBAUD
%
value KBAUD
%
value KBAUD
%
value
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
NA
NA
NA
9.6
19.2
79.2
97.48
316.8
NA
1267
4.950
TABLE 12-4:
BAUD
RATE
(K)
NA
NA
NA
NA
19.23
76.92
95.24
307.69
500
4000
15.625
10 MHz
SPBRG
value
%
KBAUD
ERROR (decimal)
0
0
+3.13
+1.54
+5.60
-
131
65
15
12
3
0
255
NA
NA
NA
9.615
19.231
76.923
1000
NA
NA
100
3.906
NA
1.221
2.404
9.469
19.53
78.13
104.2
312.5
NA
312.5
1.221
103
51
12
9
0
255
NA
NA
NA
9.622
19.04
74.57
99.43
298.3
NA
894.9
3.496
+0.23
-0.83
-2.90
+3.57
-0.57
-
92
46
11
8
2
0
255
NA
1.202
2.404
9.615
19.24
83.34
NA
NA
NA
250
0.9766
+0.16
+0.16
+0.16
+0.16
+8.51
-
207
103
25
12
2
0
255
0.303
1.170
NA
NA
NA
NA
NA
NA
NA
8.192
0.032
+1.14
-2.48
-
26
6
0
255
FOSC = 20 MHz
KBAUD
+0.16
+0.16
+0.16
+4.17
-
16 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+1.73
+0.16
-1.36
+1.73
+1.73
+8.51
+4.17
-
255
129
32
15
3
2
0
0
255
NA
1.202
2.404
9.615
19.23
83.33
NA
NA
NA
250
0.977
10 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+0.16
+0.16
+0.16
+0.16
+8.51
-
207
103
25
12
2
0
255
4 MHz
NA
1.202
2.404
9.766
19.53
78.13
NA
NA
NA
156.3
0.6104
7.15909 MHz
SPBRG
SPBRG
%
value
%
value
ERROR (decimal) KBAUD ERROR (decimal)
+0.16
+0.16
+1.73
+1.73
+1.73
-
3.579545 MHz
129
64
15
7
1
0
255
NA
1.203
2.380
9.322
18.64
NA
NA
NA
NA
111.9
0.437
+0.23
-0.83
-2.90
-2.90
-
1 MHz
92
46
11
5
0
255
32.768 kHz
BAUD
RATE
(K)
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
%
value
%
value
%
value
%
value
%
value
KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
0.31
1.2
2.4
9.9
19.8
79.2
NA
NA
NA
79.2
0.3094
+3.13
0
0
+3.13
+3.13
+3.13
-
DS30390E-page 102
255
65
32
7
3
0
0
255
0.3005
1.202
2.404
NA
NA
NA
NA
NA
NA
62.500
3.906
-0.17
+1.67
+1.67
-
207
51
25
0
255
0.301
1.190
2.432
9.322
18.64
NA
NA
NA
NA
55.93
0.2185
+0.23
-0.83
+1.32
-2.90
-2.90
-
185
46
22
5
2
0
255
0.300
1.202
2.232
NA
NA
NA
NA
NA
NA
15.63
0.0610
+0.16
+0.16
-6.99
-
51
12
6
0
255
0.256
NA
NA
NA
NA
NA
NA
NA
NA
0.512
0.0020
-14.67
-
1
0
255
PIC16C7X
TABLE 12-5:
BAUD
RATE
(K)
9.6
19.2
38.4
57.6
115.2
250
625
1250
BAUD
RATE
(K)
FOSC = 20 MHz
KBAUD
9.615
19.230
37.878
56.818
113.636
250
625
1250
16 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+0.16
+0.16
-1.36
-1.36
-1.36
0
0
0
129
64
32
21
10
4
1
0
9.615
19.230
38.461
58.823
111.111
250
NA
NA
10 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+0.16
+0.16
+0.16
+2.12
-3.55
0
-
103
51
25
16
8
3
-
9.615
18.939
39.062
56.818
125
NA
625
NA
7.16 MHz
SPBRG
SPBRG
%
value
%
value
ERROR (decimal) KBAUD ERROR (decimal)
+0.16
-1.36
+1.7
-1.36
+8.51
0
-
64
32
15
10
4
0
-
9.520
19.454
37.286
55.930
111.860
NA
NA
NA
-0.83
+1.32
-2.90
-2.90
-2.90
-
46
22
11
7
3
-
4 MHz
3.579 MHz
1 MHz
32.768 kHz
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
%
value
%
value
%
value
%
value
%
value
KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal)
9.6
19.2
9.6
18.645
0
-2.94
32
16
NA
1.202
38.4
57.6
115.2
250
625
1250
39.6
52.8
105.6
NA
NA
NA
+3.12
-8.33
-8.33
-
7
5
2
-
2.403
9.615
19.231
NA
NA
NA
Note:
+0.17
+0.13
+0.16
+0.16
-
207
9.727
18.643
+1.32
-2.90
22
11
8.928
20.833
-6.99
+8.51
6
2
NA
NA
103
25
12
-
37.286 -2.90
55.930 -2.90
111.860 -2.90
223.721 -10.51
NA
NA
-
5
3
1
0
-
31.25
62.5
NA
NA
NA
NA
-18.61
+8.51
-
1
0
-
NA
NA
NA
NA
NA
NA
For the PIC16C73/73A/74/74A, the asynchronous high speed mode (BRGH = 1) may experience a high
rate of receive errors. It is recommended that BRGH = 0. If you desire a higher baud rate than BRGH = 0
can support, refer to the device errata for additional information, or use the PIC16C76/77.
DS30390E-page 103
PIC16C7X
12.1.1
SAMPLING
RX
(RC7/RX/DT pin)
Bit0
Baud CLK for all but start bit
baud CLK
x16 CLK
1
10
11
12
13
14
15
16
Samples
bit0
Start Bit
bit1
baud clk
First falling edge after RX pin goes low
Second rising edge
x4 clk
1
Q2, Q4 clk
Samples
Samples
Samples
bit0
Baud clk for all but start bit
baud clk
Q2, Q4 clk
Samples
DS30390E-page 104
PIC16C7X
FIGURE 12-6: RX PIN SAMPLING SCHEME, BRGH = 0 OR BRGH = 1 (PIC16C76/77)
Start bit
RX
(RC7/RX/DT pin)
Bit0
Baud CLK for all but start bit
baud CLK
x16 CLK
1
10
11
12
13
14
15
16
Samples
DS30390E-page 105
PIC16C7X
12.2
Applicable Devices
72 73 73A 74 74A 76 77
In this mode, the USART uses standard nonreturn-tozero (NRZ) format (one start bit, eight or nine data bits
and one stop bit). The most common data format is
8-bits. An on-chip dedicated 8-bit baud rate generator
can be used to derive standard baud rate frequencies
from the oscillator. The USART transmits and receives
the LSb first. The USARTs transmitter and receiver are
functionally independent but use the same data format
and baud rate. The baud rate generator produces a
clock either x16 or x64 of the bit shift rate, depending
on bit BRGH (TXSTA<2>). Parity is not supported by
the hardware, but can be implemented in software (and
stored as the ninth data bit). Asynchronous mode is
stopped during SLEEP.
12.2.1
TXREG register
TXIE
8
MSb
LSb
(8)
Pin Buffer
and Control
TSR register
RC6/TX/CK pin
Interrupt
TXEN
SPEN
SPBRG
Baud Rate Generator
TX9
TX9D
DS30390E-page 106
PIC16C7X
Steps to follow when setting up an Asynchronous
Transmission:
4.
1.
5.
2.
3.
6.
7.
BRG output
(shift clock)
RC6/TX/CK (pin)
Start Bit
Bit 0
Bit 1
Bit 7/8
Stop Bit
WORD 1
TXIF bit
(Transmit buffer
reg. empty flag)
WORD 1
Transmit Shift Reg
TRMT bit
(Transmit shift
reg. empty flag)
BRG output
(shift clock)
RC6/TX/CK (pin)
TXIF bit
(interrupt reg. flag)
TRMT bit
(Transmit shift
reg. empty flag)
Word 2
Start Bit
Bit 0
Bit 1
WORD 1
Bit 7/8
Stop Bit
Start Bit
Bit 0
WORD 2
WORD 1
Transmit Shift Reg.
WORD 2
Transmit Shift Reg.
TABLE 12-6:
Value on
all other
Resets
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
0000 0000
0000 0000
18h
RCSTA
19h
8Ch
PIE1
SPEN
PSPIE(1)
RX9
ADIE
SREN
RCIE
CREN
TXIE
FERR
SSPIE CCP1IE
OERR
TMR2IE
TMR1IE
BRGH
TRMT
TX9D
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
DS30390E-page 107
PIC16C7X
12.2.2
FERR
OERR
CREN
SPBRG
64
or
16
RSR register
MSb
Stop (8)
LSb
0 Start
RC7/RX/DT
Pin Buffer
and Control
Data
Recovery
RX9
RX9D
SPEN
RCREG register
FIFO
8
RCIF
Interrupt
Data Bus
RCIE
Start
bit
bit0
bit1
bit7/8 Stop
bit
Start
bit
WORD 1
RCREG
bit0
bit7/8
Stop
bit
Start
bit
bit7/8
Stop
bit
WORD 2
RCREG
RCIF
(interrupt flag)
OERR bit
CREN
Note: This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word,
causing the OERR (overrun) bit to be set.
DS30390E-page 108
PIC16C7X
6.
2.
3.
4.
5.
TABLE 12-7:
Address Name
7.
8.
9.
Flag bit RCIF will be set when reception is complete and an interrupt will be generated if enable
bit RCIE was set.
Read the RCSTA register to get the ninth bit (if
enabled) and determine if any error occurred
during reception.
Read the 8-bit received data by reading the
RCREG register.
If any error occurred, clear the error by clearing
enable bit CREN.
Bit 6
Bit 5
PSPIF(1)
ADIF
RCIF
TXIF
SPEN
RX9
SREN
CREN
0Ch
PIR1
18h
RCSTA
1Ah
8Ch
PIE1
98h
TXSTA
99h
SPBRG
Bit 4
PSPIE(1)
ADIE
RCIE
TXIE
CSRC
TX9
TXEN
SYNC
Bit 3
Bit 2
SSPIF CCP1IF
FERR
Bit 1
Bit 0
Value on:
POR,
BOR
Value on
all other
Resets
TMR2IF
TMR1IF
0000 0000
0000 0000
OERR
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
TMR1IE
0000 0000
0000 0000
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
BRGH
TRMT
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Reception.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
DS30390E-page 109
PIC16C7X
12.3
DS30390E-page 110
PIC16C7X
TABLE 12-8:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
RX9D
0000 -00x
0000 -00x
18h
RCSTA
SPEN
RX9
SREN
CREN
FERR
OERR
19h
TXREG
0000 0000
0000 0000
8Ch
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
0000 0000
0000 0000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG Baud Rate Generator Register
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for Synchronous Master Transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
RC7/RX/DT pin
Bit 0
Bit 1
Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4
Bit 2
Bit 7
Bit 0
WORD 1
Bit 1
WORD 2
Bit 7
RC6/TX/CK pin
Write to
TXREG reg
Write word1
Write word2
TXIF bit
(Interrupt flag)
TRMT
TRMT bit
TXEN bit
'1'
'1'
Note: Sync master mode; SPBRG = '0'. Continuous transmission of two 8-bit words
bit0
bit1
bit2
bit6
bit7
RC6/TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
DS30390E-page 111
PIC16C7X
12.3.2
1.
TABLE 12-9:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
RX9D
0000 -00x
0000 -00x
18h
RCSTA
SPEN
RX9
SREN
CREN
FERR
OERR
1Ah
RCREG
0000 0000
0000 0000
8Ch
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
0000 0000
0000 0000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG Baud Rate Generator Register
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Master Reception.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
DS30390E-page 112
PIC16C7X
FIGURE 12-14: SYNCHRONOUS RECEPTION (MASTER MODE, SREN)
RC7/RX/DT pin
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
RC6/TX/CK pin
Write to
bit SREN
SREN bit
CREN bit '0'
'0'
RCIF bit
(interrupt)
Read
RXREG
Note: Timing diagram demonstrates SYNC master mode with bit SREN = '1' and bit BRG = '0'.
DS30390E-page 113
PIC16C7X
12.4
e)
2.
3.
4.
5.
6.
7.
Enable the synchronous slave serial port by setting bits SYNC and SPEN and clearing bit
CSRC.
Clear bits CREN and SREN.
If interrupts are desired, then set enable bit
TXIE.
If 9-bit transmission is desired, then set bit TX9.
Enable the transmission by setting enable bit
TXEN.
If 9-bit transmission is selected, the ninth bit
should be loaded in bit TX9D.
Start transmission by loading data to the
TXREG register.
DS30390E-page 114
12.4.2
2.
3.
4.
5.
6.
7.
8.
PIC16C7X
TABLE 12-10: REGISTERS ASSOCIATED WITH SYNCHRONOUS SLAVE TRANSMISSION
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
RX9D
0000 -00x
0000 -00x
18h
RCSTA
SPEN
RX9
SREN
CREN
FERR
OERR
19h
TXREG
0000 0000
0000 0000
8Ch
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE
0000 0000
0000 0000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG Baud Rate Generator Register
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
0Ch
PIR1
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
0000 0000
0000 0000
18h
RCSTA
SPEN
RX9
SREN
CREN
FERR
OERR
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
TMR1IE
0000 0000
0000 0000
TX9D
0000 -010
0000 -010
1Ah
RCREG
8Ch
PIE1
PSPIE(1)
98h
TXSTA
CSRC
ADIE
TX9
RCIE
TXEN
TXIE
SYNC
SSPIE
CCP1IE
BRGH
TMR2IE
TRMT
0000 0000
0000 0000
99h
SPBRG Baud Rate Generator Register
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Reception.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16C73/73A/76, always maintain these bits clear.
DS30390E-page 115
PIC16C7X
NOTES:
DS30390E-page 116
PIC16C7X
13.0
ANALOG-TO-DIGITAL
CONVERTER (A/D) MODULE
Applicable Devices
72 73 73A 74 74A 76 77
The analog-to-digital (A/D) converter module has five
inputs for the PIC16C72/73/73A/76, and eight for the
PIC16C74/74A/77.
The A/D allows conversion of an analog input signal to
a corresponding 8-bit digital number (refer to Application Note AN546 for use of A/D Converter). The output
of the sample and hold is the input into the converter,
which generates the result via successive approximation. The analog reference voltage is software selectable to either the devices positive supply voltage (VDD)
or the voltage level on the RA3/AN3/VREF pin.
R/W-0
CHS2
R/W-0
CHS1
R/W-0
CHS0
R/W-0
GO/DONE
U-0
R/W-0
ADON
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 1:
bit 0:
DS30390E-page 117
PIC16C7X
FIGURE 13-2: ADCON1 REGISTER (ADDRESS 9Fh)
U-0
bit7
U-0
U-0
U-0
U-0
R/W-0
PCFG2
R/W-0
PCFG1
R/W-0
PCFG0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented
bit, read as 0
- n = Value at POR reset
PCFG2:PCFG0
000
001
010
011
100
101
11x
RA0
A
A
A
A
A
A
D
RA1
A
A
A
A
A
A
D
RA2
A
A
A
A
D
D
D
RA5
A
A
A
A
D
D
D
RA3
A
VREF
A
VREF
A
VREF
D
A
A
D
D
D
D
D
A
A
D
D
D
D
D
VREF
VDD
RA3
VDD
RA3
VDD
RA3
A = Analog input
D = Digital I/O
Note 1: RE0, RE1, and RE2 are implemented on the PIC16C74/74A/77 only.
DS30390E-page 118
PIC16C7X
3.
4.
The ADRES register contains the result of the A/D conversion. When the A/D conversion is complete, the
result is loaded into the ADRES register, the GO/DONE
bit (ADCON0<2>) is cleared, and A/D interrupt flag bit
ADIF is set. The block diagrams of the A/D module are
shown in Figure 13-3.
5.
OR
2.
6.
7.
111
110
101
RE2/AN7(1)
RE1/AN6(1)
RE0/AN5(1)
100
RA5/AN4
VIN
011
(Input voltage)
RA3/AN3/VREF
010
RA2/AN2
A/D
Converter
001
RA1/AN1
VDD
000
RA0/AN0
000 or
010 or
100
VREF
(Reference
voltage)
001 or
011 or
101
PCFG2:PCFG0
DS30390E-page 119
PIC16C7X
13.1
VDD = 5V Rss = 7 k
Applicable Devices
72 73 73A 74 74A 76 77
EQUATION 13-1:
Temperature Coefficient
TACQ = 5 s + TCAP + [(Temp - 25C)(0.05 s/C)]
-51.2 pF (1 k + 7 k + 10 k) ln(0.0020)
CHOLD = 51.2 pF
Rs = 10 k
10.747 s + 1.25 s
11.997 s
Rs
ANx
CPIN
5 pF
VA
Sampling
Switch
VT = 0.6V
VT = 0.6V
RIC 1k
SS RSS
CHOLD
= DAC capacitance
= 51.2 pF
I leakage
500 nA
VSS
Legend CPIN
= input capacitance
VT
= threshold voltage
I leakage = leakage current at the pin due to
various junctions
RIC
SS
CHOLD
DS30390E-page 120
= interconnect resistance
= sampling switch
= sample/hold capacitance (from DAC)
6V
5V
VDD 4V
3V
2V
5 6 7 8 9 10 11
Sampling Switch
( k )
PIC16C7X
13.2
13.3
Applicable Devices
72 73 73A 74 74A 76 77
Applicable Devices
72 73 73A 74 74A 76 77
2TOSC
8TOSC
32TOSC
Internal RC oscillator
TABLE 13-1:
ADCS1:ADCS0
2TOSC
00
8TOSC
01
32TOSC
10
RC(5)
Legend:
Note 1:
2:
3:
4:
5:
Device Frequency
20 MHz
100
ns(2)
ns(2)
400
1.6 s
5 MHz
ns(2)
400
1.6 s
6.4 s
333.33 kHz
1.6 s
6 s
6.4 s
24 s(3)
25.6 s(3)
96 s(3)
2-6
2-6
2 - 6 s(1)
2 - 6 s
Shaded cells are outside of recommended range.
The RC source has a typical TAD time of 4 s.
These values violate the minimum required TAD time.
For faster conversion times, the selection of another clock source is recommended.
When device frequency is greater than 1 MHz, the RC A/D conversion clock source is recommended for
sleep operation only.
For extended voltage devices (LC), please refer to Electrical Specifications section.
11
(1,4)
s(1,4)
1.25 MHz
s(1,4)
DS30390E-page 121
PIC16C7X
13.4
A/D Conversions
Applicable Devices
72 73 73A 74 74A 76 77
Note:
Example 13-2 shows how to perform an A/D conversion. The RA pins are configured as analog inputs. The
analog reference (VREF) is the device VDD. The A/D
interrupt is enabled, and the A/D conversion clock is
FRC. The conversion is performed on the RA0 pin
(channel 0).
STATUS,
STATUS,
ADCON1
PIE1,
STATUS,
0xC1
ADCON0
PIR1,
INTCON,
INTCON,
RP0
RP1
ADIE
RP0
ADIF
PEIE
GIE
;
;
;
;
;
;
;
;
;
;
Select Bank 1
PIC16C76/77 only
Configure A/D inputs
Enable A/D interrupts
Select Bank 0
RC Clock, A/D is on, Channel 0 is selected
Clear A/D interrupt flag bit
Enable peripheral interrupts
Enable all interrupts
Ensure that the required sampling time for the selected input channel has elapsed.
Then the conversion may be started.
BSF
:
:
ADCON0, GO
DS30390E-page 122
PIC16C7X
13.4.1
Not all applications require a result with 8-bits of resolution, but may instead require a faster conversion time.
The A/D module allows users to make the trade-off of
conversion speed to resolution. Regardless of the resolution required, the acquisition time is the same. To
speed up the conversion, the clock source of the A/D
module may be switched so that the TAD time violates
the minimum specified time (see the applicable electrical specification). Once the TAD time violates the minimum specified time, all the following A/D result bits are
not valid (see A/D Conversion Timing in the Electrical
Specifications section.) The clock sources may only be
switched between the three oscillator versions (cannot
be switched from/to RC). The equation to determine
the time before the oscillator can be switched is as follows:
TAD
TOSC
2TAD + N TAD + (8 - N)(2TOSC)
20
16
20
16
20
16
Resolution
4-bit
8-bit
1.6 s
2.0 s
50 ns
62.5 ns
10 s
12.5 s
1.6 s
2.0 s
50 ns
62.5 ns
16 s
20 s
DS30390E-page 123
PIC16C7X
13.5
13.6
A/D Accuracy/Error
Applicable Devices
72 73 73A 74 74A 76 77
13.7
Effects of a RESET
Applicable Devices
72 73 73A 74 74A 76 77
DS30390E-page 124
PIC16C7X
13.8
04h
03h
02h
01h
256 LSb
(full scale)
4 LSb
255 LSb
00h
3 LSb
FFh
FEh
2 LSb
In the PIC16C72, the "special event trigger" is implemented in the CCP1 module.
0.5 LSb
1 LSb
Note:
Applicable Devices
72 73 73A 74 74A 76 77
13.11
13.9
References
Connection Considerations
Applicable Devices
72 73 73A 74 74A 76 77
A very good reference for understanding A/D converters is the "Analog-Digital Conversion Handbook" third
edition, published by Prentice Hall (ISBN
0-13-03-2848-0).
An external RC filter is sometimes added for anti-aliasing of the input signal. The R component should be
selected to ensure that the total source impedance is
kept under the 10 k recommended specification. Any
external components connected (via hi-impedance) to
an analog input pin (capacitor, zener diode, etc.) should
have very little leakage current at the pin.
13.10
Transfer Function
Applicable Devices
72 73 73A 74 74A 76 77
DS30390E-page 125
PIC16C7X
FIGURE 13-6: FLOWCHART OF A/D OPERATION
ADON = 0
Yes
ADON = 0?
No
Acquire
Selected Channel
Yes
GO = 0?
No
Yes
A/D Clock
= RC?
SLEEP Yes
Instruction?
Start of A/D
Conversion Delayed
1 Instruction Cycle
Finish Conversion
GO = 0
ADIF = 1
No
No
Yes
Device in
SLEEP?
Abort Conversion
GO = 0
ADIF = 0
Finish Conversion
GO = 0
ADIF = 1
Wake-up Yes
From Sleep?
Wait 2 TAD
No
No
Finish Conversion
GO = 0
ADIF = 1
SLEEP
Power-down A/D
Stay in Sleep
Power-down A/D
Wait 2 TAD
Wait 2 TAD
TABLE 13-2:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
0Bh,8Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
0Ch
PIR1
ADIF
SSPIF
CCP1IF
-0-- 0000
8Ch
PIE1
ADIE
SSPIE
CCP1IE
-0-- 0000
1Eh
ADRES
xxxx xxxx
uuuu uuuu
1Fh
CHS0
GO/DONE
ADON
0000 00-0
0000 00-0
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
---- -000
---- -000
RA0
--0x 0000
--0u 0000
05h
PORTA
RA5
RA4
RA3
RA2
RA1
DS30390E-page 126
PIC16C7X
TABLE 13-3:
Address
Name
INTCON
0Bh,8Bh,
10Bh,18Bh
PIR1
0Ch
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR,
BOR
Value on all
other Resets
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
PSPIF(1)
ADIF
RCIF
TXIF
SSPIF
CCP1IF
0000 0000
PIE1
PSPIE(1)
ADIE
RCIE
TXIE
SSPIE
CCP1IE
0000 0000
0Dh
PIR2
---- ---0
8Dh
PIE2
---- ---0
8Ch
1Eh
ADRES
xxxx xxxx
uuuu uuuu
1Fh
ADCON0
ADCS1
ADCS0
CHS2
CHS1
CHS0
GO/DONE
ADON
0000 00-0
0000 00-0
9Fh
ADCON1
PCFG2
PCFG1
PCFG0
---- -000
---- -000
RA0
--0x 0000
--0u 0000
05h
PORTA
85h
TRISA
RA5
RA4
RA3
RA2
RA1
--11 1111
--11 1111
---- -xxx
---- -uuu
RE2
RE1
RE0
09h
PORTE
0000 -111
89h
TRISE
IBF
OBF
IBOV PSPMODE
PORTE Data Direction Bits
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used for A/D conversion.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC6C73/73A/76, always maintain these bits clear.
0000 -111
DS30390E-page 127
PIC16C7X
NOTES:
DS30390E-page 128
PIC16C7X
14.0
What sets a microcontroller apart from other processors are special circuits to deal with the needs of realtime applications. The PIC16CXX family has a host of
such features intended to maximize system reliability,
minimize cost through elimination of external components, provide power saving operating modes and offer
code protection. These are:
Oscillator selection
Reset
- Power-on Reset (POR)
- Power-up Timer (PWRT)
- Oscillator Start-up Timer (OST)
- Brown-out Reset (BOR)
Interrupts
Watchdog Timer (WDT)
SLEEP
Code protection
ID locations
In-circuit serial programming
14.1
Configuration Bits
Applicable Devices
72 73 73A 74 74A 76 77
CP1
bit13
CP0
Register:
Address
CONFIG
2007h
bit 3:
bit 2:
bit 1-0:
DS30390E-page 129
PIC16C7X
FIGURE 14-2: CONFIGURATION WORD FOR PIC16C72/73A/74A/76/77
CP1
CP0
CP1
CP0
CP1
CP0
BODEN
CP1
bit13
CP0
bit 13-8
5-4:
bit 7:
bit 6:
bit 3:
bit 2:
bit 1-0:
Register:
Address
CONFIG
2007h
Note 1: Enabling Brown-out Reset automatically enables Power-up Timer (PWRT) regardless of the value of bit PWRTE.
Ensure the Power-up Timer is enabled anytime Brown-out Reset is enabled.
2: All of the CP1:CP0 pairs have to be given the same value to enable the code protection scheme listed.
DS30390E-page 130
PIC16C7X
14.2
Oscillator Configurations
TABLE 14-1:
Applicable Devices
72 73 73A 74 74A 76 77
14.2.1
Ranges Tested:
Mode
OSCILLATOR TYPES
XT
The PIC16CXX can be operated in four different oscillator modes. The user can program two configuration
bits (FOSC1 and FOSC0) to select one of these four
modes:
LP
XT
HS
RC
14.2.2
XTAL
To internal
logic
RF
OSC2
C2
SLEEP
PIC16CXX
RS
Note1
HS
68 - 100 pF
15 - 68 pF
15 - 68 pF
10 - 68 pF
10 - 22 pF
OSC2
68 - 100 pF
15 - 68 pF
15 - 68 pF
10 - 68 pF
10 - 22 pF
455 kHz
2.0 MHz
4.0 MHz
8.0 MHz
16.0 MHz
Panasonic EFO-A455K04B
Murata Erie CSA2.00MG
Murata Erie CSA4.00MG
Murata Erie CSA8.00MT
Murata Erie CSA16.00MX
0.3%
0.5%
0.5%
0.5%
0.5%
TABLE 14-2:
Osc Type
LP
XT
HS
CAPACITOR SELECTION
FOR CRYSTAL OSCILLATOR
Crystal
Freq
Cap. Range
C1
Cap. Range
C2
32 kHz
33 pF
33 pF
200 kHz
15 pF
15 pF
200 kHz
47-68 pF
47-68 pF
1 MHz
15 pF
15 pF
4 MHz
15 pF
15 pF
4 MHz
15 pF
15 pF
8 MHz
15-33 pF
15-33 pF
20 MHz
15-33 pF
15-33 pF
Clock from
ext. system
455 kHz
2.0 MHz
4.0 MHz
8.0 MHz
16.0 MHz
OSC1
Resonators Used:
C1
Freq
CRYSTAL OSCILLATOR/CERAMIC
RESONATORS
OSC1
CERAMIC RESONATORS
OSC2
32 kHz
Epson C-001R32.768K-A
20 PPM
200 kHz
20 PPM
1 MHz
ECS ECS-10-13-1
50 PPM
4 MHz
ECS ECS-40-20-1
50 PPM
8 MHz
30 PPM
20 MHz
30 PPM
DS30390E-page 131
PIC16C7X
14.2.3
4.7k
PIC16CXX
CLKIN
74AS04
RC OSCILLATOR
10k
XTAL
10k
20 pF
14.2.4
20 pF
See characterization data for desired device for variation of oscillator frequency due to VDD for given Rext/
Cext values as well as frequency variation due to operating temperature for given R, C, and VDD values.
The oscillator frequency, divided by 4, is available on
the OSC2/CLKOUT pin, and can be used for test purposes or to synchronize other logic (see Figure 3-4 for
waveform).
V DD
Rext
330 k
330 k
74AS04
74AS04
0.1 F
OSC1
To Other
Devices
74AS04
PIC16CXX
CLKIN
Cext
Internal
clock
PIC16CXX
VSS
Fosc/4
OSC2/CLKOUT
XTAL
DS30390E-page 132
PIC16C7X
14.3
Reset
Applicable Devices
72 73 73A 74 74A 76 77
The PIC16CXX differentiates between various kinds of
reset:
The PIC16C72/73A/74A/76/77 have a MCLR noise filter in the MCLR reset path. The filter will detect and
ignore small pulses.
It should be noted that a WDT Reset does not drive
MCLR pin low.
WDT
Module
VDD rise
detect
VDD
Power-on Reset
(2)
Brown-out
Reset
BODEN
OST/PWRT
OST
Chip_Reset
R
OSC1
(1)
On-chip
RC OSC
PWRT
10-bit Ripple counter
Enable PWRT
(3)
Enable OST
Note 1: This is a separate oscillator from the RC oscillator of the CLKIN pin.
2: Brown-out Reset is implemented on the PIC16C72/73A/74A/76/77.
3: See Table 14-3 and Table 14-4 for time-out situations.
DS30390E-page 133
PIC16C7X
14.4
The power-up time delay will vary from chip to chip due
to VDD, temperature, and process variation. See DC
parameters for details.
14.4.3
Applicable Devices
72 73 73A 74 74A 76 77
14.4.1
A configuration bit, BODEN, can disable (if clear/programmed) or enable (if set) the Brown-out Reset circuitry. If VDD falls below 4.0V (3.8V - 4.2V range) for
greater than parameter #35, the brown-out situation will
reset the chip. A reset may not occur if VDD falls below
4.0V for less than parameter #35. The chip will remain
in Brown-out Reset until VDD rises above BVDD. The
Power-up Timer will now be invoked and will keep the
chip in RESET an additional 72 ms. If VDD drops below
BVDD while the Power-up Timer is running, the chip will
go back into a Brown-out Reset and the Power-up
Timer will be initialized. Once VDD rises above BVDD,
the Power-up Timer will execute a 72 ms time delay.
The Power-up Timer should always be enabled when
Brown-out Reset is enabled. Figure 14-9 shows typical brown-out situations.
VDD
Internal
Reset
BVDD Max.
BVDD Min.
72 ms
VDD
Internal
Reset
BVDD Max.
BVDD Min.
<72 ms
72 ms
VDD
Internal
Reset
DS30390E-page 134
BVDD Max.
BVDD Min.
72 ms
PIC16C7X
14.4.5
14.4.6
TIME-OUT SEQUENCE
TABLE 14-3:
Power-up
PWRTE = 1
PWRTE = 0
72 ms + 1024TOSC
1024TOSC
72 ms
XT, HS, LP
RC
Oscillator Configuration
XT, HS, LP
RC
TABLE 14-5:
Oscillator Configuration
TABLE 14-4:
Power-up
PWRTE = 0
PWRTE = 1
72 ms + 1024TOSC
1024TOSC
72 ms
Brown-out
72 ms + 1024TOSC
72 ms
POR
TO
PD
0
0
0
1
1
1
1
1
0
x
0
0
u
1
1
x
0
1
0
u
0
Power-on Reset
Illegal, TO is set on POR
Illegal, PD is set on POR
WDT Reset
WDT Wake-up
MCLR Reset during normal operation
MCLR Reset during SLEEP or interrupt wake-up from SLEEP
DS30390E-page 135
PIC16C7X
TABLE 14-6:
POR
BOR
TO
PD
0
0
0
1
1
1
1
1
x
x
x
0
1
1
1
1
1
0
x
x
0
0
u
1
1
x
0
x
1
0
u
0
TABLE 14-7:
Power-on Reset
Illegal, TO is set on POR
Illegal, PD is set on POR
Brown-out Reset
WDT Reset
WDT Wake-up
MCLR Reset during normal operation
MCLR Reset during SLEEP or interrupt wake-up from SLEEP
Program
Counter
STATUS
Register
PCON
Register
PCON
Register
PIC16C73/74
PIC16C72/73A/74A/76/77
Power-on Reset
000h
0001 1xxx
---- --0-
---- --0x
000h
000u uuuu
---- --u-
---- --uu
000h
0001 0uuu
---- --u-
---- --uu
WDT Reset
000h
0000 1uuu
---- --u-
---- --uu
WDT Wake-up
PC + 1
uuu0 0uuu
---- --u-
---- --uu
Brown-out Reset
000h
0001 1uuu
N/A
---- --u0
PC + 1(1)
uuu1 0uuu
---- --u-
---- --uu
TABLE 14-8:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Resets
WDT Reset
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
INDF
72 73 73A 74 74A 76 77
N/A
N/A
N/A
TMR0
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
PCL
72 73 73A 74 74A 76 77
0000h
0000h
PC + 1(2)
STATUS
72 73 73A 74 74A 76 77
0001 1xxx
000q quuu(3)
uuuq quuu(3)
FSR
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTA
72 73 73A 74 74A 76 77
--0x 0000
--0u 0000
--uu uuuu
PORTB
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTC
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTD
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTE
72 73 73A 74 74A 76 77
---- -xxx
---- -uuu
---- -uuu
PCLATH
72 73 73A 74 74A 76 77
---0 0000
---0 0000
---u uuuu
Legend: u = unchanged, x = unknown, - = unimplemented bit, read as '0', q = value depends on condition
Note 1: One or more bits in INTCON, PIR1 and/or PIR2 will be affected (to cause wake-up).
2: When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector
(0004h).
3: See Table 14-7 for reset value for specific condition.
DS30390E-page 136
PIC16C7X
TABLE 14-8:
Register
Power-on Reset,
Brown-out Reset
MCLR Resets
WDT Reset
72 73 73A 74 74A 76 77
0000 000x
0000 000u
uuuu uuuu(1)
72 73 73A 74 74A 76 77
-0-- 0000
-0-- 0000
-u-- uuuu(1)
72 73 73A 74 74A 76 77
-000 0000
-000 0000
-uuu uuuu(1)
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu(1)
PIR2
72 73 73A 74 74A 76 77
---- ---0
---- ---0
---- ---u(1)
TMR1L
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
TMR1H
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
T1CON
72 73 73A 74 74A 76 77
--00 0000
--uu uuuu
--uu uuuu
TMR2
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
T2CON
72 73 73A 74 74A 76 77
-000 0000
-000 0000
-uuu uuuu
SSPBUF
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
SSPCON
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
CCPR1L
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR1H
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP1CON
72 73 73A 74 74A 76 77
--00 0000
--00 0000
--uu uuuu
RCSTA
72 73 73A 74 74A 76 77
0000 -00x
0000 -00x
uuuu -uuu
TXREG
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
RCREG
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
CCPR2L
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR2H
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP2CON
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
ADRES
72 73 73A 74 74A 76 77
xxxx xxxx
uuuu uuuu
uuuu uuuu
ADCON0
72 73 73A 74 74A 76 77
0000 00-0
0000 00-0
uuuu uu-u
OPTION
72 73 73A 74 74A 76 77
1111 1111
1111 1111
uuuu uuuu
TRISA
72 73 73A 74 74A 76 77
--11 1111
--11 1111
--uu uuuu
TRISB
72 73 73A 74 74A 76 77
1111 1111
1111 1111
uuuu uuuu
INTCON
PIR1
TRISC
72 73 73A 74 74A 76 77
1111 1111
1111 1111
uuuu uuuu
TRISD
72 73 73A 74 74A 76 77
1111 1111
1111 1111
uuuu uuuu
TRISE
72 73 73A 74 74A 76 77
0000 -111
0000 -111
uuuu -uuu
72 73 73A 74 74A 76 77
-0-- 0000
-0-- 0000
-u-- uuuu
72 73 73A 74 74A 76 77
-000 0000
-000 0000
-uuu uuuu
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
72 73 73A 74 74A 76 77
---- ---0
---- ---0
---- ---u
72 73 73A 74 74A 76 77
---- --0-
---- --u-
---- --u-
72 73 73A 74 74A 76 77
---- --0u
---- --uu
---- --uu
72 73 73A 74 74A 76 77
1111 1111
1111 1111
1111 1111
PIE1
PIE2
PCON
PR2
Legend: u = unchanged, x = unknown, - = unimplemented bit, read as '0', q = value depends on condition
Note 1: One or more bits in INTCON, PIR1 and/or PIR2 will be affected (to cause wake-up).
2: When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector
(0004h).
3: See Table 14-7 for reset value for specific condition.
DS30390E-page 137
PIC16C7X
TABLE 14-8:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Resets
WDT Reset
SSPADD
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
SSPSTAT
72 73 73A 74 74A 76 77
--00 0000
--00 0000
--uu uuuu
TXSTA
72 73 73A 74 74A 76 77
0000 -010
0000 -010
uuuu -uuu
SPBRG
72 73 73A 74 74A 76 77
0000 0000
0000 0000
uuuu uuuu
ADCON1
72 73 73A 74 74A 76 77
---- -000
---- -000
---- -uuu
Legend: u = unchanged, x = unknown, - = unimplemented bit, read as '0', q = value depends on condition
Note 1: One or more bits in INTCON, PIR1 and/or PIR2 will be affected (to cause wake-up).
2: When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector
(0004h).
3: See Table 14-7 for reset value for specific condition.
DS30390E-page 138
PIC16C7X
FIGURE 14-10: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
FIGURE 14-11: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
DS30390E-page 139
PIC16C7X
FIGURE 14-13: EXTERNAL POWER-ON
RESET CIRCUIT (FOR SLOW
VDD POWER-UP)
VDD
33k
VDD
10k
R
R1
40k
MCLR
C
MCLR
PIC16CXX
PIC16CXX
VDD
VDD
R1
Q1
MCLR
R2
40k
PIC16CXX
DS30390E-page 140
PIC16C7X
14.5
Interrupts
Applicable Devices
72 73 73A 74 74A 76 77
instructions. Individual interrupt flag bits are set regardless of the status of their corresponding mask bit or the
GIE bit.
Note:
Individual interrupt flag bits are set regardless of the status of their corresponding
mask bit or the GIE bit.
2.
3.
The Interrupt Service Routine completes with the execution of the RETFIE instruction. This causes the GIE
bit to be set (enables interrupts), and
the program returns to the instruction
after the one which was meant to disable interrupts.
INTCON, GIE
LOOP
; Disable global
; interrupt bit
; Global interrupt
;
disabled?
; NO, try again
;
Yes, continue
;
with program
;
flow
DS30390E-page 141
PIC16C7X
FIGURE 14-16: INTERRUPT LOGIC
PSPIF
PSPIE
ADIF
ADIE
T0IF
T0IE
RCIF
RCIE
INTF
INTE
TXIF
TXIE
SSPIF
SSPIE
Interrupt to CPU
RBIF
RBIE
PEIE
CCP1IF
CCP1IE
GIE
TMR2IF
TMR2IE
TMR1IF
TMR1IE
CCP2IF
CCP2IE
T0IF
INTF
RBIF
PSPIF
ADIF
PIC16C72
Yes
Yes
Yes
Yes
PIC16C73
Yes
Yes
Yes
Yes
PIC16C73A
Yes
Yes
Yes
Yes
PIC16C74
Yes
Yes
Yes
Yes
Yes
PIC16C74A
Yes
Yes
Yes
Yes
PIC16C76
Yes
Yes
Yes
PIC16C77
Yes
Yes
Yes
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF
CCP2IF
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT 3
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency 2
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
PC
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
PC+1
Inst (PC+1)
Inst (PC)
0004h
PC+1
Dummy Cycle
0005h
Inst (0004h)
Inst (0005h)
Dummy Cycle
Inst (0004h)
DS30390E-page 142
PIC16C7X
14.5.1
14.6
INT INTERRUPT
14.5.2
TMR0 INTERRUPT
a)
b)
c)
d)
e)
W_TEMP
STATUS,W
STATUS
STATUS_TEMP
PCLATH, W
PCLATH_TEMP
PCLATH
STATUS, IRP
FSR, W
FSR_TEMP
PCLATH_TEMP, W
PCLATH
STATUS_TEMP,W
MOVWF
SWAPF
SWAPF
STATUS
W_TEMP,F
W_TEMP,W
;Restore PCLATH
;Move W into PCLATH
;Swap STATUS_TEMP register into W
;(sets bank to original state)
;Move W into STATUS register
;Swap W_TEMP
;Swap W_TEMP into W
DS30390E-page 143
PIC16C7X
14.7
Applicable Devices
72 73 73A 74 74A 76 77
The Watchdog Timer is as a free running on-chip RC
oscillator which does not require any external components. This RC oscillator is separate from the RC oscillator of the OSC1/CLKIN pin. That means that the WDT
will run, even if the clock on the OSC1/CLKIN and
OSC2/CLKOUT pins of the device has been stopped,
for example, by execution of a SLEEP instruction. During normal operation, a WDT time-out generates a
device RESET (Watchdog Timer Reset). If the device is
in SLEEP mode, a WDT time-out causes the device to
wake-up and continue with normal operation (Watchdog Timer Wake-up). The WDT can be permanently
disabled by clearing configuration bit WDTE
(Section 14.1).
14.7.1
WDT PERIOD
Postscaler
M
U
X
8
8 - to - 1 MUX
PS2:PS0
PSA
WDT
Enable Bit
1
MUX
PSA
WDT
Time-out
Name
2007h
Config. bits
81h,181h
OPTION
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(1)
BODEN(1)
CP1
CP0
PWRTE(1)
WDTE
FOSC1
FOSC0
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
DS30390E-page 144
PIC16C7X
14.8
Other peripherals cannot generate interrupts since during SLEEP, no on-chip Q clocks are present.
When the SLEEP instruction is being executed, the next
instruction (PC + 1) is pre-fetched. For the device to
wake-up through an interrupt event, the corresponding
interrupt enable bit must be set (enabled). Wake-up is
regardless of the state of the GIE bit. If the GIE bit is
clear (disabled), the device continues execution at the
instruction after the SLEEP instruction. If the GIE bit is
set (enabled), the device executes the instruction after
the SLEEP instruction and then branches to the interrupt address (0004h). In cases where the execution of
the instruction following SLEEP is not desirable, the
user should have a NOP after the SLEEP instruction.
14.8.2
DS30390E-page 145
PIC16C7X
FIGURE 14-20: WAKE-UP FROM SLEEP THROUGH INTERRUPT
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3
Q4
OSC1
TOST(2)
CLKOUT(4)
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency
(Note 2)
GIE bit
(INTCON<7>)
Processor in
SLEEP
INSTRUCTION FLOW
PC
PC
Instruction
fetched
Inst(PC) = SLEEP
Instruction
executed
Inst(PC - 1)
Note 1:
2:
3:
4:
14.9
PC+1
PC+2
Inst(PC + 2)
SLEEP
Inst(PC + 1)
If the code protection bit(s) have not been programmed, the on-chip program memory can be read
out for verification purposes.
14.10
ID Locations
Applicable Devices
72 73 73A 74 74A 76 77
14.11
PC + 2
Dummy cycle
0004h
0005h
Inst(0004h)
Inst(0005h)
Dummy cycle
Inst(0004h)
Applicable Devices
72 73 73A 74 74A 76 77
Note:
PC+2
Inst(PC + 1)
PIC16CXX microcontrollers can be serially programmed while in the end application circuit. This is
simply done with two lines for clock and data, and three
other lines for power, ground, and the programming
voltage. This allows customers to manufacture boards
with unprogrammed devices, and then program the
microcontroller just before shipping the product. This
also allows the most recent firmware or a custom firmware to be programmed.
DS30390E-page 146
External
Connector
Signals
To Normal
Connections
PIC16CXX
+5V
VDD
0V
VSS
VPP
MCLR/VPP
CLK
RB6
Data I/O
RB7
VDD
To Normal
Connections
PIC16C7X
15.0
TABLE 15-1:
OPCODE FIELD
DESCRIPTIONS
Field
Description
[ ]
( )
<>
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
Bit-oriented file register operations
13
10 9
7 6
OPCODE
b (BIT #)
f (FILE #)
GIE
WDT
TO
PD
dest
OPCODE
0
k (literal)
Assigned to
Register bit field
In the set of
11
OPCODE
10
0
k (literal)
DS30390E-page 147
PIC16C7X
TABLE 15-2:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
Add W and f
AND W with f
Clear f
Clear W
Complement f
Decrement f
Decrement f, Skip if 0
Increment f
Increment f, Skip if 0
Inclusive OR W with f
Move f
Move W to f
No Operation
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1(2)
1
1(2)
1
1
1
1
1
1
1
1
1
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
0111
0101
0001
0001
1001
0011
1011
1010
1111
0100
1000
0000
0000
1101
1100
0010
1110
0110
dfff
dfff
lfff
0xxx
dfff
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0xx0
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
xxxx
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
0000
ffff
ffff
ffff
ffff
ffff
1
1
1 (2)
1 (2)
01
01
01
01
00bb
01bb
10bb
11bb
bfff
bfff
bfff
bfff
ffff
ffff
ffff
ffff
1
1
2
1
2
1
1
2
2
2
1
1
1
11
11
10
00
10
11
11
00
11
00
00
11
11
111x
1001
0kkk
0000
1kkk
1000
00xx
0000
01xx
0000
0000
110x
1010
kkkk
kkkk
kkkk
0110
kkkk
kkkk
kkkk
0000
kkkk
0000
0110
kkkk
kkkk
kkkk
kkkk
kkkk
0100
kkkk
kkkk
kkkk
1001
kkkk
1000
0011
kkkk
kkkk
C,DC,Z
Z
Z
Z
Z
Z
Z
Z
Z
C
C
C,DC,Z
Z
1,2
1,2
2
1,2
1,2
1,2,3
1,2
1,2,3
1,2
1,2
1,2
1,2
1,2
1,2
1,2
f, b
f, b
f, b
f, b
Bit Clear f
Bit Set f
Bit Test f, Skip if Clear
Bit Test f, Skip if Set
1,2
1,2
3
3
k
k
k
k
k
k
k
k
k
C,DC,Z
Z
TO,PD
Z
TO,PD
C,DC,Z
Z
Note 1: When an I/O register is modified as a function of itself ( e.g., MOVF PORTB, 1), the value used will be that value present
on the pins themselves. For example, if the data latch is '1' for a pin configured as input and is driven low by an external
device, the data will be written back with a '0'.
2: If this instruction is executed on the TMR0 register (and, where applicable, d = 1), the prescaler will be cleared if assigned
to the Timer0 Module.
3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second cycle is
executed as a NOP.
DS30390E-page 148
PIC16C7X
15.1
Instruction Descriptions
ADDLW
ANDLW
Syntax:
[label] ADDLW
Syntax:
[label] ANDLW
Operands:
0 k 255
Operands:
0 k 255
Operation:
(W) + k (W)
Operation:
C, DC, Z
Status Affected:
Status Affected:
Encoding:
11
111x
kkkk
kkkk
Encoding:
11
1001
kkkk
kkkk
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Q Cycle Activity:
Example:
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to
W
ADDLW
0x15
Q Cycle Activity:
Example
=
=
ADDWF
Add W and f
Syntax:
[label] ADDWF
Operands:
Q3
Q4
Decode
Read
literal "k"
Process
data
Write to
W
ANDLW
0x5F
W
0x10
0xA3
After Instruction
After Instruction
W
Q2
Before Instruction
Before Instruction
W
Q1
0x25
0x03
ANDWF
AND W with f
Syntax:
[label] ANDWF
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
C, DC, Z
Status Affected:
Encoding:
00
f,d
0111
dfff
ffff
Encoding:
00
f,d
0101
dfff
ffff
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
ADDWF
FSR, 0
Before Instruction
W =
FSR =
Example
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
ANDWF
FSR, 1
Before Instruction
0x17
0xC2
After Instruction
W =
FSR =
Q Cycle Activity:
W =
FSR =
0x17
0xC2
After Instruction
0xD9
0xC2
W =
FSR =
0x17
0x02
DS30390E-page 149
PIC16C7X
BCF
Bit Clear f
BTFSC
Syntax:
[label] BCF
Syntax:
Operands:
0 f 127
0b7
Operands:
0 f 127
0b7
Operation:
0 (f<b>)
Operation:
skip if (f<b>) = 0
Status Affected:
None
Status Affected:
None
Encoding:
01
f,b
00bb
bfff
ffff
Description:
Words:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write
register 'f'
BCF
Encoding:
10bb
bfff
ffff
Description:
Words:
Cycles:
1(2)
Q Cycle Activity:
FLAG_REG, 7
01
Before Instruction
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
NoOperation
Q3
Q4
FLAG_REG = 0xC7
If Skip:
After Instruction
FLAG_REG = 0x47
Example
(2nd Cycle)
Q1
Q2
NoOperation
NoOperation
HERE
FALSE
TRUE
BTFSC
GOTO
NoNoOperation Operation
FLAG,1
PROCESS_CODE
Before Instruction
PC =
address HERE
After Instruction
BSF
Bit Set f
Syntax:
[label] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
None
Encoding:
01
if FLAG<1> = 0,
PC =
address TRUE
if FLAG<1>=1,
PC =
address FALSE
f,b
01bb
bfff
Description:
Words:
Cycles:
Q Cycle Activity:
Example
ffff
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write
register 'f'
BSF
FLAG_REG,
Before Instruction
FLAG_REG = 0x0A
After Instruction
FLAG_REG = 0x8A
DS30390E-page 150
PIC16C7X
BTFSS
CALL
Call Subroutine
Syntax:
Syntax:
[ label ] CALL k
Operands:
0 f 127
0b<7
Operands:
0 k 2047
Operation:
Operation:
skip if (f<b>) = 1
Status Affected:
None
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
Status Affected:
None
Encoding:
Description:
01
Cycles:
1(2)
If Skip:
Example
bfff
ffff
Words:
Q Cycle Activity:
11bb
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
NoOperation
(2nd Cycle)
Q1
Q2
NoOperation
NoOperation
HERE
FALSE
TRUE
BTFSC
GOTO
Q3
10
FLAG,1
PROCESS_CODE
kkkk
kkkk
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal 'k',
Push PC
to Stack
Process
data
Write to
PC
Q4
NoNoOperation Operation
0kkk
Description:
1st Cycle
2nd Cycle
Example
HERE
CALL
THERE
Before Instruction
PC = Address HERE
After Instruction
Before Instruction
PC =
Encoding:
address HERE
PC = Address THERE
TOS = Address HERE+1
After Instruction
if FLAG<1> = 0,
PC =
address FALSE
if FLAG<1> = 1,
PC =
address TRUE
DS30390E-page 151
PIC16C7X
CLRF
Clear f
Syntax:
[label] CLRF
Operands:
0 f 127
Operation:
00h (f)
1Z
Status Affected:
Encoding:
00
0001
1fff
ffff
CLRW
Clear W
Syntax:
[ label ] CLRW
Operands:
None
Operation:
00h (W)
1Z
Status Affected:
Encoding:
00
0001
0xxx
xxxx
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write
register 'f'
CLRF
Q Cycle Activity:
Example
FLAG_REG
=
0x5A
Q3
Q4
NoOperation
Process
data
Write to
W
CLRW
=
=
0x00
1
0x5A
After Instruction
After Instruction
FLAG_REG
Z
Q2
Before Instruction
Before Instruction
FLAG_REG
Q1
Decode
W
Z
=
=
0x00
1
CLRWDT
Syntax:
[ label ] CLRWDT
Operands:
None
Operation:
00h WDT
0 WDT prescaler,
1 TO
1 PD
Status Affected:
TO, PD
Encoding:
00
0000
0110
0100
Description:
CLRWDT instruction resets the Watchdog Timer. It also resets the prescaler
of the WDT. Status bits TO and PD are
set.
Words:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
NoOperation
Process
data
Clear
WDT
Counter
CLRWDT
Before Instruction
WDT counter =
After Instruction
WDT counter =
WDT prescaler=
TO
=
PD
=
DS30390E-page 152
0x00
0
1
1
PIC16C7X
COMF
Complement f
DECFSZ
Decrement f, Skip if 0
Syntax:
[ label ] COMF
Syntax:
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) (destination)
Operation:
Status Affected:
(f) - 1 (destination);
skip if result = 0
Status Affected:
None
Encoding:
Description:
00
f,d
1001
dfff
ffff
The contents of register 'f' are complemented. If 'd' is 0 the result is stored in
W. If 'd' is 1 the result is stored back in
register 'f'.
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
Encoding:
COMF
0x13
Cycles:
1(2)
=
=
0x13
0xEC
If Skip:
After Instruction
REG1
W
DECF
Decrement f
Syntax:
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination)
Status Affected:
Encoding:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
Write to
destination
Q3
Q4
Example
0011
dfff
ffff
Words:
Cycles:
Example
HERE
DECFSZ
GOTO
CONTINUE
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
DECF
NoOperation
CNT, 1
LOOP
Before Instruction
Description:
Q Cycle Activity:
(2nd Cycle)
Q1
Q2
PC
00
ffff
Words:
Before Instruction
=
dfff
The contents of register 'f' are decremented. If 'd' is 0 the result is placed in the
W register. If 'd' is 1 the result is placed
back in register 'f'.
If the result is 1, the next instruction, is
executed. If the result is 0, then a NOP is
executed instead making it a 2TCY instruction.
REG1,0
REG1
1011
Description:
Q Cycle Activity:
Example
00
address HERE
After Instruction
CNT
if CNT
PC
if CNT
PC
=
=
=
CNT - 1
0,
address CONTINUE
0,
address HERE+1
CNT, 1
Before Instruction
CNT
Z
=
=
0x01
0
=
=
0x00
1
After Instruction
CNT
Z
DS30390E-page 153
PIC16C7X
GOTO
Unconditional Branch
INCF
Increment f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 2047
Operands:
Operation:
k PC<10:0>
PCLATH<4:3> PC<12:11>
0 f 127
d [0,1]
Operation:
(f) + 1 (destination)
None
Status Affected:
Status Affected:
Encoding:
10
GOTO k
1kkk
kkkk
kkkk
Encoding:
00
INCF f,d
1010
dfff
ffff
Description:
Description:
The contents of register 'f' are incremented. If 'd' is 0 the result is placed in
the W register. If 'd' is 1 the result is
placed back in register 'f'.
Words:
Words:
Cycles:
Cycles:
Q Cycle Activity:
1st Cycle
2nd Cycle
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to
PC
Q Cycle Activity:
Q2
Q3
Q4
Read
register
'f'
Process
data
Write to
destination
INCF
CNT, 1
Example
Example
Q1
Decode
Before Instruction
GOTO THERE
After Instruction
PC =
Address THERE
CNT
Z
0xFF
0
=
=
0x00
1
After Instruction
CNT
Z
DS30390E-page 154
=
=
PIC16C7X
INCFSZ
Increment f, Skip if 0
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (destination),
skip if result = 0
Status Affected:
None
Encoding:
Description:
00
Cycles:
1(2)
If Skip:
1111
dfff
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
Write to
destination
Q3
Q4
Example
ffff
Q1
(2nd Cycle)
Q1
Q2
HERE
INCFSZ
GOTO
CONTINUE
Syntax:
[ label ]
Operands:
0 k 255
Operation:
Status Affected:
Encoding:
The contents of register 'f' are incremented. If 'd' is 0 the result is placed in
the W register. If 'd' is 1 the result is
placed back in register 'f'.
If the result is 1, the next instruction is
executed. If the result is 0, a NOP is
executed instead making it a 2TCY
instruction.
Words:
Q Cycle Activity:
INCFSZ f,d
IORLW
11
IORLW k
1000
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to
W
IORLW
0x35
Before Instruction
W
0x9A
After Instruction
W
Z
=
=
0xBF
1
NoOperation
CNT, 1
LOOP
Before Instruction
PC
address HERE
After Instruction
CNT =
if CNT=
PC
=
if CNT
PC
=
CNT + 1
0,
address CONTINUE
0,
address HERE +1
DS30390E-page 155
PIC16C7X
IORWF
Inclusive OR W with f
MOVLW
Move Literal to W
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
Operation:
Operation:
k (W)
Status Affected:
Status Affected:
None
Encoding:
IORWF
00
f,d
0100
dfff
ffff
Description:
Inclusive OR the W register with register 'f'. If 'd' is 0 the result is placed in the
W register. If 'd' is 1 the result is placed
back in register 'f'.
Words:
Cycles:
Q Cycle Activity:
Example
Encoding:
11
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
IORWF
00xx
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
MOVLW k
Example
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to
W
MOVLW
0x5A
After Instruction
RESULT, 0
0x5A
Before Instruction
RESULT =
W
=
0x13
0x91
After Instruction
RESULT =
W
=
Z
=
0x13
0x93
1
MOVF
Move f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
(f) (destination)
Status Affected:
Encoding:
Encoding:
Description:
00
Cycles:
Example
1000
dfff
ffff
Words:
Q Cycle Activity:
MOVF f,d
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
MOVF
FSR, 0
After Instruction
MOVWF
Move W to f
Syntax:
[ label ]
Operands:
0 f 127
Operation:
(W) (f)
Status Affected:
None
00
MOVWF
0000
1fff
ffff
Description:
Words:
Cycles:
Q Cycle Activity:
Example
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write
register 'f'
MOVWF
OPTION_REG
Before Instruction
OPTION =
W
=
0xFF
0x4F
After Instruction
OPTION =
W
=
0x4F
0x4F
DS30390E-page 156
PIC16C7X
NOP
No Operation
RETFIE
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
None
Operation:
No operation
Operation:
Status Affected:
None
TOS PC,
1 GIE
Status Affected:
None
Encoding:
00
NOP
0000
0xx0
0000
RETFIE
Description:
No operation.
Encoding:
Words:
Description:
Cycles:
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Example
Q2
Q3
Q4
NOP
Q Cycle Activity:
1st Cycle
2nd Cycle
Example
00
0000
0000
1001
Q1
Q2
Q3
Q4
Decode
NoOperation
Set the
GIE bit
Pop from
the Stack
RETFIE
After Interrupt
PC =
GIE =
OPTION
Syntax:
[ label ]
Operands:
None
Operation:
(W) OPTION
TOS
1
OPTION
00
0000
0110
0010
Description:
Words:
Cycles:
Example
To maintain upward compatibility
with future PIC16CXX products, do
not use this instruction.
DS30390E-page 157
PIC16C7X
RETLW
RETURN
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 255
Operands:
None
Operation:
k (W);
TOS PC
Operation:
TOS PC
Status Affected:
None
Status Affected:
None
Encoding:
RETLW k
Encoding:
11
Description:
01xx
kkkk
kkkk
Words:
Cycles:
Q Cycle Activity:
1st Cycle
2nd Cycle
Q2
Decode
Read
literal 'k'
Q3
Q4
NoWrite to W,
Operation Pop from
the Stack
0000
0000
1000
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
00
RETURN
1st Cycle
2nd Cycle
Example
Q1
Decode
Q2
Q3
Q4
NoNoPop from
Operation Operation the Stack
RETURN
After Interrupt
Example
CALL TABLE
;W contains table
;offset value
;W now has table value
TABLE ADDWF PC
RETLW k1
RETLW k2
PC =
TOS
;W = offset
;Begin table
;
RETLW kn
; End of table
Before Instruction
W
0x07
After Instruction
W
DS30390E-page 158
value of k8
PIC16C7X
RLF
RRF
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
Status Affected:
Encoding:
Description:
RLF
00
f,d
1101
dfff
ffff
Encoding:
Description:
00
Register f
Words:
Cycles:
Cycles:
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
RLF
REG1,0
ffff
Register f
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
RRF
REG1,0
Before Instruction
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
After Instruction
REG1
W
C
Q Cycle Activity:
Example
Before Instruction
REG1
C
dfff
Example
1100
Words:
Q Cycle Activity:
RRF f,d
REG1
C
=
=
1110 0110
0
=
=
=
1110 0110
0111 0011
0
After Instruction
REG1
W
C
DS30390E-page 159
PIC16C7X
SLEEP
SUBLW
Syntax:
[ label ]
SUBLW k
Syntax:
[ label ]
Operands:
None
Operands:
0 k 255
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Operation:
k - (W) (W)
Status Affected:
C, DC, Z
SLEEP
Encoding:
11
110x
kkkk
kkkk
Description:
The W register is subtracted (2s complement method) from the eight bit literal 'k'.
The result is placed in the W register.
Words:
Cycles:
Words:
Example 1:
Cycles:
Status Affected:
TO, PD
Encoding:
Description:
Q Cycle Activity:
00
0000
0110
0011
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to W
SUBLW
0x02
Before Instruction
Q1
Decode
Q2
Q3
NoNoOperation Operation
Q4
W
C
Z
Go to
Sleep
=
=
=
1
?
?
After Instruction
Example:
SLEEP
W
C
Z
Example 2:
=
=
=
1
1; result is positive
0
Before Instruction
W
C
Z
=
=
=
2
?
?
After Instruction
W
C
Z
Example 3:
=
=
=
0
1; result is zero
1
Before Instruction
W
C
Z
=
=
=
3
?
?
After Instruction
W
C
Z
DS30390E-page 160
=
=
=
0xFF
0; result is negative
0
PIC16C7X
SUBWF
Subtract W from f
SWAPF
Swap Nibbles in f
Syntax:
[ label ]
Syntax:
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
C, DC, Z
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Status Affected:
None
Encoding:
Description:
00
Cycles:
Example 1:
0010
dfff
ffff
Subtract (2s complement method) W register from register 'f'. If 'd' is 0 the result is
stored in the W register. If 'd' is 1 the
result is stored back in register 'f'.
Words:
Q Cycle Activity:
SUBWF f,d
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
Write to
destination
SUBWF
Encoding:
00
REG1
W
C
Z
ffff
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
data
Write to
destination
Example
=
=
=
=
SWAPF REG,
REG1
W
C
Z
=
=
=
=
REG1
=
=
=
=
=
=
=
=
2
2
?
?
=
=
=
=
=
=
=
=
0xA5
0x5A
Syntax:
[label]
Operands:
5f7
Operation:
TRIS
1
2
?
?
After Instruction
REG1
W
C
Z
=
=
TRIS
Encoding:
0xFF
2
0; result is negative
0
00
0000
0110
0fff
Description:
Words:
Cycles:
Before Instruction
REG1
W
C
Z
0xA5
1
2
1; result is positive
0
After Instruction
REG1
W
C
Z
After Instruction
REG1
W
Before Instruction
REG1
W
C
Z
Before Instruction
3
2
?
?
After Instruction
Example 3:
dfff
REG1,1
Before Instruction
Example 2:
1110
Description:
Example
To maintain upward compatibility
with future PIC16CXX products, do
not use this instruction.
DS30390E-page 161
PIC16C7X
XORLW
XORWF
Exclusive OR W with f
Syntax:
[label]
Syntax:
[label]
Operands:
0 k 255
Operands:
Operation:
0 f 127
d [0,1]
Status Affected:
Operation:
Status Affected:
Encoding:
11
XORLW k
1010
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Example:
Q1
Q2
Q3
Q4
Decode
Read
literal 'k'
Process
data
Write to
W
XORLW
Encoding:
00
XORWF
0110
f,d
dfff
ffff
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register
'f'
Process
data
Write to
destination
0xAF
Before Instruction
W
Example
0xB5
After Instruction
W
0x1A
XORWF
REG
Before Instruction
REG
W
=
=
0xAF
0xB5
=
=
0x1A
0xB5
After Instruction
REG
W
DS30390E-page 162
PIC16C7X
16.0
DEVELOPMENT SUPPORT
16.1
Development Tools
16.2
16.3
16.4
The PRO MATE II Universal Programmer is a full-featured programmer capable of operating in stand-alone
mode as well as PC-hosted mode.
The PRO MATE II has programmable VDD and VPP
supplies which allows it to verify programmed memory
at VDD min and VDD max for maximum reliability. It has
an LCD display for displaying error messages, keys to
enter commands and a modular detachable socket
assembly to support various package types. In standalone mode the PRO MATE II can read, verify or program PIC16C5X, PIC16CXXX, PIC17CXX and
PIC14000 devices. It can also set configuration and
code-protect bits in this mode.
16.5
The PICSTART programmer is an easy-to-use, lowcost prototype programmer. It connects to the PC via
one of the COM (RS-232) ports. MPLAB Integrated
Development Environment software makes using the
programmer simple and efficient. PICSTART Plus is
not recommended for production programming.
DS30390E-page 163
PIC16C7X
16.6
16.7
16.8
DS30390E-page 164
an RS-232 interface, push-button switches, a potentiometer for simulated analog input, a thermistor and
separate headers for connection to an external LCD
module and a keypad. Also provided on the PICDEM-3
board is an LCD panel, with 4 commons and 12 segments, that is capable of displaying time, temperature
and day of the week. The PICDEM-3 provides an additional RS-232 interface and Windows 3.1 software for
showing the demultiplexed LCD signals on a PC. A simple serial interface allows the user to construct a hardware demultiplexer for the LCD signals.
16.9
16.10
Assembler (MPASM)
The MPASM Universal Macro Assembler is a PChosted symbolic assembler. It supports all microcontroller series including the PIC12C5XX, PIC14000,
PIC16C5X, PIC16CXXX, and PIC17CXX families.
MPASM offers full featured Macro capabilities, conditional assembly, and several source and listing formats.
It generates various object code formats to support
Microchip's development tools as well as third party
programmers.
MPASM allows full symbolic debugging from
PICMASTER, Microchips Universal Emulator
System.
PIC16C7X
MPASM has the following features to assist in developing software for specific use applications.
Provides translation of Assembler source code to
object code for all Microchip microcontrollers.
Macro assembly capability.
Produces all the files (Object, Listing, Symbol,
and special) required for symbolic debug with
Microchips emulator systems.
Supports Hex (default), Decimal and Octal source
and listing formats.
MPASM provides a rich directive language to support
programming of the PIC16/17. Directives are helpful in
making the development of your assemble source code
shorter and more maintainable.
16.11
16.12
C Compiler (MPLAB-C)
16.13
16.14
MP-DriveWay is an easy-to-use Windows-based Application Code Generator. With MP-DriveWay you can
visually configure all the peripherals in a PIC16/17
device and, with a click of the mouse, generate all the
initialization and many functional code modules in C
language. The output is fully compatible with Microchips MPLAB-C C compiler. The code produced is
highly modular and allows easy integration of your own
code. MP-DriveWay is intelligent enough to maintain
your code through subsequent code generation.
16.15
16.16
16.17
fuzzyTECH-MP fuzzy logic development tool is available in two versions - a low cost introductory version,
MP Explorer, for designers to gain a comprehensive
working knowledge of fuzzy logic system design; and a
full-featured version, fuzzyTECH-MP, edition for implementing more complex systems.
Both versions include Microchips fuzzyLAB demonstration board for hands-on experience with fuzzy logic
systems implementation.
DS30390E-page 165
Emulator Products
Software Tools
DS30390E-page 166
Programmers
KEELOQ
Evaluation Kit
PICDEM-3
PICDEM-2
PICDEM-1
SEEVAL
Designers Kit
KEELOQ
Programmer
PRO MATE II
Universal
Programmer
PICSTART
Plus Low-Cost
Universal Dev. Kit
PICSTART
Lite Ultra Low-Cost
Dev. Kit
Total Endurance
Software Model
fuzzyTECH-MP
Explorer/Edition
Fuzzy Logic
Dev. Tool
MP-DriveWay
Applications
Code Generator
MPLAB C
Compiler
MPLAB
Integrated
Development
Environment
ICEPIC Low-Cost
In-Circuit Emulator
PICMASTER/
PICMASTER-CE
In-Circuit Emulator
PIC14000
PIC16C5X
PIC16CXXX
Available
3Q97
PIC17C75X
24CXX
25CXX
93CXX
HCS200
HCS300
HCS301
TABLE 16-1:
Demo Boards
PIC12C5XX
PIC16C7X
DEVELOPMENT TOOLS FROM MICROCHIP
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.0
TABLE 17-1:
OSC
PIC16C72-04
PIC16C72-10
PIC16C72-20
PIC16LC72-04
JW Devices
RC
XT
HS
LP
The shaded sections indicate oscillator selections which are tested for functionality, but not for MIN/MAX specifications.
It is recommended that the user select the device type that ensures the specifications required.
DS30390E-page 167
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.1
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
D001
D001A
Supply Voltage
VDD
4.0
4.5
6.0
5.5
V
V
D002*
VDR
1.5
D003
VPOR
VSS
D004*
SVDD
0.05
D005
3.7
4.0
4.3
3.7
4.0
4.4
Extended Only
2.7
5.0
mA
10
20
mA
HS osc configuration
FOSC = 20 MHz, VDD = 5.5V
D010
Supply Current
(Note 2,5)
IDD
D013
D015
350
425
D020
D021
D021A
D021B
Power-down Current
(Note 3,5)
10.5
1.5
1.5
2.5
42
16
19
19
A
A
A
A
D023
350
425
Note 1:
2:
3:
4:
5:
6:
IPD
DS30390E-page 168
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.2
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
2.5
6.0
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
SVDD
0.05
3.7
4.0
4.3
2.0
3.8
mA
22.5
48
LP osc configuration
FOSC = 32 kHz, VDD = 3.0V, WDT disabled
350
425
7.5
0.9
0.9
30
5
5
A
A
A
350
425
D001
Supply Voltage
D002*
VDD
D005
BVDD
D010
Supply Current
(Note 2,5)
IDD
D010A
D015*
D020
Power-down Current
D021
(Note 3,5)
D021A
D023*
*
Note 1:
2:
3:
4:
5:
6:
IPD
DS30390E-page 169
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.3
DC Characteristics:
DC CHARACTERISTICS
Param
No.
D030
D030A
D031
D032
D033
D040
D040A
D041
D042
D042A
D043
D070
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
with Schmitt Trigger buffer
MCLR, OSC1 (in RC mode)
OSC1 (in XT, HS and LP)
Input High Voltage
I/O ports
with TTL buffer
VIL
VSS
VSS
VSS
VSS
VSS
VIH
2.0
0.25VDD
+ 0.8V
D060
D061
D063
MCLR, RA4/T0CKI
OSC1
D080
D080A
D083
D083A
VOL
- 0.15VDD
0.8V
- 0.2VDD
- 0.2VDD
- 0.3VDD
V
V
V
V
V
VDD
VDD
V
V
VDD
VDD
VDD
VDD
400
5
5
0.6
0.6
0.6
0.6
Note1
DS30390E-page 170
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
DC CHARACTERISTICS
Param
No.
D090
Characteristic
Output High Voltage
I/O ports (Note 3)
VDD - 0.7 -
VDD - 0.7 -
VDD - 0.7 -
D090A
D092
D092A
D150*
D100
14
15
pF
D101
D102
DS30390E-page 171
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.4
The timing parameter symbols have been created following one of the following formats:
1. TppS2ppS
3. TCC:ST
2. TppS
4. Ts
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDI
do
SDO
dt
Data in
io
I/O port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (Hi-impedance)
L
Low
I2C only
AA
BUF
output access
Bus free
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
Hi-impedance
High
Low
High
Low
SU
Setup
STO
STOP condition
Load condition 1
VDD/2
RL
CL
Pin
VSS
CL
Pin
VSS
RL = 464
CL = 50 pF
15 pF
DS30390E-page 172
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
17.5
Q1
Q2
Q3
Q4
Q1
OSC1
1
CLKOUT
TABLE 17-2:
Parameter
No.
Characteristic
Fosc
Min
Typ
Max
Units Conditions
DC
4
MHz XT and RC osc mode
DC
4
MHz HS osc mode (-04)
DC
10
MHz HS osc mode (-10)
DC
20
MHz HS osc mode (-20)
DC
200
kHz LP osc mode
Oscillator Frequency
DC
4
MHz RC osc mode
(Note 1)
0.1
4
MHz XT osc mode
4
20
MHz HS osc mode
5
200
kHz LP osc mode
1
Tosc External CLKIN Period
250
ns
XT and RC osc mode
(Note 1)
250
ns
HS osc mode (-04)
100
ns
HS osc mode (-10)
50
ns
HS osc mode (-20)
5
s
LP osc mode
Oscillator Period
250
ns
RC osc mode
(Note 1)
250
10,000
ns
XT osc mode
250
250
ns
HS osc mode (-04)
100
250
ns
HS osc mode (-10)
50
250
ns
HS osc mode (-20)
5
s
LP osc mode
200
DC
ns
TCY = 4/FOSC
2
TCY Instruction Cycle Time (Note 1)
3
TosL, External Clock in (OSC1) High or
100
ns
XT oscillator
TosH Low Time
2.5
s
LP oscillator
15
ns
HS oscillator
4
TosR, External Clock in (OSC1) Rise or
25
ns
XT oscillator
TosF Fall Time
50
ns
LP oscillator
15
ns
HS oscillator
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time-base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing code.
Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested to operate at "min." values with an external clock applied to the OSC1/CLKIN pin.
When an external clock input is used, the "Max." cycle time limit is "DC" (no clock) for all devices.
DS30390E-page 173
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-3: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
CLKOUT
13
19
14
12
18
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
Note: Refer to Figure 17-1 for load conditions.
TABLE 17-3:
Parameter Sym
No.
Characteristic
Min
Typ
Max
Units Conditions
10*
TosH2ckL
OSC1 to CLKOUT
75
200
ns
Note 1
11*
TosH2ckH
OSC1 to CLKOUT
75
200
ns
Note 1
12*
TckR
35
100
ns
Note 1
13*
TckF
35
100
ns
Note 1
14*
TckL2ioV
0.5TCY + 20
ns
Note 1
15*
TioV2ckH
TOSC + 200
ns
Note 1
16*
TckH2ioI
ns
Note 1
17*
TosH2ioV
50
150
ns
18*
TosH2ioI
PIC16C72
100
ns
PIC16LC72
200
ns
19*
TioV2osH
ns
20*
TioR
PIC16C72
10
40
ns
PIC16LC72
80
ns
PIC16C72
10
40
ns
PIC16LC72
80
ns
21*
TioF
22*
Tinp
TCY
ns
23*
Trbp
TCY
ns
DS30390E-page 174
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Time-out
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
BVDD
VDD
35
TABLE 17-4:
Parameter
No.
Sym
Characteristic
30
TmcL
31*
Twdt
18
33
ms
32
Tost
33*
Tpwrt
34
35
Min
Typ
Max
Units
Conditions
1024TOSC
28
72
132
ms
TIOZ
2.1
TBOR
100
DS30390E-page 175
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-6: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
RA4/T0CKI
41
40
42
RC0/T1OSO/T1CKI
46
45
47
48
TMR0 or
TMR1
Note: Refer to Figure 17-1 for load conditions.
TABLE 17-5:
Param
No.
Sym
Characteristic
40*
Tt0H
No Prescaler
With Prescaler
No Prescaler
With Prescaler
41*
42*
45*
46*
47*
48
Tt0L
Min
Typ
Max
0.5TCY + 20
ns
10
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
0.5TCY + 20
10
Tt0P
T0CKI Period
TCY + 40
No Prescaler
With Prescaler Greater of:
20 or TCY + 40
N
Tt1H
T1CKI High Time Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1L
T1CKI Low Time
Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1P
T1CKI input period Synchronous PIC16C7X
Greater of:
30 OR TCY + 40
N
Greater of:
PIC16LC7X
50 OR TCY + 40
N
Asynchronous PIC16C7X
60
PIC16LC7X
100
Ft1
Timer1 oscillator input frequency range
DC
(oscillator enabled by setting bit T1OSCEN)
TCKEZtmr1 Delay from external clock edge to timer increment
2Tosc
Units Conditions
Must also meet
parameter 42
Must also meet
parameter 42
N = prescale value
(2, 4, ..., 256)
Must also meet
parameter 47
N = prescale value
(1, 2, 4, 8)
N = prescale value
(1, 2, 4, 8)
200
ns
ns
kHz
7Tosc
DS30390E-page 176
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-7: CAPTURE/COMPARE/PWM TIMINGS (CCP1)
RC2/CCP1
(Capture Mode)
50
51
52
RC2/CCP1
(Compare or PWM Mode)
53
54
TABLE 17-6:
Param
No.
50*
Sym Characteristic
TccL CCP1 input low time
Min
No Prescaler
With Prescaler PIC16C72
PIC16LC72
51*
No Prescaler
With Prescaler PIC16C72
PIC16LC72
52*
53*
54*
0.5TCY + 20
ns
10
ns
20
ns
0.5TCY + 20
ns
10
ns
20
ns
3TCY + 40
N
ns
PIC16C72
10
25
ns
PIC16LC72
25
45
ns
PIC16C72
10
25
ns
PIC16LC72
25
45
ns
N = prescale
value (1,4 or 16)
DS30390E-page 177
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-8: SPI MODE TIMING
SS
70
SCK
(CKP = 0)
71
72
78
79
79
78
SCK
(CKP = 1)
80
SDO
77
75, 76
SDI
74
73
Note: Refer to Figure 17-1 for load conditions
TABLE 17-7:
Parameter
No.
Sym
Characteristic
Min
Typ
Max
Units
TCY
ns
70
TssL2scH,
TssL2scL
71
TscH
TCY + 20
ns
72
TscL
TCY + 20
ns
73
TdiV2scH,
TdiV2scL
50
ns
74
TscH2diL,
TscL2diL
50
ns
75
TdoR
10
25
ns
76
TdoF
10
25
ns
77
TssH2doZ
10
50
ns
78
TscR
10
25
ns
79
TscF
10
25
ns
Conditions
80
TscH2doV,
SDO data output valid after SCK
50
ns
TscL2doV
edge
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 178
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-9: I2C BUS START/STOP BITS TIMING
SCL
93
91
90
92
SDA
STOP
Condition
START
Condition
Note: Refer to Figure 17-1 for load conditions
TABLE 17-8:
Parameter
No.
Sym
90
TSU:STA
91
THD:STA
92
TSU:STO
93
THD:STO
Characteristic
START condition
Setup time
START condition
Hold time
STOP condition
Setup time
STOP condition
Hold time
Min
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
4700
600
4000
600
4700
600
4000
600
Typ Max
Units
Conditions
ns
ns
ns
ns
DS30390E-page 179
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-10: I2C BUS DATA TIMING
103
102
100
101
SCL
90
106
107
91
92
SDA
In
110
109
109
SDA
Out
Note: Refer to Figure 17-1 for load conditions
TABLE 17-9:
Parameter
No.
Sym
Characteristic
100
THIGH
101
102
103
TLOW
TR
TF
90
TSU:STA
START condition
setup time
91
THD:STA
106
THD:DAT
107
TSU:DAT
92
TSU:STO
109
TAA
110
TBUF
Cb
Min
Max
Units
Conditions
4.0
0.6
SSP Module
100 kHz mode
1.5TCY
4.7
1.3
SSP Module
100 kHz mode
400 kHz mode
1.5TCY
20 + 0.1Cb
1000
300
ns
ns
20 + 0.1Cb
300
300
ns
ns
4.7
0.6
4.0
0.6
0
0
250
100
4.7
0.6
4.7
1.3
0.9
3500
s
s
s
s
ns
s
ns
ns
s
s
ns
ns
s
s
400
pF
Cb is specified to be from
10 to 400 pF
Cb is specified to be from
10 to 400 pF
Only relevant for repeated
START condition
After this period the first clock
pulse is generated
Note 2
Note 1
Time the bus must be free
before a new transmission can
start
Note 1: As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region (min. 300 ns) of
the falling edge of SCL to avoid unintended generation of START or STOP conditions.
2: A fast-mode (400 kHz) I2C-bus device can be used in a standard-mode (100 kHz)S I2C-bus system, but the requirement
tsu;DAT 250 ns must then be met. This will automatically be the case if the device does not stretch the LOW period of the
SCL signal. If such a device does stretch the LOW period of the SCL signal, it must output the next data bit to the SDA line
TR max.+tsu;DAT = 1000 + 250 = 1250 ns (according to the standard-mode I2C bus specification) before the SCL line is
released.
DS30390E-page 180
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 17-10: A/D CONVERTER CHARACTERISTICS:
PIC16C72-04 (Commercial, Industrial, Extended)
PIC16C72-10 (Commercial, Industrial, Extended)
PIC16C72-20 (Commercial, Industrial, Extended)
PIC16LC72-04 (Commercial, Industrial)
Param Sym Characteristic
No.
A01
NR
A02
Resolution
Typ
Max
Units
Conditions
8-bits
bit
<1
<1
A03
EIL
A04
<1
A05
<1
A06
<1
A10
Min
Monotonicity
guaranteed
A20
3.0V
VDD + 0.3
A25
VSS - 0.3
VREF + 0.3
A30
10.0
A40
IAD
PIC16C72
180
PIC16LC72
90
10
1000
10
A50
DS30390E-page 181
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 17-11: A/D CONVERSION TIMING
BSF ADCON0, GO
134
1 TCY
(TOSC/2) (1)
131
Q4
130
132
A/D CLK
A/D DATA
NEW_DATA
OLD_DATA
ADRES
ADIF
GO
DONE
SAMPLING STOPPED
SAMPLE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
Sym Characteristic
TAD
Units
Conditions
1.6
2.0
PIC16C72
2.0
4.0
6.0
A/D RC Mode
PIC16LC72
3.0
6.0
9.0
A/D RC Mode
9.5
TAD
Note 2
20
5*
TOSC/2
1.5
TAD
132
135
Max
PIC16C72
TGO
Typ
PIC16LC72
131
134
Min
DS30390E-page 182
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.0
TABLE 18-1:
OSC
PIC16C73-04
PIC16C74-04
PIC16C73-10
PIC16C74-10
PIC16C73-20
PIC16C74-20
PIC16LC73-04
PIC16LC74-04
JW Devices
RC
XT
HS
LP
The shaded sections indicate oscillator selections which are tested for functionality, but not for MIN/MAX specifications.
It is recommended that the user select the device type that ensures the specifications required.
DS30390E-page 183
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.1
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
VDD
4.0
4.5
6.0
5.5
V
V
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
0.05
D010
2.7
mA
13.5
30
mA
HS osc configuration
FOSC = 20 MHz, VDD = 5.5V
10.5
1.5
1.5
42
21
24
A
A
A
SVDD
D013
D020 Power-down Current
D021 (Note 3,5)
D021A
*
Note 1:
2:
3:
4:
5:
IPD
DS30390E-page 184
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.2
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
D001
Supply Voltage
VDD
3.0
6.0
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
0.05
D010
2.0
3.8
mA
22.5
48
LP osc configuration
FOSC = 32 kHz, VDD = 3.0V, WDT disabled
7.5
0.9
0.9
30
13.5
18
A
A
A
SVDD
D010A
D020
D021
D021A
*
Note 1:
2:
3:
4:
5:
Power-down Current
(Note 3,5)
IPD
DS30390E-page 185
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.3
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
D030
D030A
D031
with Schmitt Trigger buffer
D032
MCLR, OSC1 (in RC mode)
D033
OSC1 (in XT, HS and LP)
Input High Voltage
I/O ports
D040
with TTL buffer
D040A
D041
D042
D042A
D043
D070
D060
D061
D063
MCLR, RA4/T0CKI
OSC1
D080
D083
D090
D092
D150*
*
VIL
VSS
VSS
VSS
VSS
VSS
VIH
2.0
0.25VDD
+ 0.8V
0.15VDD
0.8V
0.2VDD
0.2VDD
0.3VDD
V
V
V
V
V
VDD
VDD
V
V
VDD
VDD
VDD
VDD
400
5
5
0.6
0.6
VDD - 0.7 -
IIL
VOL
Note1
DS30390E-page 186
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
DC CHARACTERISTICS
Param
No.
D100
Characteristic
Capacitive Loading Specs on
Output Pins
OSC2 pin
COSC2
15
pF
D101
D102
DS30390E-page 187
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.4
The timing parameter symbols have been created following one of the following formats:
1. TppS2ppS
3. TCC:ST
2. TppS
4. Ts
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDI
do
SDO
dt
Data in
io
I/O port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (Hi-impedance)
L
Low
I2C only
AA
BUF
output access
Bus free
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
Hi-impedance
High
Low
High
Low
SU
Setup
STO
STOP condition
Load condition 1
VDD/2
RL
CL
Pin
VSS
CL
Pin
VSS
RL = 464
CL = 50 pF
15 pF
for all pins except OSC2, but including PORTD and PORTE outputs as
ports
for OSC2 output
DS30390E-page 188
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
18.5
Q1
Q2
Q3
Q4
Q1
OSC1
1
CLKOUT
TABLE 18-2:
Parameter
No.
Characteristic
Fosc
Min
Typ
Max
Units Conditions
DC
4
MHz XT and RC osc mode
DC
4
MHz HS osc mode (-04)
DC
10
MHz HS osc mode (-10)
DC
20
MHz HS osc mode (-20)
DC
200
kHz LP osc mode
Oscillator Frequency
DC
4
MHz RC osc mode
(Note 1)
0.1
4
MHz XT osc mode
4
20
MHz HS osc mode
5
200
kHz LP osc mode
1
Tosc External CLKIN Period
250
ns
XT and RC osc mode
(Note 1)
250
ns
HS osc mode (-04)
100
ns
HS osc mode (-10)
50
ns
HS osc mode (-20)
5
s
LP osc mode
Oscillator Period
250
ns
RC osc mode
(Note 1)
250
10,000
ns
XT osc mode
250
250
ns
HS osc mode (-04)
100
250
ns
HS osc mode (-10)
50
250
ns
HS osc mode (-20)
5
s
LP osc mode
200
DC
ns
TCY = 4/FOSC
2
TCY Instruction Cycle Time (Note 1)
3
TosL, External Clock in (OSC1) High or
50
ns
XT oscillator
TosH Low Time
2.5
s
LP oscillator
15
ns
HS oscillator
4
TosR, External Clock in (OSC1) Rise or
25
ns
XT oscillator
TosF Fall Time
50
ns
LP oscillator
15
ns
HS oscillator
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time-base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing code.
Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested to operate at "min." values with an external clock applied to the OSC1/CLKIN pin.
When an external clock input is used, the "Max." cycle time limit is "DC" (no clock) for all devices.
DS30390E-page 189
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-3: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
CLKOUT
13
19
14
12
18
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
Note: Refer to Figure 18-1 for load conditions.
TABLE 18-3:
Parameter Sym
No.
Characteristic
Min
Typ
Max
Units Conditions
10*
TosH2ckL
OSC1 to CLKOUT
75
200
ns
Note 1
11*
TosH2ckH
OSC1 to CLKOUT
75
200
ns
Note 1
12*
TckR
35
100
ns
Note 1
13*
TckF
35
100
ns
Note 1
14*
TckL2ioV
0.5TCY + 20
ns
Note 1
15*
TioV2ckH
0.25TCY + 25
ns
Note 1
16*
TckH2ioI
ns
Note 1
17*
TosH2ioV
50
150
ns
18*
TosH2ioI
PIC16C73/74
100
ns
PIC16LC73/74
200
ns
19*
TioV2osH
ns
20*
TioR
PIC16C73/74
10
25
ns
PIC16LC73/74
60
ns
PIC16C73/74
10
25
ns
PIC16LC73/74
60
ns
21*
TioF
22*
Tinp
TCY
ns
23*
Trbp
TCY
ns
DS30390E-page 190
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Time-out
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
TABLE 18-4:
Parameter
No.
Sym
Characteristic
Min
30
TmcL
100
ns
31*
Twdt
18
33
ms
32
Tost
33*
Tpwrt
34
TIOZ
Typ
Max
Units
Conditions
1024TOSC
28
72
132
ms
100
ns
DS30390E-page 191
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-5: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
RA4/T0CKI
41
40
42
RC0/T1OSO/T1CKI
46
45
47
48
TMR0 or
TMR1
Note: Refer to Figure 18-1 for load conditions.
TABLE 18-5:
Param
No.
Sym
Characteristic
40*
Tt0H
No Prescaler
With Prescaler
No Prescaler
With Prescaler
41*
42*
45*
46*
47*
48
Tt0L
Min
Typ
Max
0.5TCY + 20
ns
10
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
0.5TCY + 20
10
Tt0P
T0CKI Period
TCY + 40
No Prescaler
With Prescaler Greater of:
20 or TCY + 40
N
Tt1H
T1CKI High Time Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1L
T1CKI Low Time
Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1P
T1CKI input period Synchronous PIC16C7X
Greater of:
30 OR TCY + 40
N
Greater of:
PIC16LC7X
50 OR TCY + 40
N
Asynchronous PIC16C7X
60
PIC16LC7X
100
Ft1
Timer1 oscillator input frequency range
DC
(oscillator enabled by setting bit T1OSCEN)
TCKEZtmr1 Delay from external clock edge to timer increment
2Tosc
Units Conditions
Must also meet
parameter 42
Must also meet
parameter 42
N = prescale value
(2, 4, ..., 256)
Must also meet
parameter 47
N = prescale value
(1, 2, 4, 8)
N = prescale value
(1, 2, 4, 8)
200
ns
ns
kHz
7Tosc
DS30390E-page 192
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-6: CAPTURE/COMPARE/PWM TIMINGS (CCP1 AND CCP2)
RC1/T1OSI/CCP2
and RC2/CCP1
(Capture Mode)
50
51
52
RC1/T1OSI/CCP2
and RC2/CCP1
(Compare or PWM Mode)
53
54
TABLE 18-6:
Parameter
No.
50*
51*
Sym Characteristic
TccL CCP1 and CCP2
input low time
Min
No Prescaler
ns
10
ns
20
ns
0.5TCY + 20
ns
PIC16C73/74
10
ns
PIC16LC73/74
20
ns
3TCY + 40
N
ns
No Prescaler
52*
53*
54*
0.5TCY + 20
PIC16C73/74
With Prescaler PIC16LC73/74
With Prescaler
PIC16C73/74
10
25
ns
PIC16LC73/74
25
45
ns
PIC16C73/74
10
25
ns
PIC16LC73/74
25
45
ns
N = prescale value
(1,4 or 16)
DS30390E-page 193
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-7: PARALLEL SLAVE PORT TIMING (PIC16C74)
RE2/CS
RE0/RD
RE1/WR
65
RD7:RD0
62
64
63
Note: Refer to Figure 18-1 for load conditions
TABLE 18-7:
Parameter
No.
Characteristic
62
63*
TwrH2dtI
Conditions
ns
PIC16C74
20
ns
PIC16LC74
35
ns
64
TrdL2dtV
80
ns
65
TrdH2dtI
RD or CS to dataout invalid
10
30
ns
DS30390E-page 194
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-8: SPI MODE TIMING
SS
70
SCK
(CKP = 0)
71
72
78
79
79
78
SCK
(CKP = 1)
80
SDO
77
75, 76
SDI
74
73
Note: Refer to Figure 18-1 for load conditions
TABLE 18-8:
Parameter
No.
Characteristic
Min
Typ
Max
Units
TCY
ns
70
TssL2scH,
TssL2scL
71
TscH
TCY + 20
ns
72
TscL
TCY + 20
ns
73
TdiV2scH,
TdiV2scL
50
ns
74
TscH2diL,
TscL2diL
50
ns
75
TdoR
10
25
ns
76
TdoF
10
25
ns
77
TssH2doZ
10
50
ns
78
TscR
10
25
ns
79
TscF
10
25
ns
Conditions
80
TscH2doV,
SDO data output valid after SCK
50
ns
TscL2doV
edge
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 195
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-9: I2C BUS START/STOP BITS TIMING
SCL
93
91
90
92
SDA
STOP
Condition
START
Condition
Note: Refer to Figure 18-1 for load conditions
TABLE 18-9:
Parameter
No.
Sym
90
TSU:STA
91
THD:STA
92
TSU:STO
93
THD:STO
DS30390E-page 196
Characteristic
START condition
Setup time
START condition
Hold time
STOP condition
Setup time
STOP condition
Hold time
Min
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
4700
600
4000
600
4700
600
4000
600
Typ Max
Units
Conditions
ns
ns
ns
ns
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-10: I2C BUS DATA TIMING
103
102
100
101
SCL
90
106
107
91
92
SDA
In
110
109
109
SDA
Out
Note: Refer to Figure 18-1 for load conditions
Sym
Characteristic
100
THIGH
101
102
103
TLOW
TR
TF
90
TSU:STA
START condition
setup time
91
THD:STA
106
THD:DAT
107
TSU:DAT
92
TSU:STO
109
TAA
110
TBUF
Min
Max
Units
Conditions
4.0
0.6
SSP Module
100 kHz mode
1.5TCY
4.7
1.3
SSP Module
100 kHz mode
400 kHz mode
1.5TCY
20 + 0.1Cb
1000
300
ns
ns
20 + 0.1Cb
300
300
ns
ns
4.7
0.6
4.0
0.6
0
0
250
100
4.7
0.6
4.7
1.3
0.9
3500
s
s
s
s
ns
s
ns
ns
s
s
ns
ns
s
s
Cb is specified to be from
10 to 400 pF
Cb is specified to be from
10 to 400 pF
Only relevant for repeated
START condition
After this period the first clock
pulse is generated
Note 2
Note 1
Time the bus must be free
before a new transmission can
start
Cb
Bus capacitive loading
400
pF
Note 1: As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region (min. 300 ns) of
the falling edge of SCL to avoid unintended generation of START or STOP conditions.
2: A fast-mode (400 kHz) I2C-bus device can be used in a standard-mode (100 kHz) I2C-bus system, but the requirement
tsu;DAT 250 ns must then be met. This will automatically be the case if the device does not stretch the LOW period of the
SCL signal. If such a device does stretch the LOW period of the SCL signal, it must output the next data bit to the SDA line
TR max.+tsu;DAT = 1000 + 250 = 1250 ns (according to the standard-mode I2C bus specification) before the SCL line is
released.
DS30390E-page 197
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-11: USART SYNCHRONOUS TRANSMISSION (MASTER/SLAVE) TIMING
RC6/TX/CK
pin
121
121
RC7/RX/DT
pin
120
122
Note: Refer to Figure 18-1 for load conditions
121
Characteristic
TckH2dtV
Tckrf
122
:
Sym
Tdtrf
Min
Typ
Max
Units Conditions
PIC16C73/74
80
ns
PIC16LC73/74
100
ns
PIC16C73/74
45
ns
PIC16LC73/74
50
ns
PIC16C73/74
45
ns
PIC16LC73/74
50
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
RC6/TX/CK
pin
RC7/RX/DT
pin
125
126
Note: Refer to Figure 18-1 for load conditions
Sym
Characteristic
Min
Typ
Max
125
TdtV2ckL
126
TckL2dtl
Units Conditions
15
ns
15
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 198
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 18-13: A/D CONVERTER CHARACTERISTICS:
PIC16C73/74-04 (Commercial, Industrial)
PIC16C73/74-10 (Commercial, Industrial)
PIC16C73/74-20 (Commercial, Industrial)
PIC16LC73/74-04 (Commercial, Industrial)
Param Sym Characteristic
No.
A01
NR
A02
Resolution
Typ
Max
Units
Conditions
8-bits
bit
<1
<1
A03
EIL
A04
<1
A05
<1
A06
<1
A10
Min
Monotonicity
guaranteed
A20
3.0V
VDD + 0.3
A25
VSS - 0.3
VREF + 0.3
A30
10.0
A40
IAD
PIC16C73/74
180
PIC16LC73/74
90
10
1000
10
A50
DS30390E-page 199
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 18-13: A/D CONVERSION TIMING
BSF ADCON0, GO
134
1 TCY
(TOSC/2) (1)
131
Q4
130
132
A/D CLK
A/D DATA
NEW_DATA
OLD_DATA
ADRES
ADIF
GO
DONE
SAMPLING STOPPED
SAMPLE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
Sym Characteristic
TAD
Min
Typ
Max
Units
Conditions
PIC16C73/74
1.6
PIC16LC73/74
2.0
PIC16C73/74
2.0
4.0
6.0
A/D RC Mode
A/D RC Mode
PIC16LC73/74
3.0
6.0
9.0
131
9.5
TAD
132
Note 2
20
5*
TOSC/2
1.5
TAD
134
TGO
135
*
DS30390E-page 200
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.0
TABLE 19-1:
OSC
PIC16C73A-04
PIC16C74A-04
PIC16C73A-10
PIC16C74A-10
PIC16C73A-20
PIC16C74A-20
PIC16LC73A-04
PIC16LC74A-04
JW Devices
RC
XT
HS
LP
The shaded sections indicate oscillator selections which are tested for functionality, but not for MIN/MAX specifications.
It is recommended that the user select the device type that ensures the specifications required.
DS30390E-page 201
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.1
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
VDD
4.0
4.5
6.0
5.5
V
V
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
SVDD
0.05
D005
BVDD
3.7
4.0
4.3
3.7
4.0
4.4
2.7
mA
10
20
mA
HS osc configuration
FOSC = 20 MHz, VDD = 5.5V
IBOR
350
425
IPD
10.5
1.5
1.5
2.5
42
16
19
19
A
A
A
A
D023*
IBOR
350
425
D010
D013
D015*
Note 1:
2:
3:
4:
5:
6:
DS30390E-page 202
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.2
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
D001
Supply Voltage
VDD
2.5
6.0
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
SVDD
0.05
D005
BVDD
3.7
4.0
4.3
D010
2.0
3.8
mA
22.5
48
LP osc configuration
FOSC = 32 kHz, VDD = 3.0V, WDT disabled
D010A
D015*
350
425
D020
D021
D021A
Power-down Current
(Note 3,5)
7.5
0.9
0.9
30
5
5
A
A
A
D023*
350
425
Note 1:
2:
3:
4:
5:
6:
IPD
DS30390E-page 203
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.3
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
D030
D030A
D031
with Schmitt Trigger buffer
D032
MCLR, OSC1 (in RC mode)
D033
OSC1 (in XT, HS and LP)
Input High Voltage
I/O ports
D040
with TTL buffer
D040A
D041
D042
D042A
D043
D070
D060
D061
D063
MCLR, RA4/T0CKI
OSC1
D080
D080A
D083
D083A
VIL
VSS
VSS
VSS
VSS
VSS
VIH
2.0
0.25VDD
+ 0.8V
- 0.15VDD
0.8V
- 0.2VDD
- 0.2VDD
- 0.3VDD
-
IIL
VOL
V
V
V
Note1
VDD
VDD
V
V
VDD
VDD
VDD
VDD
400
5
5
0.6
0.6
0.6
0.6
DS30390E-page 204
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
DC CHARACTERISTICS
Param
No.
D090
Characteristic
Output High Voltage
I/O ports (Note 3)
VDD - 0.7 -
VDD - 0.7 -
VDD - 0.7 -
D090A
D092
D092A
D150*
D100
VOD
14
COSC2
15
pF
D101
D102
DS30390E-page 205
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.4
The timing parameter symbols have been created following one of the following formats:
1. TppS2ppS
3. TCC:ST
2. TppS
4. Ts
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDI
do
SDO
dt
Data in
io
I/O port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (Hi-impedance)
L
Low
I2C only
AA
BUF
output access
Bus free
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
Hi-impedance
High
Low
High
Low
SU
Setup
STO
STOP condition
Load condition 1
VDD/2
RL
CL
Pin
CL
Pin
VSS
VSS
RL = 464
CL = 50 pF
15 pF
for all pins except OSC2, but including PORTD and PORTE outputs as
ports
for OSC2 output
DS30390E-page 206
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
19.5
Q1
Q2
Q3
Q4
Q1
OSC1
1
CLKOUT
TABLE 19-2:
Parameter
No.
Characteristic
Fosc
Min
Typ
Max
Units Conditions
DC
4
MHz XT and RC osc mode
DC
4
MHz HS osc mode (-04)
DC
10
MHz HS osc mode (-10)
DC
20
MHz HS osc mode (-20)
DC
200
kHz LP osc mode
Oscillator Frequency
DC
4
MHz RC osc mode
(Note 1)
0.1
4
MHz XT osc mode
4
20
MHz HS osc mode
5
200
kHz LP osc mode
1
Tosc External CLKIN Period
250
ns
XT and RC osc mode
(Note 1)
250
ns
HS osc mode (-04)
100
ns
HS osc mode (-10)
50
ns
HS osc mode (-20)
5
s
LP osc mode
Oscillator Period
250
ns
RC osc mode
(Note 1)
250
10,000
ns
XT osc mode
250
250
ns
HS osc mode (-04)
100
250
ns
HS osc mode (-10)
50
250
ns
HS osc mode (-20)
5
s
LP osc mode
200
TCY
DC
ns
TCY = 4/FOSC
2
TCY Instruction Cycle Time (Note 1)
3
TosL, External Clock in (OSC1) High or
100
ns
XT oscillator
TosH Low Time
2.5
s
LP oscillator
15
ns
HS oscillator
4
TosR, External Clock in (OSC1) Rise or
25
ns
XT oscillator
TosF Fall Time
50
ns
LP oscillator
15
ns
HS oscillator
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time-base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing code.
Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested to operate at "min." values with an external clock applied to the OSC1/CLKIN pin.
When an external clock input is used, the "Max." cycle time limit is "DC" (no clock) for all devices.
DS30390E-page 207
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-3: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
CLKOUT
13
14
19
12
18
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
Note: Refer to Figure 19-1 for load conditions.
TABLE 19-3:
Param Sym
No.
Characteristic
Min
Typ
Max
Units Conditions
10*
75
200
ns
Note 1
11*
75
200
ns
Note 1
12*
TckR
35
100
ns
Note 1
13*
TckF
35
100
ns
Note 1
14*
TckL2ioV
0.5TCY + 20
ns
Note 1
15*
TOSC + 200
ns
Note 1
16*
TckH2ioI
Note 1
17*
18*
TosH2ioI
ns
50
150
ns
PIC16C73A/74A
100
ns
PIC16LC73A/74A
200
ns
19*
ns
20*
TioR
PIC16C73A/74A
10
40
ns
PIC16LC73A/74A
80
ns
PIC16C73A/74A
10
40
ns
PIC16LC73A/74A
80
ns
21*
TioF
22*
Tinp
TCY
ns
23*
Trbp
TCY
ns
DS30390E-page 208
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Time-out
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
BVDD
VDD
35
TABLE 19-4:
Parameter
No.
Sym
Characteristic
30
TmcL
31*
Twdt
18
33
ms
32
Tost
33*
Tpwrt
34
35
Min
Typ
Max
Units
Conditions
1024TOSC
28
72
132
ms
TIOZ
2.1
TBOR
100
DS30390E-page 209
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-6: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
RA4/T0CKI
41
40
42
RC0/T1OSO/T1CKI
46
45
47
48
TMR0 or
TMR1
Note: Refer to Figure 19-1 for load conditions.
TABLE 19-5:
Param
No.
Sym
Characteristic
40*
Tt0H
No Prescaler
With Prescaler
No Prescaler
With Prescaler
41*
42*
45*
46*
47*
48
Tt0L
Min
Typ
Max
0.5TCY + 20
ns
10
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
0.5TCY + 20
10
Tt0P
T0CKI Period
TCY + 40
No Prescaler
With Prescaler Greater of:
20 or TCY + 40
N
Tt1H
T1CKI High Time Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1L
T1CKI Low Time
Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1P
T1CKI input period Synchronous PIC16C7X
Greater of:
30 OR TCY + 40
N
Greater of:
PIC16LC7X
50 OR TCY + 40
N
Asynchronous PIC16C7X
60
PIC16LC7X
100
Ft1
Timer1 oscillator input frequency range
DC
(oscillator enabled by setting bit T1OSCEN)
TCKEZtmr1 Delay from external clock edge to timer increment
2Tosc
Units Conditions
Must also meet
parameter 42
Must also meet
parameter 42
N = prescale value
(2, 4, ..., 256)
Must also meet
parameter 47
N = prescale value
(1, 2, 4, 8)
N = prescale value
(1, 2, 4, 8)
200
ns
ns
kHz
7Tosc
DS30390E-page 210
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-7: CAPTURE/COMPARE/PWM TIMINGS (CCP1 AND CCP2)
RC1/T1OSI/CCP2
and RC2/CCP1
(Capture Mode)
50
51
52
RC1/T1OSI/CCP2
and RC2/CCP1
(Compare or PWM Mode)
53
54
TABLE 19-6:
Param
No.
50*
51*
Sym Characteristic
TccL CCP1 and CCP2
input low time
Min
No Prescaler
ns
10
ns
20
ns
0.5TCY + 20
ns
PIC16C73A/74A
10
ns
PIC16LC73A/74A
20
ns
3TCY + 40
N
ns
10
25
ns
No Prescaler
52*
53*
54*
0.5TCY + 20
PIC16C73A/74A
With Prescaler PIC16LC73A/74A
With Prescaler
PIC16C73A/74A
PIC16LC73A/74A
25
45
ns
PIC16C73A/74A
10
25
ns
PIC16LC73A/74A
25
45
ns
N = prescale
value (1,4 or 16)
DS30390E-page 211
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-8: PARALLEL SLAVE PORT TIMING (PIC16C74A)
RE2/CS
RE0/RD
RE1/WR
65
RD7:RD0
62
64
63
Note: Refer to Figure 19-1 for load conditions
TABLE 19-7:
Parameter
No.
62
Characteristic
63*
TwrH2dtI
64
65
*
TrdL2dtV
TrdH2dtI
RD or CS to dataout invalid
20
25
ns
ns
20
ns
35
ns
80
90
ns
ns
10
30
ns
Conditions
Extended
Range Only
Extended
Range Only
DS30390E-page 212
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-9: SPI MODE TIMING
SS
70
SCK
(CKP = 0)
71
72
78
79
79
78
SCK
(CKP = 1)
80
SDO
77
75, 76
SDI
74
73
Note: Refer to Figure 19-1 for load conditions
TABLE 19-8:
Parameter
No.
Characteristic
Min
Typ
Max
Units
TCY
ns
ns
70
TssL2scH,
TssL2scL
71
TscH
TCY + 20
72
TscL
TCY + 20
ns
73
TdiV2scH,
TdiV2scL
100
ns
74
TscH2diL,
TscL2diL
100
ns
75
TdoR
10
25
ns
76
TdoF
10
25
ns
77
TssH2doZ
10
50
ns
78
TscR
10
25
ns
79
TscF
10
25
ns
Conditions
80
TscH2doV,
SDO data output valid after SCK
50
ns
TscL2doV
edge
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 213
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-10: I2C BUS START/STOP BITS TIMING
SCL
93
91
90
92
SDA
STOP
Condition
START
Condition
Note: Refer to Figure 19-1 for load conditions
TABLE 19-9:
Parameter
No.
Sym
90
TSU:STA
91
THD:STA
92
TSU:STO
93
THD:STO
DS30390E-page 214
Characteristic
START condition
Setup time
START condition
Hold time
STOP condition
Setup time
STOP condition
Hold time
Min
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
4700
600
4000
600
4700
600
4000
600
Typ Max
Units
Conditions
ns
ns
ns
ns
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-11: I2C BUS DATA TIMING
103
102
100
101
SCL
90
106
107
91
92
SDA
In
110
109
109
SDA
Out
Note: Refer to Figure 19-1 for load conditions
Sym
Characteristic
100
THIGH
101
102
103
TLOW
TR
TF
90
TSU:STA
START condition
setup time
91
THD:STA
106
THD:DAT
107
TSU:DAT
92
TSU:STO
109
TAA
110
TBUF
Min
Max
Units
Conditions
4.0
0.6
SSP Module
100 kHz mode
1.5TCY
4.7
1.3
SSP Module
100 kHz mode
400 kHz mode
1.5TCY
20 + 0.1Cb
1000
300
ns
ns
20 + 0.1Cb
300
300
ns
ns
4.7
0.6
4.0
0.6
0
0
250
100
4.7
0.6
4.7
1.3
0.9
3500
s
s
s
s
ns
s
ns
ns
s
s
ns
ns
s
s
Cb is specified to be from
10 to 400 pF
Cb is specified to be from
10 to 400 pF
Only relevant for repeated
START condition
After this period the first clock
pulse is generated
Note 2
Note 1
Time the bus must be free
before a new transmission can
start
Cb
Bus capacitive loading
400
pF
Note 1: As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region (min. 300 ns) of
the falling edge of SCL to avoid unintended generation of START or STOP conditions.
2: A fast-mode (400 kHz) I2C-bus device can be used in a standard-mode (100 kHz) I2C-bus system, but the requirement
tsu;DAT 250 ns must then be met. This will automatically be the case if the device does not stretch the LOW period of the
SCL signal. If such a device does stretch the LOW period of the SCL signal, it must output the next data bit to the SDA line
TR max.+tsu;DAT = 1000 + 250 = 1250 ns (according to the standard-mode I2C bus specification) before the SCL line is
released.
DS30390E-page 215
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-12: USART SYNCHRONOUS TRANSMISSION (MASTER/SLAVE) TIMING
RC6/TX/CK
pin
121
121
RC7/RX/DT
pin
120
122
Note: Refer to Figure 19-1 for load conditions
121
Characteristic
TckH2dtV
Tckrf
122
:
Sym
Tdtrf
Min
Typ
Max
Units Conditions
PIC16C73A/74A
80
ns
PIC16LC73A/74A
100
ns
45
ns
50
ns
PIC16C73A/74A
45
ns
PIC16LC73A/74A
50
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
RC6/TX/CK
pin
RC7/RX/DT
pin
125
126
Note: Refer to Figure 19-1 for load conditions
Sym
Characteristic
Min
Typ
Max
125
TdtV2ckL
126
TckL2dtl
Units Conditions
15
ns
15
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 216
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 19-13: A/D CONVERTER CHARACTERISTICS:
PIC16C73A/74A-04 (Commercial, Industrial, Extended)
PIC16C73A/74A-10 (Commercial, Industrial, Extended)
PIC16C73A/74A-20 (Commercial, Industrial, Extended)
PIC16LC73A/74A-04 (Commercial, Industrial)
Param Sym Characteristic
No.
A01
NR
A02
Resolution
Typ
Max
Units
Conditions
8-bits
bit
<1
<1
A03
EIL
A04
<1
A05
<1
A06
<1
A10
Min
Monotonicity
guaranteed
A20
3.0V
VDD + 0.3
A25
VSS - 0.3
VREF + 0.3
A30
10.0
A40
IAD
PIC16C73A/74A
180
PIC16LC73A/74A
90
10
1000
10
A50
DS30390E-page 217
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 19-14: A/D CONVERSION TIMING
BSF ADCON0, GO
134
1 TCY
(TOSC/2) (1)
131
Q4
130
132
A/D CLK
A/D DATA
NEW_DATA
OLD_DATA
ADRES
ADIF
GO
DONE
SAMPLING STOPPED
SAMPLE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
Sym Characteristic
TAD
Min
Typ
Max
Units
Conditions
PIC16C73A/74A
1.6
PIC16LC73A/74A
2.0
PIC16C73A/74A
2.0
4.0
6.0
A/D RC Mode
A/D RC Mode
PIC16LC73A/74A
3.0
6.0
9.0
131
9.5
TAD
132
Note 2
20
5*
TOSC/2
1.5
TAD
134
TGO
135
*
DS30390E-page 218
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.0
DS30390E-page 219
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 20-1:
OSC
RC
XT
PIC16C76-04
PIC16C77-04
VDD: 4.0V to 6.0V
IDD: 5 mA max.
at 5.5V
IPD: 16 A max.
at 4V
Freq: 4 MHz max.
VDD: 4.0V to 6.0V
IDD: 5 mA max.
at 5.5V
IPD: 16 A max.
at 4V
Freq: 4 MHz max.
PIC16C76-10
PIC16C77-10
VDD: 4.5V to 5.5V
IDD: 2.7 mA typ.
at 5.5V
IPD: 1.5 A typ.
at 4V
Freq: 4 MHz max.
VDD: 4.5V to 5.5V
IDD: 2.7 mA typ.
at 5.5V
IPD: 1.5 A typ.
at 4V
Freq: 4 MHz max.
PIC16C76-20
PIC16C77-20
VDD: 4.5V to 5.5V
IDD: 2.7 mA typ.
at 5.5V
IPD: 1.5 A typ.
at 4V
Freq: 4 MHz max.
VDD: 4.5V to 5.5V
IDD: 2.7 mA typ.
at 5.5V
IPD: 1.5 A typ.
at 4V
Freq: 4 MHz max.
PIC16LC76-04
PIC16LC77-04
VDD: 2.5V to 6.0V
IDD: 3.8 mA max.
at 3.0V
IPD: 5 A max. at 3V
Freq: 4 MHz max.
VDD: 2.5V to 6.0V
IDD: 3.8 mA max.
at 3.0V
IPD: 5 A max. at 3V
Freq: 4 MHz max.
JW Devices
VDD: 4.0V to 6.0V
IDD: 5 mA max.
at 5.5V
IPD: 16 A max.
at 4V
Freq: 4 MHz max.
VDD: 4.0V to 6.0V
IDD: 5 mA max.
at 5.5V
IPD: 16 A max.
at 4V
Freq: 4 MHz max.
DS30390E-page 220
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.1
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
VDD
4.0
4.5
6.0
5.5
V
V
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
SVDD
0.05
D005
BVDD
3.7
4.0
4.3
3.7
4.0
4.4
2.7
mA
10
20
mA
HS osc configuration
FOSC = 20 MHz, VDD = 5.5V
IBOR
350
425
IPD
10.5
1.5
1.5
2.5
42
16
19
19
A
A
A
A
D023*
IBOR
350
425
D010
D013
D015*
Note 1:
2:
3:
4:
5:
6:
DS30390E-page 221
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.2
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Sym
Min
Conditions
D001
Supply Voltage
VDD
2.5
6.0
D002*
VDR
1.5
D003
VPOR
VDD start voltage to
ensure internal Power-on
Reset signal
VSS
D004*
SVDD
0.05
D005
BVDD
3.7
4.0
4.3
D010
2.0
3.8
mA
22.5
48
LP osc configuration
FOSC = 32 kHz, VDD = 3.0V, WDT disabled
D010A
D015*
350
425
D020
D021
D021A
Power-down Current
(Note 3,5)
7.5
0.9
0.9
30
5
5
A
A
A
D023*
350
425
Note 1:
2:
3:
4:
5:
6:
IPD
DS30390E-page 222
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.3
DC Characteristics:
DC CHARACTERISTICS
Param
No.
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
D030
D030A
D031
with Schmitt Trigger buffer
D032
MCLR, OSC1 (in RC mode)
D033
OSC1 (in XT, HS and LP)
Input High Voltage
I/O ports
D040
with TTL buffer
D040A
D041
D042
D042A
D043
D070
D060
D061
D063
MCLR, RA4/T0CKI
OSC1
D080
D080A
D083
D083A
VIL
VSS
VSS
VSS
VSS
VSS
VIH
2.0
0.25VDD
+ 0.8V
- 0.15VDD
0.8V
- 0.2VDD
- 0.2VDD
- 0.3VDD
V
V
V
V
V
VDD
VDD
V
V
VDD
VDD
VDD
VDD
400
IIL
VOL
5
5
0.6
0.6
0.6
0.6
Note1
DS30390E-page 223
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
DC CHARACTERISTICS
Param
No.
D090
Characteristic
Output High Voltage
I/O ports (Note 3)
VDD - 0.7 -
VDD - 0.7 -
VDD - 0.7 -
D090A
D092
D092A
D150*
D100
VOD
14
COSC2
15
pF
D101
D102
DS30390E-page 224
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.4
The timing parameter symbols have been created following one of the following formats:
1. TppS2ppS
3. TCC:ST
2. TppS
4. Ts
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDI
do
SDO
dt
Data in
io
I/O port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (Hi-impedance)
L
Low
I2C only
AA
BUF
output access
Bus free
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
Hi-impedance
High
Low
High
Low
SU
Setup
STO
STOP condition
Load condition 1
VDD/2
RL
CL
Pin
CL
Pin
VSS
VSS
RL = 464
CL = 50 pF
15 pF
for all pins except OSC2, but including PORTD and PORTE outputs as
ports
for OSC2 output
DS30390E-page 225
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
20.5
Q1
Q2
Q3
Q4
Q1
OSC1
1
CLKOUT
TABLE 20-2:
Parameter
No.
Characteristic
Min
Typ
Max
Fosc
DC
DC
DC
DC
DC
DC
0.1
4
5
250
250
100
50
5
250
250
250
100
4
4
10
20
200
4
4
20
200
10,000
250
250
Oscillator Frequency
(Note 1)
Tosc
Oscillator Period
(Note 1)
Units Conditions
MHz
MHz
MHz
MHz
kHz
MHz
MHz
MHz
kHz
ns
ns
ns
ns
s
ns
ns
ns
ns
50
250
ns
5
s
LP osc mode
200
TCY
DC
ns
TCY = 4/FOSC
2
TCY Instruction Cycle Time (Note 1)
3
TosL, External Clock in (OSC1) High or
100
ns
XT oscillator
TosH Low Time
2.5
s
LP oscillator
15
ns
HS oscillator
4
TosR, External Clock in (OSC1) Rise or
25
ns
XT oscillator
TosF Fall Time
50
ns
LP oscillator
15
ns
HS oscillator
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time-base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing code.
Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested to operate at "min." values with an external clock applied to the OSC1/CLKIN pin.
When an external clock input is used, the "Max." cycle time limit is "DC" (no clock) for all devices.
DS30390E-page 226
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-3: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
CLKOUT
13
14
19
12
18
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
Note: Refer to Figure 20-1 for load conditions.
TABLE 20-3:
Param Sym
No.
Min
Typ
Max
Units Conditions
10*
75
200
ns
Note 1
11*
75
200
ns
Note 1
12*
TckR
35
100
ns
Note 1
13*
TckF
35
100
ns
Note 1
14*
TckL2ioV
0.5TCY + 20
ns
Note 1
15*
16*
TckH2ioI
17*
18*
TosH2ioI
TOSC + 200
ns
Note 1
ns
Note 1
50
150
ns
PIC16C76/77
100
ns
PIC16LC76/77
200
ns
19*
ns
20*
TioR
10
40
ns
21*
TioF
22*
Tinp
23*
Trbp
TCY
PIC16C76/77
PIC16LC76/77
80
ns
PIC16C76/77
10
40
ns
80
ns
TCY
ns
ns
PIC16LC76/77
DS30390E-page 227
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Time-out
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
BVDD
VDD
35
TABLE 20-4:
Parameter
No.
Sym
Characteristic
Min
Typ
Max
Units
30
TmcL
31*
Twdt
18
33
ms
32
Tost
1024TOSC
33*
Tpwrt
28
72
132
ms
34
TIOZ
2.1
TBOR
100
35
*
Conditions
DS30390E-page 228
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-6: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
RA4/T0CKI
41
40
42
RC0/T1OSO/T1CKI
46
45
47
48
TMR0 or
TMR1
Note: Refer to Figure 20-1 for load conditions.
TABLE 20-5:
Param
No.
Sym
Characteristic
40*
Tt0H
No Prescaler
With Prescaler
No Prescaler
With Prescaler
41*
42*
45*
46*
47*
48
Tt0L
Min
Typ
Max
0.5TCY + 20
ns
10
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
0.5TCY + 20
10
Tt0P
T0CKI Period
TCY + 40
No Prescaler
With Prescaler Greater of:
20 or TCY + 40
N
Tt1H
T1CKI High Time Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1L
T1CKI Low Time
Synchronous, Prescaler = 1
0.5TCY + 20
Synchronous, PIC16C7X
15
Prescaler =
PIC16LC7X
25
2,4,8
Asynchronous PIC16C7X
30
PIC16LC7X
50
Tt1P
T1CKI input period Synchronous PIC16C7X
Greater of:
30 OR TCY + 40
N
Greater of:
PIC16LC7X
50 OR TCY + 40
N
Asynchronous PIC16C7X
60
PIC16LC7X
100
Ft1
Timer1 oscillator input frequency range
DC
(oscillator enabled by setting bit T1OSCEN)
TCKEZtmr1 Delay from external clock edge to timer increment
2Tosc
Units Conditions
Must also meet
parameter 42
Must also meet
parameter 42
N = prescale value
(2, 4, ..., 256)
Must also meet
parameter 47
N = prescale value
(1, 2, 4, 8)
N = prescale value
(1, 2, 4, 8)
200
ns
ns
kHz
7Tosc
DS30390E-page 229
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-7: CAPTURE/COMPARE/PWM TIMINGS (CCP1 AND CCP2)
RC1/T1OSI/CCP2
and RC2/CCP1
(Capture Mode)
50
51
52
RC1/T1OSI/CCP2
and RC2/CCP1
(Compare or PWM Mode)
53
54
TABLE 20-6:
Param
No.
50*
51*
Sym Characteristic
TccL CCP1 and CCP2
input low time
Min
No Prescaler
PIC16C76/77
With Prescaler PIC16LC76/77
52*
53*
54*
ns
10
ns
20
ns
0.5TCY + 20
ns
PIC16C76/77
10
ns
PIC16LC76/77
20
ns
3TCY + 40
N
ns
PIC16C76/77
10
25
ns
PIC16LC76/77
25
45
ns
PIC16C76/77
10
25
ns
PIC16LC76/77
25
45
ns
No Prescaler
With Prescaler
0.5TCY + 20
N = prescale
value (1,4 or 16)
DS30390E-page 230
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-8: PARALLEL SLAVE PORT TIMING (PIC16C77)
RE2/CS
RE0/RD
RE1/WR
65
RD7:RD0
62
64
63
Note: Refer to Figure 20-1 for load conditions
TABLE 20-7:
Parameter
No.
62
Characteristic
63*
TwrH2dtI
64
65
*
TrdL2dtV
TrdH2dtI
RD or CS to dataout invalid
20
25
ns
ns
20
ns
35
ns
80
90
ns
ns
10
30
ns
Conditions
Extended
Range Only
Extended
Range Only
DS30390E-page 231
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-9: SPI MASTER MODE TIMING (CKE = 0)
SS
70
SCK
(CKP = 0)
71
72
78
79
79
78
SCK
(CKP = 1)
80
BIT6 - - - - - -1
MSB
SDO
LSB
75, 76
SDI
MSB IN
BIT6 - - - -1
LSB IN
74
73
Refer to Figure 20-1 for load conditions.
SS
81
SCK
(CKP = 0)
71
72
79
73
SCK
(CKP = 1)
80
78
BIT6 - - - - - -1
MSB
SDO
LSB
75, 76
SDI
MSB IN
BIT6 - - - -1
LSB IN
74
Refer to Figure 20-1 for load conditions.
DS30390E-page 232
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-11: SPI SLAVE MODE TIMING (CKE = 0)
SS
70
SCK
(CKP = 0)
83
71
72
78
79
79
78
SCK
(CKP = 1)
80
MSB
SDO
LSB
BIT6 - - - - - -1
77
75, 76
SDI
MSB IN
BIT6 - - - -1
LSB IN
74
73
Refer to Figure 20-1 for load conditions.
SCK
(CKP = 0)
70
83
71
72
SCK
(CKP = 1)
80
MSB
SDO
BIT6 - - - - - -1
LSB
75, 76
SDI
MSB IN
77
BIT6 - - - -1
LSB IN
74
Refer to Figure 20-1 for load conditions.
DS30390E-page 233
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 20-8:
Parameter
No.
70*
71*
72*
73*
74*
75*
76*
77*
78*
79*
80*
81*
82*
83*
Characteristic
Min
Typ
Max
Units
TCY
ns
ns
ns
ns
ns
10
10
10
10
25
25
50
25
25
50
ns
ns
ns
ns
ns
ns
ns
50
ns
edge
SDO data output setup to SCK
TCY
edge
SDO data output valid after SS
edge
SS after SCK edge
1.5TCY + 40
Conditions
TscH2ssH,
ns
TscL2ssH
These parameters are characterized but not tested.
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 234
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-13: I2C BUS START/STOP BITS TIMING
SCL
93
91
90
92
SDA
STOP
Condition
START
Condition
Note: Refer to Figure 20-1 for load conditions
TABLE 20-9:
Parameter
No.
Sym
90
TSU:STA
91
THD:STA
92
TSU:STO
93
THD:STO
Characteristic
START condition
Setup time
START condition
Hold time
STOP condition
Setup time
STOP condition
Hold time
Min
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
100 kHz mode
400 kHz mode
4700
600
4000
600
4700
600
4000
600
Typ Max
Units
Conditions
ns
ns
ns
ns
DS30390E-page 235
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-14: I2C BUS DATA TIMING
103
102
100
101
SCL
90
106
107
91
92
SDA
In
110
109
109
SDA
Out
Note: Refer to Figure 20-1 for load conditions
Sym
Characteristic
100
THIGH
101
102
103
TLOW
TR
TF
90
TSU:STA
START condition
setup time
91
THD:STA
106
THD:DAT
107
TSU:DAT
92
TSU:STO
109
TAA
110
TBUF
Min
Max
Units
Conditions
4.0
0.6
SSP Module
100 kHz mode
1.5TCY
4.7
1.3
SSP Module
100 kHz mode
400 kHz mode
1.5TCY
20 + 0.1Cb
1000
300
ns
ns
20 + 0.1Cb
300
300
ns
ns
4.7
0.6
4.0
0.6
0
0
250
100
4.7
0.6
4.7
1.3
0.9
3500
s
s
s
s
ns
s
ns
ns
s
s
ns
ns
s
s
Cb is specified to be from
10 to 400 pF
Cb is specified to be from
10 to 400 pF
Only relevant for repeated
START condition
After this period the first clock
pulse is generated
Note 2
Note 1
Time the bus must be free
before a new transmission can
start
Cb
Bus capacitive loading
400
pF
Note 1: As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region (min. 300 ns) of
the falling edge of SCL to avoid unintended generation of START or STOP conditions.
2: A fast-mode (400 kHz) I2C-bus device can be used in a standard-mode (100 kHz) I2C-bus system, but the requirement
tsu;DAT 250 ns must then be met. This will automatically be the case if the device does not stretch the LOW period of the
SCL signal. If such a device does stretch the LOW period of the SCL signal, it must output the next data bit to the SDA line
TR max.+tsu;DAT = 1000 + 250 = 1250 ns (according to the standard-mode I2C bus specification) before the SCL line is
released.
DS30390E-page 236
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-15: USART SYNCHRONOUS TRANSMISSION (MASTER/SLAVE) TIMING
RC6/TX/CK
pin
121
121
RC7/RX/DT
pin
120
122
Note: Refer to Figure 20-1 for load conditions
121
Characteristic
TckH2dtV
Tckrf
122
:
Sym
Tdtrf
Min
Typ
Max
Units Conditions
PIC16C76/77
80
ns
PIC16LC76/77
100
ns
45
ns
50
ns
PIC16C76/77
45
ns
PIC16LC76/77
50
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
RC6/TX/CK
pin
RC7/RX/DT
pin
125
126
Note: Refer to Figure 20-1 for load conditions
Sym
Characteristic
Min
Typ
Max
125
TdtV2ckL
126
TckL2dtl
Units Conditions
15
ns
15
ns
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
DS30390E-page 237
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
TABLE 20-13: A/D CONVERTER CHARACTERISTICS:
PIC16C76/77-04 (Commercial, Industrial, Extended)
PIC16C76/77-10 (Commercial, Industrial, Extended)
PIC16C76/77-20 (Commercial, Industrial, Extended)
PIC16LC76/77-04 (Commercial, Industrial)
Param Sym Characteristic
No.
A01
NR
A02
Resolution
Typ
Max
Units
Conditions
8-bits
bit
<1
<1
A03
EIL
A04
<1
A05
<1
A06
<1
A10
Min
Monotonicity
guaranteed
A20
3.0V
VDD + 0.3
A25
VSS - 0.3
VREF + 0.3
A30
10.0
A40
IAD
PIC16C76/77
180
PIC16LC76/77
90
10
1000
10
A50
DS30390E-page 238
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 20-17: A/D CONVERSION TIMING
BSF ADCON0, GO
134
1 Tcy
(TOSC/2) (1)
131
Q4
130
A/D CLK
132
A/D DATA
NEW_DATA
OLD_DATA
ADRES
ADIF
GO
DONE
SAMPLING STOPPED
SAMPLE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
Sym Characteristic
TAD
Min
Typ
Max
Units
Conditions
PIC16C76/77
1.6
PIC16LC76/77
2.0
PIC16C76/77
2.0
4.0
6.0
A/D RC Mode
A/D RC Mode
PIC16LC76/77
3.0
6.0
9.0
131
9.5
TAD
132
Note 2
20
5*
TOSC/2
1.5
TAD
134
TGO
135
*
DS30390E-page 239
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
NOTES:
DS30390E-page 240
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
21.0
The graphs and tables provided in this section are for design guidance and are not tested or guaranteed.
In some graphs or tables the data presented are outside specified operating range (i.e., outside specified VDD
range). This is for information only and devices are guaranteed to operate properly only within the specified
range.
Note:
The data presented in this section is a statistical summary of data collected on units from different lots over
a period of time and matrix samples. 'Typical' represents the mean of the distribution at, 25C, while 'max'
or 'min' represents (mean +3) and (mean -3) respectively where is standard deviation.
30
IPD(nA)
25
20
15
10
0
2.5
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
IPD(A)
1.000
25C
0.100
0C
-40C
0.010
0.001
2.5
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
DS30390E-page 241
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-3: TYPICAL IPD vs. VDD @ 25C
(WDT ENABLED, RC MODE)
6.0
25
5.5
5.0
4.5
Fosc(MHz)
IPD(A)
20
15
10
R = 5k
4.0
3.5
3.0
R = 10k
2.5
2.0
1.5
1.0
0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
0.0
2.5
VDD(Volts)
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
0C
2.4
2.2
R = 3.3k
2.0
20
1.8
70C
Fosc(MHz)
IPD(A)
6.0
25
15
85C
10
5
1.6
R = 5k
1.4
1.2
1.0
R = 10k
0.8
0.6
0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
0.4
6.0
R = 100k
0.2
VDD(Volts)
0.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD(Volts)
Data based on matrix samples. See first page of this section for details.
5.5
-40C
30
R = 100k
0.5
6.0
R = 3.3k
700
600
R = 5k
500
400
R = 10k
300
200
R = 100k
100
0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD(Volts)
DS30390E-page 242
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-8: TYPICAL IPD vs. VDD BROWNOUT DETECT ENABLED (RC
MODE)
1400
1200
30
25
Device NOT in
Brown-out Reset
800
20
600
400
200
0
2.5
IPD(A)
IPD(A)
1000
Device in
Brown-out
Reset
15
10
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
0
2.5
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
1600
1400
1200
45
40
Device NOT in
Brown-out Reset
800
35
30
400
Device in
Brown-out
Reset
20
15
200
4.3
0
2.5
25
3.0
3.5
4.0
4.5
VDD(Volts)
10
5.0
5.5
6.0
5
0
2.5
3.0
3.5
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
DS30390E-page 243
Data based on matrix samples. See first page of this section for details.
600
IPD(A)
IPD(A)
1000
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-12: TYPICAL IDD vs. FREQUENCY (RC MODE @ 22 pF, 25C)
2000
6.0V
1800
5.5V
5.0V
1600
4.5V
IDD(A)
1400
4.0V
1200
3.5V
1000
3.0V
800
2.5V
600
400
200
0
0.0
0.5
1.0
1.5
2.0
2.5
3.0
Frequency(MHz)
3.5
4.0
4.5
Shaded area is
beyond recommended range
FIGURE 21-13: MAXIMUM IDD vs. FREQUENCY (RC MODE @ 22 pF, -40C TO 85C)
2000
6.0V
1800
5.5V
5.0V
1600
4.5V
IDD(A)
Data based on matrix samples. See first page of this section for details.
1400
4.0V
1200
3.5V
1000
3.0V
800
2.5V
600
400
200
0
0.0
0.5
1.0
1.5
2.0
2.5
Frequency(MHz)
DS30390E-page 244
3.0
3.5
4.0
4.5
Shaded area is
beyond recommended range
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-14: TYPICAL IDD vs. FREQUENCY (RC MODE @ 100 pF, 25C)
1600
6.0V
1400
5.5V
5.0V
1200
4.5V
4.0V
1000
IDD(A)
3.5V
3.0V
800
2.5V
600
400
200
0
0
200
400
Shaded area is
beyond recommended range
600
800
1000
1200
1400
1600
1800
Frequency(kHz)
FIGURE 21-15: MAXIMUM IDD vs. FREQUENCY (RC MODE @ 100 pF, -40C TO 85C)
1600
6.0V
1400
5.0V
1200
4.5V
4.0V
1000
IDD(A)
3.5V
3.0V
800
2.5V
600
400
200
0
0
200
400
Shaded area is
beyond recommended range
600
800
1000
1200
1400
1600
1800
Frequency(kHz)
DS30390E-page 245
Data based on matrix samples. See first page of this section for details.
5.5V
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-16: TYPICAL IDD vs. FREQUENCY (RC MODE @ 300 pF, 25C)
1200
6.0V
5.5V
1000
5.0V
4.5V
4.0V
800
3.5V
IDD(A)
3.0V
600
2.5V
400
200
0
0
100
200
300
400
500
600
700
Frequency(kHz)
FIGURE 21-17: MAXIMUM IDD vs. FREQUENCY (RC MODE @ 300 pF, -40C TO 85C)
1200
6.0V
5.5V
5.0V
4.5V
4.0V
800
3.5V
IDD(A)
Data based on matrix samples. See first page of this section for details.
1000
3.0V
600
2.5V
400
200
0
0
100
200
300
400
500
600
700
Frequency(kHz)
DS30390E-page 246
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-18: TYPICAL IDD vs.
CAPACITANCE @ 500 kHz
(RC MODE)
600
4.0
3.5
3.0
gm(mA/V)
4.0V
400
IDD(A)
Max -40C
5.0V
500
3.0V
300
200
2.5
Typ 25C
2.0
Min 85C
1.5
1.0
100
0.5
100 pF
RC OSCILLATOR
FREQUENCIES
100
300 pF
5k
4.12 MHz
1.4%
10k
2.35 MHz
1.4%
100k
268 kHz
1.1%
5.5
6.0
6.5
7.0
70
60
1.80 MHz
1.0%
1.27 MHz
1.0%
10k
688 kHz
1.2%
20
100k
77.2 kHz
1.0%
10
3.3k
707 kHz
1.4%
1.2%
10k
269 kHz
1.6%
100k
28.3 kHz
1.1%
Typ 25C
50
5k
501 kHz
Max -40C
80
3.3k
5k
5.0
90
gm(A/V)
100 pF
4.5
110
Rext
Fosc @ 5V, 25C
22 pF
4.0
Average
Cext
3.5
VDD(Volts)
Shaded area is
beyond recommended range
Capacitance(pF)
TABLE 21-1:
0.0
3.0
300 pF
40
30
0
2.0
Min 85C
7.0
VDD(Volts)
Shaded areas are
beyond recommended range
Max -40C
800
gm(A/V)
700
600
Typ 25C
500
400
300
Min 85C
200
100
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5
7.0
VDD(Volts)
Shaded areas are
beyond recommended range
DS30390E-page 247
Data based on matrix samples. See first page of this section for details.
0
20 pF
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-22: TYPICAL XTAL STARTUP
TIME vs. VDD (LP MODE, 25C)
3.5
70
3.0
60
50
Startup Time(ms)
Startup Time(Seconds)
2.5
2.0
32 kHz, 33 pF/33 pF
1.5
1.0
40
200 kHz, 68 pF/68 pF
30
200 kHz, 47 pF/47 pF
20
1 MHz, 15 pF/15 pF
10
0.5
4 MHz, 15 pF/15 pF
0.0
2.5
0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
3.0
3.5
6.0
4.0
4.5
VDD(Volts)
5.0
5.5
6.0
VDD(Volts)
Osc Type
Startup Time(ms)
Data based on matrix samples. See first page of this section for details.
TABLE 21-2:
LP
20 MHz, 33 pF/33 pF
XT
4
8 MHz, 33 pF/33 pF
3
20 MHz, 15 pF/15 pF
8 MHz, 15 pF/15 pF
2
1
4.0
4.5
DS30390E-page 248
5.0
VDD(Volts)
5.5
HS
CAPACITOR SELECTION
FOR CRYSTAL
OSCILLATORS
Crystal
Freq
Cap. Range
C1
Cap. Range
C2
33 pF
32 kHz
33 pF
200 kHz
15 pF
15 pF
200 kHz
47-68 pF
47-68 pF
1 MHz
15 pF
15 pF
4 MHz
15 pF
15 pF
4 MHz
15 pF
15 pF
8 MHz
15-33 pF
15-33 pF
20 MHz
15-33 pF
15-33 pF
6.0
Crystals
Used
32 kHz
Epson C-001R32.768K-A
20 PPM
200 kHz
20 PPM
1 MHz
ECS ECS-10-13-1
50 PPM
4 MHz
ECS ECS-40-20-1
50 PPM
8 MHz
30 PPM
20 MHz
30 PPM
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-25: TYPICAL IDD vs. FREQUENCY
(LP MODE, 25C)
6.0V
1400
5.5V
120
100
5.0V
1200
4.5V
1000
4.0V
60
40
20
0
0
6.0V
5.5V
5.0V
4.5V
4.0V
3.5V
3.0V
2.5V
IDD(A)
IDD(A)
80
3.5V
800
3.0V
600
2.5V
400
50
100
150
200
200
Frequency(kHz)
0
0.0
0.4
0.8
1.2
1.6
2.0
2.4
2.8
3.2
3.6
4.0
Frequency(MHz)
6.0V
1600
120
1400
100
1200
80
1000
4.0V
800
3.5V
40
20
0
0
6.0V
5.5V
5.0V
4.5V
4.0V
3.5V
3.0V
2.5V
5.5V
5.0V
4.5V
3.0V
600
2.5V
400
200
50
100
Frequency(kHz)
150
200
0
0.0
0.4
0.8
1.2
1.6
2.0
2.4
2.8
3.2
3.6
4.0
Frequency(MHz)
DS30390E-page 249
Data based on matrix samples. See first page of this section for details.
60
IDD(A)
IDD(A)
140
PIC16C7X
Applicable Devices 72 73 73A 74 74A 76 77
FIGURE 21-29: TYPICAL IDD vs. FREQUENCY
(HS MODE, 25C)
7.0
6.0
6.0
5.0
IDD(mA)
IDD(mA)
5.0
4.0
3.0
2.0
1.0
0.0
1 2
6.0V
5.5V
5.0V
4.5V
4.0V
4.0
3.0
2.0
1.0
10
12
Frequency(MHz)
14
16
18
20
0.0
1 2
6.0V
5.5V
5.0V
4.5V
4.0V
10
12
14
16
18
20
Data based on matrix samples. See first page of this section for details.
Frequency(MHz)
DS30390E-page 250
PIC16C7X
22.0
PACKAGING INFORMATION
22.1
28-Lead Ceramic Side Brazed Dual In-Line with Window (300 mil)(JW)
N
C
E1 E
eA
eB
Pin #1
Indicator Area
D
S1
S
Base
Plane
Seating
Plane
B1
A3
A2
A
A1
e1
B
D1
Inches
Symbol
A
A1
A2
A3
B
B1
C
D
D1
E
E1
e1
eA
eB
L
N
S
S1
Min
Max
0
3.937
1.016
2.921
1.930
0.406
1.219
0.228
35.204
32.893
7.620
7.366
2.413
7.366
7.594
3.302
28
1.143
0.533
10
5.030
1.524
3.506
2.388
0.508
1.321
0.305
35.916
33.147
8.128
7.620
2.667
7.874
8.179
4.064
28
1.397
0.737
Notes
Typical
Typical
Reference
Typical
Reference
Min
Max
0
0.155
0.040
0.115
0.076
0.016
0.048
0.009
1.386
1.295
0.300
0.290
0.095
0.290
0.299
0.130
28
0.045
0.021
10
0.198
0.060
0.138
0.094
0.020
0.052
0.012
1.414
1.305
0.320
0.300
0.105
0.310
0.322
0.160
28
0.055
0.029
Notes
DS30390E-page 251
PIC16C7X
22.2
40-Lead Ceramic CERDIP Dual In-line with Window (600 mil) (JW)
N
E1 E
Pin No. 1
Indicator
Area
eA
eB
D
S
S1
Base
Plane
Seating
Plane
L
B1
A1 A3 A A2
e1
D1
Min
Max
A
A1
A2
A3
B
B1
C
D
D1
E
E1
e1
eA
eB
L
N
S
S1
4.318
0.381
3.810
3.810
0.355
1.270
0.203
51.435
48.260
15.240
12.954
2.540
14.986
15.240
3.175
40
1.016
0.381
DS30390E-page 252
Inches
Notes
Min
Max
10
10
5.715
1.778
4.699
4.445
0.585
1.651
0.381
52.705
48.260
15.875
15.240
2.540
16.002
18.034
3.810
40
2.286
1.778
0.170
0.015
0.150
0.150
0.014
0.050
0.008
2.025
1.900
0.600
0.510
0.100
0.590
0.600
0.125
40
0.040
0.015
0.225
0.070
0.185
0.175
0.023
0.065
0.015
2.075
1.900
0.625
0.600
0.100
0.630
0.710
0.150
40
0.090
0.070
Typical
Typical
Reference
Reference
Typical
Notes
Typical
Typical
Reference
Reference
Typical
PIC16C7X
22.3
E1 E
C
eA
eB
Pin No. 1
Indicator
Area
B2
B1
S
Base
Plane
Seating
Plane
Detail A
B3
A1 A2 A
e1
B
Detail A
D1
Min
Max
A
A1
A2
B
B1
B2
B3
C
D
D1
E
E1
e1
eA
eB
L
N
S
3.632
0.381
3.175
0.406
1.016
0.762
0.203
0.203
34.163
33.020
7.874
7.112
2.540
7.874
8.128
3.175
28
0.584
Inches
Notes
Min
Max
10
10
4.572
3.556
0.559
1.651
1.016
0.508
0.331
35.179
33.020
8.382
7.493
2.540
7.874
9.652
3.683
1.220
0.143
0.015
0.125
0.016
0.040
0.030
0.008
0.008
1.385
1.300
0.310
0.280
0.100
0.310
0.320
0.125
28
0.023
0.180
0.140
0.022
0.065
0.040
0.020
0.013
1.395
1.300
0.330
0.295
0.100
0.310
0.380
0.145
0.048
Typical
4 places
4 places
Typical
Reference
Typical
Reference
Notes
Typical
4 places
4 places
Typical
Reference
Typical
Reference
DS30390E-page 253
PIC16C7X
22.4
E1 E
C
eA
eB
Pin No. 1
Indicator
Area
D
S
S1
Base
Plane
Seating
Plane
L
B1
A1 A2 A
e1
D1
Min
Max
A
A1
A2
B
B1
C
D
D1
E
E1
e1
eA
eB
L
N
S
S1
0.381
3.175
0.355
1.270
0.203
51.181
48.260
15.240
13.462
2.489
15.240
15.240
2.921
40
1.270
0.508
DS30390E-page 254
Inches
Notes
Min
Max
10
10
5.080
4.064
0.559
1.778
0.381
52.197
48.260
15.875
13.970
2.591
15.240
17.272
3.683
40
0.015
0.125
0.014
0.050
0.008
2.015
1.900
0.600
0.530
0.098
0.600
0.600
0.115
40
0.050
0.020
0.200
0.160
0.022
0.070
0.015
2.055
1.900
0.625
0.550
0.102
0.600
0.680
0.145
40
Typical
Typical
Reference
Typical
Reference
Notes
Typical
Typical
Reference
Typical
Reference
PIC16C7X
22.5
28-Lead Plastic Surface Mount (SOIC - Wide, 300 mil Body) (SO)
e
B
h x 45
N
Index
Area
E
Chamfer
h x 45
L
1
Seating
Plane
Base
Plane
CP
A1
Min
Max
Inches
Notes
Min
Max
A
A1
B
C
D
E
e
H
h
L
N
CP
2.362
0.101
0.355
0.241
17.703
7.416
1.270
10.007
0.381
0.406
28
2.642
0.300
0.483
0.318
18.085
7.595
1.270
10.643
0.762
1.143
28
0.102
0.093
0.004
0.014
0.009
0.697
0.292
0.050
0.394
0.015
0.016
28
0.104
0.012
0.019
0.013
0.712
0.299
0.050
0.419
0.030
0.045
28
0.004
Typical
Notes
Typical
DS30390E-page 255
PIC16C7X
22.6
28-Lead Plastic Surface Mount (SSOP - 209 mil Body 5.30 mm) (SS)
N
Index
area
C
L
1 2 3
B
Base plane
CP
Seating plane
D
A1
Min
Max
Inches
Notes
Min
Max
A
A1
B
C
D
E
e
H
L
N
CP
1.730
0.050
0.250
0.130
10.070
5.200
0.650
7.650
0.550
28
-
1.990
0.210
0.380
0.220
10.330
5.380
0.650
7.900
0.950
28
0.102
0.068
0.002
0.010
0.005
0.396
0.205
0.026
0.301
0.022
28
-
0.078
0.008
0.015
0.009
0.407
0.212
0.026
0.311
0.037
28
0.004
DS30390E-page 256
Reference
Notes
Reference
PIC16C7X
22.7
-A-
D1
-D-
3
-F-
0.812/0.661 N Pics
.032/.026
1.27
.050
2 Sides
0.177
.007 S B D-E S
-HA
A1
D3/E3
D2
0.38
.015
3
-G-
F-G S
0.177
.007 S B A S
2 Sides
9
0.101 Seating
.004 Plane
D
-C-
E2
E1
0.38
.015
F-G S
-B-
-E-
0.177
.007 S A F-G S
10
0.254
.010 Max
2
0.254
.010 Max
11
-H-
11
0.508
.020
0.508
.020
-H-
0.812/0.661
3
.032/.026
1.524
.060 Min
-C1.651
.065
1.651
.065
R 1.14/0.64
.045/.025
R 1.14/0.64
.045/.025
5
0.533/0.331
.021/.013
0.64 Min
.025
0.177
, D-E S
.007 M A F-G S
Min
Max
4.191
A1
D
D1
D2
D3
E
E1
E2
E3
N
CP
LT
2.413
17.399
16.510
15.494
12.700
17.399
16.510
15.494
12.700
44
0.203
Inches
Notes
Min
Max
4.572
0.165
0.180
2.921
17.653
16.663
16.002
12.700
17.653
16.663
16.002
12.700
44
0.102
0.381
0.095
0.685
0.650
0.610
0.500
0.685
0.650
0.610
0.500
44
0.008
0.115
0.695
0.656
0.630
0.500
0.695
0.656
0.630
0.500
44
0.004
0.015
Reference
Reference
Notes
Reference
Reference
DS30390E-page 257
PIC16C7X
22.8
44-Lead Plastic Surface Mount (MQFP 10x10 mm Body 1.6/0.15 mm Lead Form) (PQ)
4 D
D1 5
0.20 M C A-B S
D S
0.20 M H A-B S
D S
7
0.20 min.
0.13 R min.
Index
area 6
PARTING
LINE
0.13/0.30 R
L
C
E3
E1 E
1.60 Ref.
0.20 M C A-B S
D S
TYP 4x
10
e
0.20 M H A-B S
D S
0.05 mm/mm D
A2
Base
Plane
Seating
Plane
A1
Min
Max
Inches
Notes
Min
Max
A
A1
A2
b
C
D
D1
D3
E
E1
E3
e
L
N
CP
2.000
0.050
1.950
0.300
0.150
12.950
9.900
8.000
12.950
9.900
8.000
0.800
0.730
44
0.102
2.350
0.250
2.100
0.450
0.180
13.450
10.100
8.000
13.450
10.100
8.000
0.800
1.030
44
0.078
0.002
0.768
0.011
0.006
0.510
0.390
0.315
0.510
0.390
0.315
0.031
0.028
44
0.004
0.093
0.010
0.083
0.018
0.007
0.530
0.398
0.315
0.530
0.398
0.315
0.032
0.041
44
DS30390E-page 258
Typical
Reference
Reference
Notes
Typical
Reference
Reference
PIC16C7X
22.9
44-Lead Plastic Surface Mount (TQFP 10x10 mm Body 1.0/0.10 mm Lead Form) (TQ)
D
D1
Pin#1
2
11/13(4x)
Pin#1
2
E
0 Min
E1
11/13(4x)
Detail B
A2
Detail A
R 0.08/0.20
Detail B
R1 0.08 Min
Base Metal
Lead Finish
1.00 Ref.
Gage Plane
0.250
c1
L1
1.00 Ref
b1
Detail A
S
0.20
Min
Detail B
Inches
Symbol
Min
Max
A
A1
A2
D
D1
E
E1
L
e
b
b1
c
c1
N
1.00
0.05
0.95
11.75
9.90
11.75
9.90
0.45
1.20
0.15
1.05
12.25
10.10
12.25
10.10
0.75
Notes
Min
Max
0.039
0.002
0.037
0.463
0.390
0.463
0.390
0.018
0.047
0.006
0.041
0.482
0.398
0.482
0.398
0.030
0.30
0.30
0.09
0.09
44
0.45
0.40
0.20
0.16
44
0.012
0.012
0.004
0.004
44
0.018
0.016
0.008
0.006
44
0.80 BSC
Notes
0.031 BSC
Note 1: Dimensions D1 and E1 do not include mold protrusion. Allowable mold protrusion is 0.25m/m (0.010) per
side. D1 and E1 dimensions including mold mismatch.
2: Dimension b does not include Dambar protrusion, allowable Dambar protrusion shall be 0.08m/m
(0.003)max.
3: This outline conforms to JEDEC MS-026.
DS30390E-page 259
PIC16C7X
22.10
28-Lead SSOP
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
PIC16C72
20I/SS025
AABBCAE
9517SBP
Example
MMMMMMMMMMMM
XXXXXXXXXXXXXXX
AABBCDE
PIC16C73-10/SP
AABBCDE
Example
XXXXXXXXXXX
XXXXXXXXXXX
AABBCDE
MMMMMMMMMMMMMMMM
XXXXXXXXXXXXXXXXXXXX
AABBCDE
MM...M
XX...X
AA
BB
C
D1
E
Note:
9517CAT
Example
28-Lead SOIC
Legend:
PIC16C73/JW
PIC16C73-10/SO
945/CAA
In the event the full Microchip part number cannot be marked on one
line, it will be carried over to the next line thus limiting the number of
available characters for customer specific information.
* Standard OTP marking consists of Microchip part number, year code, week code,
facility code, mask revision number, and assembly code. For OTP marking beyond
this, certain price adders apply. Please check with your Microchip Sales Office.
For QTP devices, any special marking adders are included in QTP price.
DS30390E-page 260
PIC16C7X
Package Marking Information (Contd)
40-Lead PDIP
Example
MMMMMMMMMMMMMM
XXXXXXXXXXXXXXXXXX
AABBCDE
PIC16C74-04/P
9512CAA
Example
MMMMMMMMM
XXXXXXXXXXX
XXXXXXXXXXX
AABBCDE
44-Lead PLCC
44-Lead MQFP
PIC16C74
-10/L
AABBCDE
Example
PIC16C74
-10/PQ
MMMMMMMM
XXXXXXXXXX
XXXXXXXXXX
AABBCDE
AABBCDE
MM...M
XX...X
AA
BB
C
D1
E
Note:
AABBCDE
Example
MMMMMMMM
XXXXXXXXXX
XXXXXXXXXX
AABBCDE
Legend:
PIC16C74/JW
In the event the full Microchip part number cannot be marked on one
line, it will be carried over to the next line thus limiting the number of
available characters for customer specific information.
* Standard OTP marking consists of Microchip part number, year code, week code,
facility code, mask revision number, and assembly code. For OTP marking beyond
this, certain price adders apply. Please check with your Microchip Sales Office.
For QTP devices, any special marking adders are included in QTP price.
DS30390E-page 261
PIC16C7X
Package Marking Information (Contd)
44-Lead TQFP
Example
MMMMMMMM
XXXXXXXXXX
XXXXXXXXXX
AABBCDE
Legend:
PIC16C74A
-10/TQ
AABBCDE
MM...M
XX...X
AA
BB
C
D1
E
Note:
In the event the full Microchip part number cannot be marked on one
line, it will be carried over to the next line thus limiting the number of
available characters for customer specific information.
* Standard OTP marking consists of Microchip part number, year code, week code,
facility code, mask revision number, and assembly code. For OTP marking beyond
this, certain price adders apply. Please check with your Microchip Sales Office.
For QTP devices, any special marking adders are included in QTP price.
DS30390E-page 262
PIC16C7X
APPENDIX A:
APPENDIX B: COMPATIBILITY
1.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
2.
3.
4.
5.
DS30390E-page 263
PIC16C7X
APPENDIX C: WHATS NEW
PIC16C76
PIC16C77
DS30390E-page 264
PIC16C7X
APPENDIX E: PIC16/17 MICROCONTROLLERS
E.1
Clock
Memory
Peripherals
Features
PIC12C509
4
PIC12C671
4
PIC12C672
4
512 x 12
1024 x 12
1024 x 14
2048 x 14
25
41
128
128
Timer Module(s)
TMR0
TMR0
TMR0
TMR0
Yes
Yes
Yes
Yes
I/O Pins
Input Pins
Internal Pull-ups
Yes
Yes
Yes
Yes
2.5-5.5
2.5-5.5
2.5-5.5
2.5-5.5
Yes
Yes
Yes
Yes
Number of Instructions
33
33
35
35
Packages
All PIC12C5XX devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O current capability.
All PIC12C5XX devices use serial programming with data pin GP1 and clock pin GP0.
E.2
Clock
Memory
Peripherals
Features
20
4K
192
Timer Module(s)
TMR0
ADTMR
Serial Port(s)
(SPI/I2C, USART)
8 External; 6 Internal
Interrupt Sources
11
I/O Pins
22
2.7-6.0
Yes
Packages
DS30390E-page 265
PIC16C7X
E.3
Clock
Memory
PIC16C156
PIC16CR156
PIC16C158
PIC16CR158
20
20
20
20
20
20
512
1K
2K
512
1K
2K
73
25
25
25
73
TMR0
TMR0
TMR0
TMR0
TMR0
TMR0
I/O Pins
12
12
12
12
12
12
3.0-5.5
2.5-5.5
3.0-5.5
2.5-5.5
3.0-5.5
2.5-5.5
Number of Instructions
33
33
33
33
33
33
Packages
Features
PIC16CR154
Maximum Frequency
of Operation (MHz)
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high
I/O current capability.
E.4
Clock
Memory
PIC16C54A
20
20
20
20
384
512
512
512
1K
512
25
25
25
25
25
24
TMR0
TMR0
TMR0
TMR0
TMR0
TMR0
12
12
12
12
20
12
2.5-6.25
2.5-6.25
2.0-6.25
2.0-6.25
2.5-6.25
2.5-6.25
Number of Instructions
33
33
33
33
33
33
Packages
28-pin DIP,
SOIC,
SSOP
18-pin DIP,
SOIC;
20-pin SSOP
PIC16C57
PIC16CR57B
PIC16C58A
PIC16CR58A
Maximum Frequency
of Operation (MHz)
20
20
20
20
2K
2K
2K
2K
73
72
72
73
TMR0
TMR0
TMR0
TMR0
I/O Pins
20
20
12
12
2.5-6.25
2.5-6.25
2.0-6.25
2.5-6.25
Number of Instructions
33
33
33
33
Packages
28-pin DIP,
SOIC,
SSOP
Features
PIC16C56
20
I/O Pins
Memory
PIC16C55
Clock
PIC16CR54A
Maximum Frequency
of Operation (MHz)
Features
PIC16C54
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer (except PIC16C52), selectable code protect and
high I/O current capability.
DS30390E-page 266
PIC16C7X
E.5
PIC16C554
Clock
Memory
20
20
20
512
1K
2K
80
80
128
Timer Module(s)
TMR0
TMR0
TMR0
Peripherals Comparators(s)
Internal Reference Voltage
Features
PIC16C558
Interrupt Sources
I/O Pins
13
13
13
2.5-6.0
2.5-6.0
2.5-6.0
Brown-out Reset
Packages
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high
I/O current capability. All PIC16C5XX 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.
E.6
Clock
Memory
PIC16C622
PIC16C642
PIC16C662
Maximum Frequency
of Operation (MHz)
20
20
20
20
20
512
1K
2K
4K
4K
80
80
128
176
176
Timer Module(s)
TMR0
TMR0
TMR0
TMR0
TMR0
2
Peripherals Comparators(s)
Features
PIC16C621
Yes
Yes
Yes
Yes
Yes
Interrupt Sources
I/O Pins
13
13
13
22
33
2.5-6.0
2.5-6.0
2.5-6.0
3.0-6.0
3.0-6.0
Brown-out Reset
Yes
Yes
Yes
Yes
Yes
Packages
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
28-pin PDIP,
SOIC,
Windowed
CDIP
40-pin PDIP,
Windowed
CDIP;
44-pin PLCC,
MQFP
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high
I/O current capability. All PIC16C62X and PIC16C64X Family devices use serial programming with clock pin RB6 and data pin RB7.
DS30390E-page 267
PIC16C7X
E.7
PIC16C62A
PIC16CR62
PIC16C63
PIC16CR63
Maximum Frequency
of Operation (MHz)
20
20
20
20
20
1K
2K
4K
2K
4K
36
128
128
192
192
Timer Module(s)
TMR0
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
Capture/Compare/
Peripherals PWM Module(s)
Serial Port(s)
(SPI/I2C, USART)
SPI/I2C
SPI/I2C
SPI/I2C,
USART
SPI/I2C
USART
Clock
Memory
Features
Interrupt Sources
10
10
I/O Pins
13
22
22
22
22
3.0-6.0
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
Yes
Yes
Yes
Yes
Yes
Brown-out Reset
Yes
Yes
Yes
Yes
Packages
28-pin SDIP,
SOIC, SSOP
PIC16C64A
Clock
Memory
PIC16C65A
PIC16CR65
PIC16C66
PIC16C67
Maximum Frequency
of Operation (MHz)
20
20
20
20
20
20
2K
4K
8K
8K
2K
4K
128
128
192
192
368
368
Timer Module(s)
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
SPI/I2C
SPI/I2C
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
SPI/I2C,
USART
Yes
Yes
Yes
Yes
Yes
Interrupt Sources
11
11
10
11
I/O Pins
33
33
33
33
22
33
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
Yes
Yes
Yes
Yes
Yes
Yes
Brown-out Reset
Yes
Yes
Yes
Yes
Yes
Yes
Packages
Features
PIC16CR64
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.
DS30390E-page 268
PIC16C7X
E.8
Clock
Memory
Peripherals
Features
PIC16CR83
PIC16F84
PIC16CR84
Maximum Frequency
of Operation (MHz)
10
10
10
10
512
1K
512
1K
36
36
68
68
64
64
64
64
Timer Module(s)
TMR0
TMR0
TMR0
TMR0
Interrupt Sources
I/O Pins
13
13
13
13
2.0-6.0
2.0-6.0
2.0-6.0
2.0-6.0
Packages
18-pin DIP,
SOIC
18-pin DIP,
SOIC
18-pin DIP,
SOIC
18-pin DIP,
SOIC
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O current capability. All PIC16C8X Family devices use serial programming with clock pin RB6 and data pin RB7.
E.9
Clock
Memory
4K
4K
176
176
Timer Module(s)
TMR0,
TMR1,
TMR2
TMR0,
TMR1,
TMR2
Capture/Compare/PWM Module(s)
SPI/I2C
SPI/I2C
LCD Module
4 Com,
32 Seg
4 Com,
32 Seg
Interrupt Sources
I/O Pins
25
25
Input Pins
27
27
3.0-6.0
3.0-6.0
Yes
Yes
Serial Port(s)
Peripherals (SPI/I2C, USART)
Features
PIC16C924
Brown-out Reset
Packages
64-pin SDIP(1),
TQFP;
68-pin PLCC,
Die
64-pin SDIP(1),
TQFP;
68-pin PLCC,
Die
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O current capability. All PIC16C9XX Family devices use serial programming with clock pin RB6 and data pin RB7.
DS30390E-page 269
PIC16C7X
E.10
Clock
Memory
Clock
Memory
PIC17CR43
PIC17C44
33
33
33
33
2K
4K
8K
2K
4K
232
232
454
454
454
Timer Module(s)
TMR0,
TMR1,
TMR2,
TMR3
TMR0,
TMR1,
TMR2,
TMR3
TMR0,
TMR1,
TMR2,
TMR3
TMR0,
TMR1,
TMR2,
TMR3
TMR0,
TMR1,
TMR2,
TMR3
Captures/PWM Module(s)
Yes
Yes
Yes
Yes
Yes
Hardware Multiply
Yes
Yes
Yes
Yes
Yes
External Interrupts
Yes
Yes
Yes
Yes
Yes
Interrupt Sources
11
11
11
11
11
I/O Pins
33
33
33
33
33
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
2.5-6.0
Number of Instructions
58
58
58
58
58
Packages
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
40-pin DIP;
44-pin PLCC,
MQFP, TQFP
PIC17C752
PIC17C756
Maximum Frequency
of Operation (MHz)
33
33
8K
16K
454
902
Timer Module(s)
TMR0,
TMR1,
TMR2,
TMR3
TMR0,
TMR1,
TMR2,
TMR3
Peripherals
Features
PIC17C43
33
Peripherals
Features
PIC17CR42
Maximum Frequency
of Operation (MHz)
Captures/PWM Module(s)
4/3
4/3
Hardware Multiply
Yes
Yes
External Interrupts
Yes
Yes
Interrupt Sources
18
18
I/O Pins
50
50
3.0-6.0
3.0-6.0
Number of Instructions
58
58
Packages
64-pin DIP;
68-pin LCC,
68-pin TQFP
64-pin DIP;
68-pin LCC,
68-pin TQFP
All PIC16/17 Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high
I/O current capability.
DS30390E-page 270
PIC16C7X
PIN COMPATIBILITY
Devices that have the same package type and VDD,
VSS and MCLR pin locations are said to be pin
compatible. This allows these different devices to
operate in the same socket. Compatible devices may
only requires minor software modification to allow
proper operation in the application socket
(ex., PIC16C56 and PIC16C61 devices). Not all
devices in the same package size are pin compatible;
for example, the PIC16C62 is compatible with the
PIC16C63, but not the PIC16C55.
Pin compatibility does not mean that the devices offer
the same features. As an example, the PIC16C54 is
pin compatible with the PIC16C71, but does not have
an A/D converter, weak pull-ups on PORTB, or
interrupts.
TABLE E-1:
Package
8-pin
18-pin,
20-pin
28-pin
28-pin
40-pin
PIC17CR42, PIC17C42A,
PIC17C43, PIC17CR43, PIC17C44
40-pin
PIC16C923, PIC16C924
64/68-pin
PIC17C756, PIC17C752
64/68-pin
DS30390E-page 271
PIC16C7X
NOTES:
DS30390E-page 272
PIC16C7X
INDEX
A
A/D
Accuracy/Error ......................................................... 124
ADCON0 Register .................................................... 117
ADCON1 Register .................................................... 118
ADIF bit .................................................................... 119
Analog Input Model Block Diagram .......................... 120
Analog-to-Digital Converter ...................................... 117
Block Diagram .......................................................... 119
Configuring Analog Port Pins ................................... 121
Configuring the Interrupt .......................................... 119
Configuring the Module ............................................ 119
Connection Considerations ...................................... 125
Conversion Clock ..................................................... 121
Conversion Time ...................................................... 123
Conversions ............................................................. 122
Converter Characteristics ................ 181, 199, 217, 238
Delays ...................................................................... 120
Effects of a Reset ..................................................... 124
Equations ................................................................. 120
Faster Conversion - Lower Resolution Tradeoff ...... 123
Flowchart of A/D Operation ...................................... 126
GO/DONE bit ........................................................... 119
Internal Sampling Switch (Rss) Impedance ............. 120
Operation During Sleep ........................................... 124
Sampling Requirements ........................................... 120
Sampling Time ......................................................... 120
Source Impedance ................................................... 120
Time Delays ............................................................. 120
Transfer Function ..................................................... 125
Using the CCP Trigger ............................................. 125
Absolute Maximum Ratings ..................... 167, 183, 201, 219
ACK ........................................................................ 90, 94, 95
ADIE bit .............................................................................. 33
ADIF bit .............................................................................. 35
ADRES Register .................................... 23, 25, 27, 117, 119
ALU ...................................................................................... 9
Application Notes
AN546 (Using the Analog-to-Digital Converter) ....... 117
AN552 (Implementing Wake-up on Key Strokes Using
PIC16CXXX) .............................................................. 45
AN556 (Table Reading Using PIC16CXX .................. 40
AN578 (Use of the SSP Module in the I2C Multi-Master
Environment) .............................................................. 77
AN594 (Using the CCP Modules) .............................. 71
AN607, Power-up Trouble Shooting ........................ 134
Architecture
Harvard ........................................................................ 9
Overview ...................................................................... 9
von Neumann ............................................................... 9
Assembler
MPASM Assembler .................................................. 164
B
Baud Rate Error ............................................................... 101
Baud Rate Formula .......................................................... 101
Baud Rates
Asynchronous Mode ................................................ 102
Synchronous Mode .................................................. 102
BF .......................................................................... 78, 83, 94
Block Diagrams
A/D ........................................................................... 119
Analog Input Model .................................................. 120
Capture ...................................................................... 72
Compare .....................................................................73
I2C Mode ....................................................................93
On-Chip Reset Circuit ...............................................133
PIC16C72 ...................................................................10
PIC16C73 ...................................................................11
PIC16C73A .................................................................11
PIC16C74 ...................................................................12
PIC16C74A .................................................................12
PIC16C76 ...................................................................11
PIC16C77 ...................................................................12
PORTC .......................................................................48
PORTD (In I/O Port Mode) .........................................50
PORTD and PORTE as a Parallel Slave Port ............54
PORTE (In I/O Port Mode) .........................................51
PWM ...........................................................................74
RA3:RA0 and RA5 Port Pins ......................................43
RA4/T0CKI Pin ...........................................................43
RB3:RB0 Port Pins .....................................................45
RB7:RB4 Port Pins .....................................................46
SPI Master/Slave Connection .....................................81
SSP in I2C Mode ........................................................93
SSP in SPI Mode ..................................................80, 85
Timer0 ........................................................................59
Timer0/WDT Prescaler ...............................................62
Timer1 ........................................................................66
Timer2 ........................................................................69
USART Receive .......................................................108
USART Transmit ......................................................106
Watchdog Timer .......................................................144
BOR bit .......................................................................39, 135
BRGH bit ..........................................................................101
Buffer Full Status bit, BF ...............................................78, 83
C
C bit ....................................................................................30
C Compiler ........................................................................165
Capture/Compare/PWM
Capture
Block Diagram ....................................................72
CCP1CON Register ...........................................72
CCP1IF ...............................................................72
CCPR1 ...............................................................72
CCPR1H:CCPR1L .............................................72
Mode ..................................................................72
Prescaler ............................................................73
CCP Timer Resources ................................................71
Compare
Block Diagram ....................................................73
Mode ..................................................................73
Software Interrupt Mode .....................................73
Special Event Trigger .........................................73
Special Trigger Output of CCP1 .........................73
Special Trigger Output of CCP2 .........................73
Interaction of Two CCP Modules ................................71
Section ........................................................................71
Special Event Trigger and A/D Conversions ..............73
Capture/Compare/PWM (CCP)
PWM Block Diagram ..................................................74
PWM Mode .................................................................74
PWM, Example Frequencies/Resolutions ..................75
Carry bit ................................................................................9
CCP1CON ..........................................................................29
CCP1IE bit ..........................................................................33
CCP1IF bit ....................................................................35, 36
CCP2CON ..........................................................................29
CCP2IE bit ..........................................................................37
DS30390E-page 273
PIC16C7X
CCP2IF bit .......................................................................... 38
CCPR1H Register ............................................ 25, 27, 29, 71
CCPR1L Register ......................................................... 29, 71
CCPR2H Register ............................................ 25, 27, 29, 71
CCPR2L Register ............................................. 25, 27, 29, 71
CCPxM0 bit ........................................................................ 72
CCPxM1 bit ........................................................................ 72
CCPxM2 bit ........................................................................ 72
CCPxM3 bit ........................................................................ 72
CCPxX bit ........................................................................... 72
CCPxY bit ........................................................................... 72
CKE .................................................................................... 83
CKP .............................................................................. 79, 84
Clock Polarity Select bit, CKP ...................................... 79, 84
Clock Polarity, SPI Mode ................................................... 81
Clocking Scheme ............................................................... 17
Code Examples
Call of a Subroutine in Page 1 from Page 0 ............... 41
Changing Between Capture Prescalers ..................... 73
Changing Prescaler (Timer0 to WDT) ........................ 63
Changing Prescaler (WDT to Timer0) ........................ 63
I/O Programming ........................................................ 53
Indirect Addressing .................................................... 41
Initializing PORTA ...................................................... 43
Initializing PORTB ...................................................... 45
Initializing PORTC ...................................................... 48
Loading the SSPBUF Register ............................ 80, 85
Code Protection ....................................................... 129, 146
Computed GOTO ............................................................... 40
Configuration Bits ............................................................. 129
Configuration Word .......................................................... 129
Connecting Two Microcontrollers ....................................... 81
CREN bit .......................................................................... 100
CS pin ................................................................................ 54
D
D/A ............................................................................... 78, 83
Data/Address bit, D/A ................................................... 78, 83
DC bit ................................................................................. 30
DC Characteristics
PIC16C72 ................................................................ 168
PIC16C73 ................................................................ 184
PIC16C73A .............................................................. 202
PIC16C74 ................................................................ 184
PIC16C74A .............................................................. 202
PIC16C76 ................................................................ 221
PIC16C77 ................................................................ 221
Development Support .................................................. 5, 163
Development Tools .......................................................... 163
Digit Carry bit ....................................................................... 9
Direct Addressing ............................................................... 41
E
Electrical Characteristics
PIC16C72 ................................................................ 167
PIC16C73 ................................................................ 183
PIC16C73A .............................................................. 201
PIC16C74 ................................................................ 183
PIC16C74A .............................................................. 201
PIC16C76 ................................................................ 219
PIC16C77 ................................................................ 219
External Brown-out Protection Circuit .............................. 140
External Power-on Reset Circuit ...................................... 140
DS30390E-page 274
F
Family of Devices
PIC12CXXX ............................................................. 265
PIC14C000 .............................................................. 265
PIC16C15X .............................................................. 266
PIC16C55X .............................................................. 267
PIC16C5X ................................................................ 266
PIC16C62X and PIC16C64X ................................... 267
PIC16C6X ................................................................ 268
PIC16C7XX ................................................................. 6
PIC16C8X ................................................................ 269
PIC16C9XX ............................................................. 269
PIC17CXX ............................................................... 270
FERR bit .......................................................................... 100
FSR Register ........................... 23, 24, 25, 26, 27, 28, 29, 41
Fuzzy Logic Dev. System (fuzzyTECH-MP) ......... 163, 165
G
General Description ............................................................. 5
GIE bit .............................................................................. 141
I
I/O Ports
PORTA ...................................................................... 43
PORTB ...................................................................... 45
PORTC ...................................................................... 48
PORTD ................................................................ 50, 54
PORTE ...................................................................... 51
Section ....................................................................... 43
I/O Programming Considerations ...................................... 53
I2C
Addressing ................................................................. 94
Addressing I2C Devices ............................................. 90
Arbitration .................................................................. 92
Block Diagram ........................................................... 93
Clock Synchronization ............................................... 92
Combined Format ...................................................... 91
I2C Operation ............................................................. 93
I2C Overview ............................................................. 89
Initiating and Terminating Data Transfer ................... 89
Master Mode .............................................................. 97
Master-Receiver Sequence ....................................... 91
Master-Transmitter Sequence ................................... 91
Mode .......................................................................... 93
Mode Selection .......................................................... 93
Multi-master ............................................................... 92
Multi-Master Mode ..................................................... 97
Reception .................................................................. 95
Reception Timing Diagram ........................................ 95
SCL and SDA pins ..................................................... 94
Slave Mode ................................................................ 94
START ....................................................................... 89
STOP ................................................................... 89, 90
Transfer Acknowledge ............................................... 90
Transmission ............................................................. 96
IDLE_MODE ...................................................................... 98
In-Circuit Serial Programming .................................. 129, 146
INDF .................................................................................. 29
INDF Register ...................................... 24, 25, 26, 27, 28, 41
Indirect Addressing ............................................................ 41
Initialization Condition for all Register .............................. 136
Instruction Cycle ................................................................ 17
Instruction Flow/Pipelining ................................................. 17
Instruction Format ............................................................ 147
PIC16C7X
Instruction Set
ADDLW .................................................................... 149
ADDWF .................................................................... 149
ANDLW .................................................................... 149
ANDWF .................................................................... 149
BCF .......................................................................... 150
BSF .......................................................................... 150
BTFSC ..................................................................... 150
BTFSS ..................................................................... 151
CALL ........................................................................ 151
CLRF ........................................................................ 152
CLRW ...................................................................... 152
CLRWDT .................................................................. 152
COMF ...................................................................... 153
DECF ....................................................................... 153
DECFSZ ................................................................... 153
GOTO ...................................................................... 154
INCF ......................................................................... 154
INCFSZ .................................................................... 155
IORLW ..................................................................... 155
IORWF ..................................................................... 156
MOVF ....................................................................... 156
MOVLW ................................................................... 156
MOVWF ................................................................... 156
NOP ......................................................................... 157
OPTION ................................................................... 157
RETFIE .................................................................... 157
RETLW .................................................................... 158
RETURN .................................................................. 158
RLF .......................................................................... 159
RRF .......................................................................... 159
SLEEP ..................................................................... 160
SUBLW .................................................................... 160
SUBWF .................................................................... 161
SWAPF .................................................................... 161
TRIS ......................................................................... 161
XORLW .................................................................... 162
XORWF .................................................................... 162
Section ..................................................................... 147
Summary Table ........................................................ 148
INT Interrupt ..................................................................... 143
INTCON ............................................................................. 29
INTCON Register ............................................................... 32
INTEDG bit ................................................................. 31, 143
Internal Sampling Switch (Rss) Impedance ..................... 120
Interrupts .......................................................................... 129
PortB Change .......................................................... 143
RB7:RB4 Port Change ............................................... 45
Section ..................................................................... 141
TMR0 ....................................................................... 143
IRP bit ................................................................................ 30
L
Loading of PC .................................................................... 40
M
MCLR .......................................................................133, 136
Memory
Data Memory ..............................................................20
Program Memory ........................................................19
Program Memory Maps
PIC16C72 ...........................................................19
PIC16C73 ...........................................................19
PIC16C73A ........................................................19
PIC16C74 ...........................................................19
PIC16C74A ........................................................19
PIC16C76 ...........................................................20
PIC16C77 ...........................................................20
Register File Maps
PIC16C72 ...........................................................21
PIC16C73 ...........................................................21
PIC16C73A ........................................................21
PIC16C74 ...........................................................21
PIC16C74A ........................................................21
PIC16C76 ...........................................................21
PIC16C77 ...........................................................21
MPASM Assembler ..........................................................163
MPLAB-C ..........................................................................165
MPSIM Software Simulator ......................................163, 165
O
OERR bit ..........................................................................100
OPCODE ..........................................................................147
OPTION ..............................................................................29
OPTION Register ...............................................................31
Orthogonal ............................................................................9
OSC selection ...................................................................129
Oscillator
HS .....................................................................131, 135
LP .....................................................................131, 135
RC ............................................................................131
XT .....................................................................131, 135
Oscillator Configurations ..................................................131
Output of TMR2 ..................................................................69
P
P ...................................................................................78, 83
Packaging
28-Lead Ceramic w/Window .....................................251
28-Lead PDIP ...........................................................253
28-Lead SOIC ...........................................................255
28-Lead SSOP .........................................................256
40-Lead CERDIP w/Window ....................................252
40-Lead PDIP ...........................................................254
44-Lead MQFP .........................................................258
44-Lead PLCC ..........................................................257
44-Lead TQFP ..........................................................259
Paging, Program Memory ...................................................40
Parallel Slave Port ........................................................50, 54
PCFG0 bit .........................................................................118
PCFG1 bit .........................................................................118
PCFG2 bit .........................................................................118
PCL Register ............................23, 24, 25, 26, 27, 28, 29, 40
PCLATH ...........................................................................136
PCLATH Register .....................23, 24, 25, 26, 27, 28, 29, 40
PCON Register .....................................................29, 39, 135
PD bit ..................................................................30, 133, 135
PICDEM-1 Low-Cost PIC16/17 Demo Board ...........163, 164
PICDEM-2 Low-Cost PIC16CXX Demo Board .........163, 164
PICDEM-3 Low-Cost PIC16C9XXX Demo Board ............164
PICMASTER In-Circuit Emulator ......................................163
DS30390E-page 275
PIC16C7X
PICSTART Low-Cost Development System .................... 163
PIE1 Register ............................................................... 29, 33
PIE2 Register ............................................................... 29, 37
Pin Compatible Devices ................................................... 271
Pin Functions
MCLR/VPP ...................................................... 13, 14, 15
OSC1/CLKIN .................................................. 13, 14, 15
OSC2/CLKOUT .............................................. 13, 14, 15
RA0/AN0 ........................................................ 13, 14, 15
RA1/AN1 ........................................................ 13, 14, 15
RA2/AN2 ........................................................ 13, 14, 15
RA3/AN3/VREF ............................................... 13, 14, 15
RA4/T0CKI ..................................................... 13, 14, 15
RA5/AN4/SS .................................................. 13, 14, 15
RB0/INT ......................................................... 13, 14, 15
RB1 ................................................................ 13, 14, 15
RB2 ................................................................ 13, 14, 15
RB3 ................................................................ 13, 14, 15
RB4 ................................................................ 13, 14, 15
RB5 ................................................................ 13, 14, 15
RB6 ................................................................ 13, 14, 15
RB7 ................................................................ 13, 14, 15
RC0/T1OSO/T1CKI ....................................... 13, 14, 16
RC1/T1OSI ................................................................ 13
RC1/T1OSI/CCP2 ................................................ 14, 16
RC2/CCP1 ..................................................... 13, 14, 16
RC3/SCK/SCL ............................................... 13, 14, 16
RC4/SDI/SDA ................................................ 13, 14, 16
RC5/SDO ....................................................... 13, 14, 16
RC6 ............................................................................ 13
RC6/TX/CK ............................................ 14, 16, 99114
RC7 ............................................................................ 13
RC7/RX/DT ............................................ 14, 16, 99114
RD0/PSP0 .................................................................. 16
RD1/PSP1 .................................................................. 16
RD2/PSP2 .................................................................. 16
RD3/PSP3 .................................................................. 16
RD4/PSP4 .................................................................. 16
RD5/PSP5 .................................................................. 16
RD6/PSP6 .................................................................. 16
RD7/PSP7 .................................................................. 16
RE0/RD/AN5 .............................................................. 16
RE1/WR/AN6 ............................................................. 16
RE2/CS/AN7 .............................................................. 16
SCK ...................................................................... 8082
SDI ....................................................................... 8082
SDO ..................................................................... 8082
SS ........................................................................ 8082
VDD ................................................................ 13, 14, 16
VSS ................................................................. 13, 14, 16
Pinout Descriptions
PIC16C72 .................................................................. 13
PIC16C73 .................................................................. 14
PIC16C73A ................................................................ 14
PIC16C74 .................................................................. 15
PIC16C74A ................................................................ 15
PIC16C76 .................................................................. 14
PIC16C77 .................................................................. 15
PIR1 Register ..................................................................... 35
PIR2 Register ..................................................................... 38
POP .................................................................................... 40
DS30390E-page 276
R
R/W .............................................................................. 78, 83
R/W bit ............................................................. 90, 94, 95, 96
RBIF bit ...................................................................... 45, 143
RBPU bit ............................................................................ 31
RC Oscillator ............................................................ 132, 135
RCIE bit ............................................................................. 34
RCIF bit .............................................................................. 36
RCREG .............................................................................. 29
RCSTA Register ........................................................ 29, 100
RCV_MODE ...................................................................... 98
RD pin ................................................................................ 54
Read/Write bit Information, R/W .................................. 78, 83
Read-Modify-Write ............................................................. 53
Receive Overflow Detect bit, SSPOV ................................ 79
Receive Overflow Indicator bit, SSPOV ............................. 84
Register File ....................................................................... 20
PIC16C7X
Registers
FSR
Summary ........................................................... 29
INDF
Summary ........................................................... 29
Initialization Conditions ............................................ 136
INTCON
Summary ........................................................... 29
Maps
PIC16C72 .......................................................... 21
PIC16C73 .......................................................... 21
PIC16C73A ........................................................ 21
PIC16C74 .......................................................... 21
PIC16C74A ........................................................ 21
PIC16C76 .......................................................... 22
PIC16C77 .......................................................... 22
OPTION
Summary ........................................................... 29
PCL
Summary ........................................................... 29
PCLATH
Summary ........................................................... 29
PORTB
Summary ........................................................... 29
Reset Conditions ...................................................... 136
SSPBUF
Section ............................................................... 80
SSPCON
Diagram ............................................................. 79
SSPSR
Section ............................................................... 80
SSPSTAT ................................................................... 83
Diagram ............................................................. 78
Section ............................................................... 78
STATUS
Summary ........................................................... 29
Summary .............................................................. 25, 27
TMR0
Summary ........................................................... 29
TRISB
Summary ........................................................... 29
Reset ........................................................................ 129, 133
Reset Conditions for Special Registers ........................... 136
RP0 bit ......................................................................... 20, 30
RP1 bit ............................................................................... 30
RX9 bit ............................................................................. 100
RX9D bit ........................................................................... 100
S
S ................................................................................... 78, 83
SCK .................................................................................... 80
SCL .................................................................................... 94
SDI ..................................................................................... 80
SDO ................................................................................... 80
Serial Communication Interface (SCI) Module, See USART
Services
One-Time-Programmable (OTP) ................................. 7
Quick-Turnaround-Production (QTP) ........................... 7
Serialized Quick-Turnaround Production (SQTP) ........ 7
Slave Mode
SCL ............................................................................ 94
SDA ............................................................................ 94
SLEEP ..................................................................... 129, 133
SMP ................................................................................... 83
Software Simulator (MPSIM) ........................................... 165
SPBRG .............................................................................. 29
DS30390E-page 277
PIC16C7X
Synchronous Serial Port Mode Select bits,
SSPM3:SSPM0 ............................................................ 79, 84
Synchronous Serial Port Module ........................................ 77
Synchronous Serial Port Status Register ........................... 83
T
T0CS bit ............................................................................. 31
T1CKPS0 bit ...................................................................... 65
T1CKPS1 bit ...................................................................... 65
T1CON ............................................................................... 29
T1CON Register ........................................................... 29, 65
T1OSCEN bit ..................................................................... 65
T1SYNC bit ........................................................................ 65
T2CKPS0 bit ...................................................................... 70
T2CKPS1 bit ...................................................................... 70
T2CON Register ........................................................... 29, 70
TAD ................................................................................... 121
Timer Modules, Overview .................................................. 57
Timer0
RTCC ....................................................................... 136
Timers
Timer0
Block Diagram .................................................... 59
External Clock .................................................... 61
External Clock Timing ........................................ 61
Increment Delay ................................................. 61
Interrupt .............................................................. 59
Interrupt Timing .................................................. 60
Overview ............................................................ 57
Prescaler ............................................................ 62
Prescaler Block Diagram ................................... 62
Section ............................................................... 59
Switching Prescaler Assignment ........................ 63
Synchronization ................................................. 61
T0CKI ................................................................. 61
T0IF .................................................................. 143
Timing ................................................................ 59
TMR0 Interrupt ................................................. 143
Timer1
Asynchronous Counter Mode ............................ 67
Block Diagram .................................................... 66
Capacitor Selection ............................................ 67
External Clock Input ........................................... 66
External Clock Input Timing ............................... 67
Operation in Timer Mode ................................... 66
Oscillator ............................................................ 67
Overview ............................................................ 57
Prescaler ...................................................... 66, 68
Resetting of Timer1 Registers ........................... 68
Resetting Timer1 using a CCP Trigger Output .. 68
Synchronized Counter Mode ............................. 66
T1CON ............................................................... 65
TMR1H ............................................................... 67
TMR1L ............................................................... 67
Timer2
Block Diagram .................................................... 69
Module ............................................................... 69
Overview ............................................................ 57
Postscaler .......................................................... 69
Prescaler ............................................................ 69
T2CON ............................................................... 70
Timing Diagrams
A/D Conversion ................................ 182, 200, 218, 239
Brown-out Reset .............................. 134, 175, 209, 228
Capture/Compare/PWM ................... 177, 193, 211, 230
CLKOUT and I/O .............................. 174, 190, 208, 227
DS30390E-page 278
PIC16C7X
U
UA ................................................................................ 78, 83
Universal Synchronous Asynchronous Receiver Transmitter
(USART) ............................................................................ 99
Update Address bit, UA ............................................... 78, 83
USART
Asynchronous Mode ................................................ 106
Asynchronous Receiver ........................................... 108
Asynchronous Reception ......................................... 109
Asynchronous Transmission .................................... 107
Asynchronous Transmitter ....................................... 106
Baud Rate Generator (BRG) .................................... 101
Receive Block Diagram ............................................ 108
Sampling .................................................................. 104
Synchronous Master Mode ...................................... 110
Synchronous Master Reception ............................... 112
Synchronous Master Transmission .......................... 110
Synchronous Slave Mode ........................................ 114
Synchronous Slave Reception ................................. 114
Synchronous Slave Transmit ................................... 114
Transmit Block Diagram ........................................... 106
UV Erasable Devices ........................................................... 7
W
W Register
ALU .............................................................................. 9
Wake-up from SLEEP ...................................................... 145
Watchdog Timer (WDT) ........................... 129, 133, 136, 144
WCOL .......................................................................... 79, 84
WDT ................................................................................. 136
Block Diagram .......................................................... 144
Period ....................................................................... 144
Programming Considerations .................................. 144
Timeout .................................................................... 136
Word ................................................................................ 129
WR pin ............................................................................... 54
Write Collision Detect bit, WCOL ................................. 79, 84
LIST OF EXAMPLES
Example 3-1:
Example 4-1:
Example 4-2:
Example 5-1:
Example 5-2:
Example 5-3:
Example 5-4:
Example 7-1:
Example 7-2:
Example 8-1:
Example 10-1:
Example 10-2:
Example 11-1:
Example 11-2:
Example 12-1:
Equation 13-1:
Example 13-1:
Example 13-2:
Example 13-3:
Example 14-1:
X
XMIT_MODE ...................................................................... 98
Z
Z bit .................................................................................... 30
Zero bit ................................................................................. 9
DS30390E-page 279
PIC16C7X
LIST OF FIGURES
Figure 8-1:
Figure 3-1:
Figure 3-2:
Figure 3-3:
Figure 3-4:
Figure 4-1:
Figure 8-2:
Figure 9-1:
Figure 9-2:
Figure 4-2:
Figure 4-3:
Figure 4-4:
Figure 4-5:
Figure 4-6:
Figure 4-7:
Figure 4-8:
Figure 4-9:
Figure 4-10:
Figure 4-11:
Figure 4-12:
Figure 4-13:
Figure 4-14:
Figure 4-15:
Figure 4-16:
Figure 4-17:
Figure 4-18:
Figure 5-1:
Figure 5-2:
Figure 5-3:
Figure 5-4:
Figure 5-5:
Figure 5-6:
Figure 5-7:
Figure 5-8:
Figure 5-9:
Figure 5-10:
Figure 5-11:
Figure 5-12:
Figure 5-13:
Figure 7-1:
Figure 7-2:
Figure 7-3:
Figure 7-4:
Figure 7-5:
Figure 7-6:
DS30390E-page 280
Figure 10-1:
Figure 10-2:
Figure 10-3:
Figure 10-4:
Figure 10-5:
Figure 11-1:
Figure 11-2:
Figure 11-3:
Figure 11-4:
Figure 11-5:
Figure 11-6:
Figure 11-7:
Figure 11-8:
Figure 11-9:
Figure 11-10:
Figure 11-11:
Figure 11-12:
Figure 11-13:
Figure 11-14:
Figure 11-15:
Figure 11-16:
Figure 11-17:
Figure 11-18:
Figure 11-19:
Figure 11-20:
Figure 11-21:
Figure 11-22:
Figure 11-23:
Figure 11-24:
Figure 11-25:
Figure 11-26:
Figure 11-27:
Figure 12-1:
Figure 12-2:
Figure 12-3:
Figure 12-4:
PIC16C7X
Figure 12-5:
Figure 12-6:
Figure 12-7:
Figure 12-8:
Figure 12-9:
Figure 12-10:
Figure 12-11:
Figure 12-12:
Figure 12-13:
Figure 12-14:
Figure 13-1:
Figure 13-2:
Figure 13-3:
Figure 13-4:
Figure 13-5:
Figure 13-6:
Figure 14-1:
Figure 14-2:
Figure 14-3:
Figure 14-4:
Figure 14-5:
Figure 14-6:
Figure 14-7:
Figure 14-8:
Figure 14-9:
Figure 14-10:
Figure 14-11:
Figure 14-12:
Figure 14-13:
Figure 14-14:
Figure 14-15:
Figure 14-16:
Figure 14-17:
Figure 14-18:
Figure 14-19:
Figure 14-20:
Figure 14-21:
Figure 15-1:
Figure 17-1:
Figure 17-2:
Figure 17-3:
Figure 17-4:
Figure 17-5:
Figure 17-6:
Figure 17-7:
Figure 17-8:
Figure 17-9:
Figure 17-10:
Figure 17-11:
Figure 18-1:
Figure 18-2:
Figure 18-3:
Figure 18-4:
Figure 18-5:
Figure 18-6:
Figure 18-7:
Figure 18-8:
Figure 18-9:
Figure 18-10:
Figure 18-11:
Figure 18-12:
Figure 18-13:
Figure 19-1:
Figure 19-2:
Figure 19-3:
Figure 19-4:
Figure 19-5:
Figure 19-6:
Figure 19-7:
Figure 19-8:
Figure 19-9:
Figure 19-10:
Figure 19-11:
Figure 19-12:
Figure 19-13:
Figure 19-14:
Figure 20-1:
Figure 20-2:
Figure 20-3:
Figure 20-4:
Figure 20-5:
Figure 20-6:
Figure 20-7:
Figure 20-8:
DS30390E-page 281
PIC16C7X
Figure 20-9:
Figure 20-10:
Figure 20-11:
Figure 20-12:
Figure 20-13:
Figure 20-14:
Figure 20-15:
Figure 20-16:
Figure 20-17:
Figure 21-1:
Figure 21-2:
Figure 21-3:
Figure 21-4:
Figure 21-5:
Figure 21-6:
Figure 21-7:
Figure 21-8:
Figure 21-9:
Figure 21-10:
Figure 21-11:
Figure 21-12:
Figure 21-13:
Figure 21-14:
Figure 21-15:
Figure 21-16:
Figure 21-17:
Figure 21-18:
Figure 21-19:
Figure 21-20:
Figure 21-21:
Figure 21-22:
Figure 21-23:
Figure 21-24:
Figure 21-25:
Figure 21-26:
DS30390E-page 282
Figure 21-27:
Figure 21-28:
Figure 21-29:
Figure 21-30:
PIC16C7X
LIST OF TABLES
Table 12-8:
Table 1-1:
Table 3-1:
Table 3-2:
Table 3-3:
Table 4-1:
Table 12-9:
Table 4-2:
Table 4-3:
Table 5-1:
Table 5-2:
Table 5-3:
Table 5-4:
Table 5-5:
Table 5-6:
Table 5-7:
Table 5-8:
Table 5-9:
Table 5-10:
Table 5-11:
Table 7-1:
Table 8-1:
Table 8-2:
Table 9-1:
Table 10-1:
Table 10-2:
Table 10-3:
Table 10-4:
Table 10-5:
Table 11-1:
Table 11-2:
Table 11-3:
Table 11-4:
Table 11-5:
Table 12-1:
Table 12-2:
Table 12-3:
Table 12-4:
Table 12-5:
Table 12-6:
Table 12-7:
Table 12-10:
Table 12-11:
Table 13-1:
Table 13-2:
Table 13-3:
Table 14-1:
Table 14-2:
Table 14-3:
Table 14-4:
Table 14-5:
Table 14-6:
Table 14-7:
Table 14-8:
Table 15-1:
Table 15-2:
Table 16-1:
Table 17-1:
Table 17-2:
Table 17-3:
Table 17-4:
Table 17-5:
Table 17-6:
Table 17-7:
Table 17-8:
Table 17-9:
Table 17-10:
Table 17-11:
Table 18-1:
DS30390E-page 283
PIC16C7X
Table 18-2:
Table 18-3:
Table 18-4:
Table 18-5:
Table 18-6:
Table 18-7:
Table 18-8:
Table 18-9:
Table 18-10:
Table 18-11:
Table 18-12:
Table 18-13:
Table 18-14:
Table 19-1:
Table 19-2:
Table 19-3:
Table 19-4:
Table 19-5:
Table 19-6:
Table 19-7:
Table 19-8:
Table 19-9:
Table 19-10:
Table 19-11:
Table 19-12:
Table 19-13:
Table 19-14:
DS30390E-page 284
Table 20-1:
Table 20-2:
Table 20-3:
Table 20-4:
Table 20-5:
Table 20-6:
Table 20-7:
Table 20-8:
Table 20-9:
Table 20-10:
Table 20-11:
Table 20-12:
Table 20-13:
Table 20-14:
Table 21-1:
Table 21-2:
Table E-1:
PIC16C6X
ON-LINE SUPPORT
Microchip provides two methods of on-line support.
These are the Microchip BBS and the Microchip World
Wide Web (WWW) site.
Use Microchip's Bulletin Board Service (BBS) to get
current information and help about Microchip products.
Microchip provides the BBS communication channel
for you to use in extending your technical staff with
microcontroller and memory experts.
To provide you with the most responsive service possible,
the Microchip systems team monitors the BBS, posts
the latest component data and software tool updates,
provides technical help and embedded systems
insights, and discusses how Microchip products provide project solutions.
The web site, like the BBS, is used by Microchip as a
means to make files and information easily available to
customers. To view the site, the user must have access
to the Internet and a web browser, such as Netscape or
Microsoft Explorer. Files are also available for FTP
download from our FTP site.
ftp://ftp.futureone.com/pub/microchip
The web site and file transfer site provide a variety of
services. Users may download files for the latest
Development Tools, Data Sheets, Application Notes,
User's Guides, Articles and Sample Programs. A variety of Microchip specific business information is also
available, including listings of Microchip sales offices,
distributors and factory representatives. Other data
available for consideration is:
Latest Microchip Press Releases
Technical Support Section with Frequently Asked
Questions
Design Tips
Device Errata
Job Postings
Microchip Consultant Program Member Listing
Links to other useful web sites related to
Microchip Products
Internet:
You can telnet or ftp to the Microchip BBS at the
address: mchipbbs.microchip.com
DS30390E-page 285
PIC16C6X
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation
can better serve you, please FAX your comments to the Technical Publications Manager at (602) 786-7578.
Please list the following information, and use this outline to provide us with your comments about this Data Sheet.
To:
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
Device: PIC16C6X
N
Literature Number: DS30390E
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
DS30390E-page 286
PIC16C7X
PIC16C7X PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery refer to the factory or the listed sales office.
Examples
Temperature
Range:
Frequency
Range:
Device
* JW Devices are UV erasable and can be programmed to any device configuration. JW Devices meet the electrical requirement of
each oscillator type (including LC devices).
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
For latest version information and upgrade kits for Microchip Development Tools, please call 1-800-755-2345 or 1-602-786-7302.
DS30390E-page 287
ASIA/PACIFIC
EUROPE
Corporate Office
Hong Kong
United Kingdom
Atlanta
India
Boston
Korea
Germany
Shanghai
Chicago
Microchip Technology Inc.
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 708-285-0071 Fax: 708-285-0075
Dallas
Microchip Technology Inc.
14651 Dallas Parkway, Suite 816
Dallas, TX 75240-8809
Tel: 972-991-7177 Fax: 972-991-8588
Dayton
Microchip Technology Inc.
Two Prestige Place, Suite 150
Miamisburg, OH 45342
Tel: 937-291-1654 Fax: 937-291-9175
Microchip Technology
RM 406 Shanghai Golden Bridge Bldg.
2077 Yanan Road West, Hongiao District
Shanghai, PRC 200335
Tel: 86-21-6275-5700
Fax: 86 21-6275-5060
Singapore
Microchip Technology Taiwan
Singapore Branch
200 Middle Road
#10-03 Prime Centre
Singapore 188980
Tel: 65-334-8870 Fax: 65-334-8850
Taiwan, R.O.C
Los Angeles
Microchip Technology Inc.
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 714-263-1888 Fax: 714-263-1338
New York
France
Italy
JAPAN
Microchip Technology Intl. Inc.
Benex S-1 6F
3-18-20, Shin Yokohama
Kohoku-Ku, Yokohama
Kanagawa 222 Japan
Tel: 81-4-5471- 6166 Fax: 81-4-5471-6122
1/14/97
San Jose
Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131
Tel: 408-436-7950 Fax: 408-436-7955
Toronto
Microchip Technology Inc.
5925 Airport Road, Suite 200
Mississauga, Ontario L4V 1W1, Canada
Tel: 905-405-6279 Fax: 905-405-6253
DS30390E-page 288