Professional Documents
Culture Documents
Memory
Clocking Structure
16 MHz Internal Oscillator Block:
- 1% at calibration
- Selectable frequency range from 0 to 32 MHz
31 kHz Low-Power Internal Oscillator
Operating Characteristics
Programming/Debug Features
Digital Peripherals
Capture/Compare/PWM (CCP) module
Serial Communications:
- SPI, I2C
Up to 18 I/O Pins and One Input Pin:
- Individually programmable weak pull-ups
- Slew rate control
- Interrupt-on-change with edge-select
Peripheral Pin Select (PPS):
- Enables pin mapping of digital I/O
DS40001722C-page 1
PIC16(L)F1703/7
Device
Program Memory
Flash (words)
Data SRAM
(bytes)
High-Endurance
Flash (bytes)
I/Os(2)
8-bit DAC
High-Speed/
Comparators
Op Amp
Zero Cross
Timers
(8/16-bit)
CCP
PWM
COG
EUSART
MSSP (I2C/SPI)
CLC
PPS
Debug(1)
XLP
PIC16(L)F1703
(3)
2048
256
128
12
2/1
I/E
PIC16(L)F1704
(1)
4096
512
128
12
4/1
I/E
PIC16(L)F1705
(2)
8192
1024
128
12
4/1
I/E
PIC16(L)F1707
(3)
2048
256
128
18
12
2/1
I/E
PIC16(L)F1708
(1)
4096
512
128
18
12
4/1
I/E
PIC16(L)F1709
(2)
8192
1024
128
18
12
4/1
I/E
Note 1:
2:
Debugging Methods: (I) Integrated on Chip; (H) using Debug Header; E using Emulation Header.
One pin is input-only.
Note:
For other small form-factor package availability and marking information, please visit
http://www.microchip.com/packaging or contact your local sales office.
DS40001722C-page 2
PIC16(L)F1703/7
Pin Diagrams
FIGURE 1:
VDD
RA5
RA4
VPP/MCLR/RA3
RC5
RC4
RC3
FIGURE 2:
1
2
3
4
5
6
7
PIC16(L)F1703
14
13
12
11
10
9
8
VSS
RA0/ICSPDAT
RA1/ICSPCLK
RA2
RC0
RC1
RC2
16 VDD
15 NC
14 NC
13 VSS
QFN
1
12 RA0/ICSPDAT
2
11 RA1/ICSPCLK
3 PIC16(L)F1703 10 RA2
4
9 RC0
RC4
RC3
RC2
RC1
5
6
7
8
RA5
RA4
RA3/MCLR/VPP
RC5
DS40001722C-page 3
PIC16(L)F1703/7
FIGURE 3:
20
VSS
19
RA4
18
RA1/ICSPCLK
VPP/MCLR/RA3
17
RA2
RC5
16
RC0
15
RC1
14
RC2
13
RB4
12
RB5
10
11
RB6
RC3
RC6
RC7
RB7
6
7
8
PIC16(L)F1707
RA5
RA0/ICSPDAT
RC4
FIGURE 4:
20
19
18
17
16
RA4
RA5
VDD
VSS
RA0/ICSPDAT
QFN
1
15 RA1/ICSPCLK
2
14 RA2
3 PIC16(L)F1707 13 RC0
4
12 RC1
5
11 RC2
RC7
RB7
RB6
RB5
RB4
6
7
8
9
10
VPP/MCLR/RA3
RC5
RC4
RC3
RC6
DS40001722C-page 4
PIC16(L)F1703/7
ADC
Reference
Op Amp
Zero Cross
MSSP
Interrupt
Pull-up
Basic
13
12
AN0
VREF-
IOC
ICSPDAT
RA1
12
11
AN1
VREF+
IOC
ICSPCLK
RA2
11
10
AN2
ZCD
T0CKI(1)
INT(1)
IOC
RA3
IOC
MCLR
VPP
RA4
AN3
T1G(1)
IOC
CLKOUT
RA5
T1CKI(1)
IOC
CLKIN
RC0
10
AN4
SCK(1)
IOC
OPA1IN+
CCP
QFN
RA0
Timers
PDIP/SOIC/TSSOP
I/O(2)
TABLE 1:
SCL(3)
RC1
AN5
OPA1IN-
SDI(1)
SDA(3)
IOC
RC2
AN6
OPA1OUT
IOC
SS(1)
RC3
AN7
OPA2OUT
CCP2(1)
IOC
RC4
OPA2IN-
IOC
RC5
OPA2IN+
CCP1(1)
IOC
VDD
16
VDD
VSS
14
13
VSS
OUT(2)
Note 1:
2:
3:
(3)
CCP1
SDA
CCP2
SCL(3)
SCK
SDO
Default peripheral input. Input can be moved to any other pin with the PPS input selection registers.
All pin digital outputs default to PORT latch data. Any pin can be selected as a peripheral digital output with the PPS
output selection registers.
These peripheral functions are bidirectional. The output pin selections must be the same as the input pin selections.
DS40001722C-page 5
PIC16(L)F1703/7
Zero Cross
Timers
MSSP
Interrupt
Pull-up
Basic
16
AN0
VREF-
IOC
ICSPDAT
18
15
AN1
VREF+
IOC
ICSPCLK
RA2
17
14
AN2
ZCD
RA3
RA4
20
AN3
RA5
19
RB4
13
10
AN10
RB5
12
AN11
RB6
11
CCP
ADC
19
RA1
Op Amp
QFN
RA0
Reference
PDIP/SOIC/
SSOP
I/O(2)
TABLE 2:
(1)
T0CKI
(1)
INT
IOC
IOC
MCLR
VPP
T1G(1)
IOC
CLKOUT
T1CKI
IOC
CLKIN
OPA1IN-
SCK(1)
SDA(3)
IOC
OPA1IN+
IOC
SDI(1)
SCL(3)
IOC
RB7
10
IOC
RC0
16
13
AN4
IOC
RC1
15
12
AN5
IOC
RC2
14
11
AN6
OPA1OUT
IOC
RC3
AN7
OPA2OUT
CCP2(1)
IOC
RC4
IOC
RC5
RC6
AN8
OPA2IN-
RC7
AN9
OPA2IN+
VDD
18
VSS
20
17
OUT(2)
Note 1:
2:
3:
CCP1
(1)
IOC
SS(1)
IOC
IOC
VDD
VSS
CPP1
SDA(3)
CPP2
SCL(3)
SCK
SDO
Default peripheral input. Input can be moved to any other pin with the PPS input selection registers.
All pin digital outputs default to PORT latch data. Any pin can be selected as a peripheral digital output with the PPS
output selection registers.
These peripheral functions are bidirectional. The output pin selections must be the same as the input pin selections.
DS40001722C-page 6
PIC16(L)F1703/7
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 9
2.0 Enhanced Mid-Range CPU ........................................................................................................................................................ 15
3.0 Memory Organization ................................................................................................................................................................. 17
4.0 Device Configuration .................................................................................................................................................................. 48
5.0 Resets ........................................................................................................................................................................................ 53
6.0 Oscillator Module (with Fail-Safe Clock Monitor) ....................................................................................................................... 61
7.0 Interrupts .................................................................................................................................................................................... 72
8.0 Power-Down Mode (Sleep) ........................................................................................................................................................ 85
9.0 Watchdog Timer (WDT) ............................................................................................................................................................. 89
10.0 Flash Program Memory Control ................................................................................................................................................. 94
11.0 I/O Ports ................................................................................................................................................................................... 110
12.0 Peripheral Pin Select (PPS) Module ........................................................................................................................................ 128
13.0 Interrupt-On-Change ................................................................................................................................................................ 135
14.0 Fixed Voltage Reference (FVR) .............................................................................................................................................. 141
15.0 Temperature Indicator Module ................................................................................................................................................. 143
16.0 Analog-to-Digital Converter (ADC) Module .............................................................................................................................. 145
17.0 Operational Amplifier (OPA) Modules ...................................................................................................................................... 159
18.0 Zero-Cross Detection (ZCD) Module........................................................................................................................................ 162
19.0 Timer0 Module ......................................................................................................................................................................... 166
20.0 Timer1 Module with Gate Control............................................................................................................................................. 169
21.0 Timer2 Module ......................................................................................................................................................................... 180
22.0 Capture/Compare/PWM Modules ............................................................................................................................................ 184
23.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 194
24.0 In-Circuit Serial Programming (ICSP) ............................................................................................................................... 249
25.0 Instruction Set Summary .......................................................................................................................................................... 251
26.0 Electrical Specifications............................................................................................................................................................ 265
27.0 DC and AC Characteristics Graphs and Charts ....................................................................................................................... 293
28.0 Development Support............................................................................................................................................................... 310
29.0 Packaging Information.............................................................................................................................................................. 314
The Microchip Web Site ..................................................................................................................................................................... 335
Customer Change Notification Service .............................................................................................................................................. 335
Customer Support .............................................................................................................................................................................. 335
Product Identification System ............................................................................................................................................................ 336
DS40001722C-page 7
PIC16(L)F1703/7
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at docerrors@microchip.com. We welcome your feedback.
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
DS40001722C-page 8
PIC16(L)F1703/7
1.0
DEVICE OVERVIEW
Peripheral
PIC16(L)F1707
DEVICE PERIPHERAL
SUMMARY
PIC16(L)F1703
TABLE 1-1:
Temperature Indicator
CCP2
MSSP
Op Amp 1
Op Amp 2
Timer0
Timer1
Timer2
Timers
DS40001722C-page 9
PIC16(L)F1703/7
FIGURE 1-1:
Program
Flash Memory
RAM
PORTA
PORTB(1)
CLKOUT
Timing
Generation
HFINTOSC/
LFINTOSC
Oscillator
CLKIN
PORTC
CPU
Figure 2-1
MCLR
ZCD
Op Amps
Timer0
Temp.
Indicator
Note
1:
2:
DS40001722C-page 10
ADC
10-Bit
Timer1
FVR
Timer2
MSSP
CCPs
PIC16(L)F1707 only.
See applicable chapters for more information on peripherals.
PIC16(L)F1703/7
TABLE 1-2:
Function
RA0/AN0/VREF-/ICSPDAT
RA0
Input
Type
AN
VREF-
AN
ICSPDAT
ST
RA1
Description
AN0
RA1/AN1/VREF+/ICSPCLK
Output
Type
AN1
AN
VREF+
AN
ICSPCLK
ST
RA2/AN2/ZCD/T0CKI(1)/INT(1)
RA2
AN2
RA3/MCLR/VPP
RA4/AN3/T1G(1)/CLKOUT
ZCD
AN
T0CKI
TTL/ST
INT
TTL/ST
External interrupt.
RA3
MCLR
ST
VPP
HV
Programming voltage.
AN3
AN
T1G
TTL/ST
CLKOUT
RA5
T1CKI
CLKIN
RC0/AN4/OPA1IN+/SCK(1)/SCL(3)
AN
RA4
RA5/T1CKI(1)/CLKIN
RC0
TTL/ST
AN4
AN
OPA1IN+
AN
SCK
ST
SPI clock.
SCL
I2C
I2C clock.
RC1/AN5/OPA1IN-/SDI(1)/SDA(3)
RC1
AN5
OPA1IN-
AN
SDI
CMOS
SDA
I2C
RC2/AN6/OPA1OUT
RC2
AN6
AN
OPA1OUT
AN
DS40001722C-page 11
PIC16(L)F1703/7
TABLE 1-2:
Function
RC3/AN7/OPA2OUT/CCP2(1)/SS(1)
RC3
RC4/OPA2IN-
VDD
VSS
OUT(2)
Output
Type
Description
AN7
AN
OPA2OUT
AN
CCP2
TTL/ST
Capture/Compare/PWM2.
SS
TTL/ST
RC4
OPA2IN-
RC5/OPA2IN+/CCP1(1)
Input
Type
RC5
OPA2IN+
AN
CCP1
TTL/ST
Capture/Compare/PWM1.
VDD
Power
Positive supply.
VSS
Power
Ground reference.
CCP1
CCP2
SDA(3)
OD
SDO
SCK
SCL(3)
OD
DS40001722C-page 12
PIC16(L)F1703/7
TABLE 1-3:
Name
RA0/AN0/VREF-/ICSPDAT
RA1/AN1/VREF+/ICSPCLK
RA2/AN2/ZCD/
T0CKI(1)/INT(1)
Function
RA0
AN
VREF-
AN
ICSPDAT
ST
RA1
RA4/AN3/T1G(1)/CLKOUT
RA5/T1CKI/CLKIN
VREF+
AN
ST
RA2
AN2
ZCD
AN
T0CKI
ST
ST
External interrupt.
RA3
MCLR
ST
VPP
HV
Programming voltage.
RA4
AN3
AN
T1G
ST
CLKOUT
RA5
RB4
ST
AN10
AN
OPA1IN-
AN
SCK
ST
SDA
I2C
RB5
OPA1IN+
RB7
ICSPCLK
AN11
RB6/SDI(1)/SCL(3)
AN
CLKIN
RB5/AN11/OPA1IN+
Description
AN1
T1CKI
RB4/AN10/OPA1IN-/SCK(1)/
SDA(3)
Output
Type
AN0
INT
RA3/MCLR/VPP
Input
Type
AN
RB6
SDI
CMOS
SCL
I2C
OD
I2C clock.
RB7
DS40001722C-page 13
PIC16(L)F1703/7
TABLE 1-3:
Name
Function
RC0/AN4
RC0
RC1/AN5
RC1
RC2/AN6/OPA1OUT
RC2
AN4
AN5
RC3/AN7/OPA2OUT/CCP2(1)
Input
Type
Output
Type
Description
AN6
AN
OPA1OUT
AN
RC3
AN7
OPA2OUT
CCP2
ST
AN
CMOS Capture/Compare/PWM2.
RC4
RC4
RC5/CCP1(1)
RC5
CCP1
RC6/AN8/OPA2IN-/SS(1)
RC6
CMOS Capture/Compare/PWM1.
AN8
AN
OPA2IN-
AN
ST
SS
RC7/AN9/OPA2IN+
ST
RC7
AN9
AN
OPA2IN+
AN
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
CCP1
CCP2
(3)
OUT(2)
SDA
OD
SDO
SCK
SCL(3)
I2C
OD
DS40001722C-page 14
PIC16(L)F1703/7
2.0
FIGURE 2-1:
15
Configuration
15
MUX
Flash
Program
Memory
Program
Bus
16-Level
8 Level Stack
Stack
(13-bit)
(15-bit)
14
Instruction
Instruction Reg
reg
Data Bus
Program Counter
RAM
Program Memory
Read (PMR)
12
RAM Addr
Addr MUX
Direct Addr 7
5
Indirect
Addr
12
12
BSR
FSR Reg
reg
15
FSR0reg
Reg
FSR
FSR1
Reg
FSR reg
15
STATUS Reg
reg
STATUS
8
3
Power-up
Timer
CLKIN
CLKOUT
Instruction
Decodeand
&
Decode
Control
Timing
Generation
Oscillator
Start-up Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
MUX
ALU
8
W reg
Internal
Oscillator
Block
VDD
VSS
DS40001722C-page 15
PIC16(L)F1703/7
2.1
2.2
2.3
2.4
Instruction Set
DS40001722C-page 16
PIC16(L)F1703/7
3.0
MEMORY ORGANIZATION
3.2
High-Endurance Flash
3.1
TABLE 3-1:
Device
Program Memory
Space (Words)
High-Endurance Flash
Memory Address Range (1)
2,048
07FFh
0780h-07FFh
PIC16(L)F1703/7
Note 1: High-endurance Flash applies to low byte of each address in the range.
DS40001722C-page 17
PIC16(L)F1703/7
FIGURE 3-1:
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
15
3.2.1.1
RETLW Instruction
Stack Level 0
Stack Level 1
Stack Level 15
EXAMPLE 3-1:
Reset Vector
0000h
Interrupt Vector
0004h
0005h
On-chip
Program
Memory
3.2.1
Page 0
07FFh
0800h
constants
BRW
RETLW
RETLW
RETLW
RETLW
DATA0
DATA1
DATA2
DATA3
RETLW INSTRUCTION
;Add Index in W to
;program counter to
;select data
;Index0 data
;Index1 data
my_function
; LOTS OF CODE
MOVLW
DATA_INDEX
call constants
; THE CONSTANT IS IN W
3.2.1.2
Rollover to Page 1
7FFFh
DS40001722C-page 18
PIC16(L)F1703/7
EXAMPLE 3-2:
ACCESSING PROGRAM
MEMORY VIA FSR
constants
RETLW DATA0
;Index0 data
RETLW DATA1
;Index1 data
RETLW DATA2
RETLW DATA3
my_function
; LOTS OF CODE
MOVLW
LOW constants
MOVWF
FSR1L
MOVLW
HIGH constants
MOVWF
FSR1H
MOVIW
0[FSR1]
;THE PROGRAM MEMORY IS IN W
DS40001722C-page 19
PIC16(L)F1703/7
3.3
12 core registers
20 Special Function Registers (SFR)
Up to 80 bytes of General Purpose RAM (GPR)
16 bytes of common RAM
DS40001722C-page 20
3.3.1
CORE REGISTERS
TABLE 3-2:
CORE REGISTERS
Addresses
BANKx
x00h or x80h
x01h or x81h
x02h or x82h
x03h or x83h
x04h or x84h
x05h or x85h
x06h or x86h
x07h or x87h
x08h or x88h
x09h or x89h
x0Ah or x8Ah
x0Bh or x8Bh
INDF0
INDF1
PCL
STATUS
FSR0L
FSR0H
FSR1L
FSR1H
BSR
WREG
PCLATH
INTCON
PIC16(L)F1703/7
3.3.1.1
STATUS Register
3.4
REGISTER 3-1:
U-0
U-0
U-0
R-1/q
R-1/q
R/W-0/u
R/W-0/u
R/W-0/u
TO
PD
DC(1)
C(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
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/Digit Borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)(1)
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
Note 1:
For Borrow, the polarity is reversed. A subtraction is executed by adding the twos complement of the
second operand.
DS40001722C-page 21
PIC16(L)F1703/7
3.4.1
3.4.2
FIGURE 3-2:
0Bh
0Ch
Core Registers
(12 bytes)
3.4.3
Memory Region
00h
3.4.2.1
BANKED MEMORY
PARTITIONING
COMMON RAM
6Fh
70h
Common RAM
(16 bytes)
7Fh
3.4.4
DS40001722C-page 22
TABLE 3-3:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
PORTA
PORTB
PORTC
PIR1
PIR2
PIR3
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
020h
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
09Fh
BANK 3
180h
Core Registers
(Table 3-2)
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
LATA
LATB
LATC
BORCON
FVRCON
ZCD1CON
120h
General Purpose
Register
80 Bytes
General Purpose
Register
80 Bytes
BANK 4
200h
Core Registers
(Table 3-2)
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
Core Registers
(Table 3-2)
ANSELA
ANSELB
ANSELC
PMADR
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
16Fh
1EFh
26Fh
0F0h
170h
1F0h
270h
Accesses
70h - 7Fh
0FFh
Accesses
70h - 7Fh
17Fh
Accesses
70h - 7Fh
1FFh
WPUA
WPUB
WPUC
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON1
SSP1CON2
SSP1CON3
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
27Fh
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
2FFh
SLRCONA
SLRCONB
SLRCONC
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
36Fh
370h
Accesses
70h - 7Fh
Unimplemented
3EFh
3F0h
Accesses
70h - 7Fh
37Fh
INLVLA
INLVLB
INLVLC
IOCAP
IOCAN
IOCAF
IOCBP
IOCBN
IOCBF
IOCCP
IOCCN
IOCCF
3A0h
Unimplemented
Unimplemented
2F0h
BANK 7
380h
Core Registers
(Table 3-2)
ODCONA
ODCONB
ODCONC
CCPR1L
CCPR1H
CCP1CON
CCPR2
CCPR2L
CCPR2H
CCP2CON
2EFh
Accesses
70h - 7Fh
BANK 6
300h
Core Registers
(Table 3-2)
Unimplemented
Unimplemented
0EFh
Common RAM
70h - 7Fh
BANK 5
280h
Accesses
70h - 7Fh
3FFh
DS40001722C-page 23
PIC16(L)F1703/7
General Purpose
Register
80 Bytes
07Fh
TRISA
TRISB
TRISC
PIE1
PIE2
PIE3
OPTION_REG
PCON
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
ADCON0
ADCON1
ADCON2
0A0h
06Fh
070h
BANK 2
100h
BANK 8
400h
BANK 9
480h
Core Registers
(Table 3-2)
40Bh
40Ch
40Dh
40Eh
40Fh
410h
411h
412h
413h
414h
415h
416h
417h
418h
419h
41Ah
41Bh
41Ch
41Dh
41Eh
41Fh
420h
Core Registers
(Table 3-2)
48Bh
48Ch
48Dh
48Eh
48Fh
490h
491h
492h
493h
494h
495h
496h
497h
498h
499h
49Ah
49Bh
49Ch
49Dh
49Eh
49Fh
4A0h
4EFh
4F0h
Accesses
70h - 7Fh
47Fh
50Bh
50Ch
50Dh
50Eh
50Fh
510h
511h
512h
513h
514h
515h
516h
517h
518h
519h
51Ah
51Bh
51Ch
51Dh
51Eh
51Fh
520h
OPA1CON
OPA2CON
56Fh
570h
58Bh
58Ch
58Dh
58Eh
58Fh
590h
591h
592h
593h
594h
595h
596h
597h
598h
599h
59Ah
59Bh
59Ch
59Dh
59Eh
59Fh
5A0h
5EFh
5F0h
60Bh
60Ch
60Dh
60Eh
60Fh
610h
611h
612h
613h
614h
615h
616h
617h
618h
619h
61Ah
61Bh
61Ch
61Dh
61Eh
61Fh
620h
66Fh
670h
68Bh
68Ch
68Dh
68Eh
68Fh
690h
691h
692h
693h
694h
695h
696h
697h
698h
699h
69Ah
69Bh
69Ch
69Dh
69Eh
69Fh
6A0h
6EFh
6F0h
70Bh
70Ch
70Dh
70Eh
70Fh
710h
711h
712h
713h
714h
715h
716h
717h
718h
719h
71Ah
71Bh
71Ch
71Dh
71Eh
71Fh
720h
Core Registers
(Table 3-2)
78Bh
78Ch
78Dh
78Eh
78Fh
790h
791h
792h
793h
794h
795h
796h
797h
798h
799h
79Ah
79Bh
79Ch
79Dh
79Eh
79Fh
7A0h
Unimplemented
76Fh
770h
Accesses
70h - 7Fh
6FFh
BANK 15
780h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
67Fh
BANK 14
700h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
5FFh
BANK 13
680h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
57Fh
BANK 12
600h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
4FFh
BANK 11
580h
Core Registers
(Table 3-2)
Unimplemented
Unimplemented
46Fh
470h
BANK 10
500h
Unimplemented
7EFh
7F0h
Accesses
70h - 7Fh
77Fh
Accesses
70h - 7Fh
7FFh
PIC16(L)F1703/7
DS40001722C-page 24
TABLE 3-4:
TABLE 3-5:
BANK 16
800h
BANK 17
80Bh
80Ch
80Dh
80Eh
80Fh
810h
811h
812h
813h
814h
815h
816h
817h
818h
819h
81Ah
81Bh
81Ch
81Dh
81Eh
81Fh
820h
Core Registers
(Table 3-2)
88Bh
88Ch
88Dh
88Eh
88Fh
890h
891h
892h
893h
894h
895h
896h
897h
898h
899h
89Ah
89Bh
89Ch
89Dh
89Eh
89Fh
8A0h
Unimplemented
90Bh
90Ch
90Dh
90Eh
90Fh
910h
911h
912h
913h
914h
915h
916h
917h
918h
919h
91Ah
91Bh
91Ch
91Dh
91Eh
91Fh
920h
Unimplemented
8EFh
8F0h
Accesses
70h - 7Fh
87Fh
Core Registers
(Table 3-2)
98Bh
98Ch
98Dh
98Eh
98Fh
990h
991h
992h
993h
994h
995h
996h
997h
998h
999h
99Ah
99Bh
99Ch
99Dh
99Eh
99Fh
9A0h
Core Registers
(Table 3-2)
A0Bh
A0Ch
A0Dh
A0Eh
A0Fh
A10h
A11h
A12h
A13h
A14h
A15h
A16h
A17h
A18h
A19h
A1Ah
A1Bh
A1Ch
A1Dh
A1Eh
A1Fh
A20h
Unimplemented
9EFh
9F0h
96Fh
970h
Accesses
70h - 7Fh
97Fh
A8Bh
A8Ch
A8Dh
A8Eh
A8Fh
A90h
A91h
A92h
A93h
A94h
A95h
A96h
A97h
A98h
A99h
A9Ah
A9Bh
A9Ch
A9Dh
A9Eh
A9Fh
AA0h
Core Registers
(Table 3-2)
B0Bh
B0Ch
B0Dh
B0Eh
B0Fh
B10h
B11h
B12h
B13h
B14h
B15h
B16h
B17h
B18h
B19h
B1Ah
B1Bh
B1Ch
B1Dh
B1Eh
B1Fh
B20h
Unimplemented
Accesses
70h - 7Fh
A7Fh
Core Registers
(Table 3-2)
B8Bh
B8Ch
B8Dh
B8Eh
B8Fh
B90h
B91h
B92h
B93h
B94h
B95h
B96h
B97h
B98h
B99h
B9Ah
B9Bh
B9Ch
B9Dh
B9Eh
B9Fh
BA0h
Unimplemented
Unimplemented
Accesses
70h - 7Fh
B7Fh
BEFh
BF0h
B6Fh
B70h
Accesses
70h - 7Fh
AFFh
BANK 23
B80h
B00h
AEFh
AF0h
A6Fh
A70h
BANK 22
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
9FFh
BANK 21
A80h
A00h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
8FFh
BANK 20
Accesses
70h - 7Fh
BFFh
DS40001722C-page 25
PIC16(L)F1703/7
86Fh
870h
BANK 19
980h
900h
880h
Core Registers
(Table 3-2)
BANK 18
BANK 24
C00h
BANK 25
C80h
Core Registers
(Table 3-2)
C0Bh
C0Ch
C0Dh
C0Eh
C0Fh
C10h
C11h
C12h
C13h
C14h
C15h
C16h
C17h
C18h
C19h
C1Ah
C1Bh
C1Ch
C1Dh
C1Eh
C1Fh
C20h
Core Registers
(Table 3-2)
C8Bh
C8Ch
C8Dh
C8Eh
C8Fh
C90h
C91h
C92h
C93h
C94h
C95h
C96h
C97h
C98h
C99h
C9Ah
C9Bh
C9Ch
C9Dh
C9Eh
C9Fh
CA0h
Unimplemented
C6Fh
C70h
CEFh
CF0h
D0Bh
D0Ch
D0Dh
D0Eh
D0Fh
D10h
D11h
D12h
D13h
D14h
D15h
D16h
D17h
D18h
D19h
D1Ah
D1Bh
D1Ch
D1Dh
D1Eh
D1Fh
D20h
D6Fh
D70h
D8Bh
D8Ch
D8Dh
D8Eh
D8Fh
D90h
D91h
D92h
D93h
D94h
D95h
D96h
D97h
D98h
D99h
D9Ah
D9Bh
D9Ch
D9Dh
D9Eh
D9Fh
DA0h
BANK 29
E80h
Core Registers
(Table 3-2)
BANK 30
F00h
Core Registers
(Table 3-2)
BANK 31
F80h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
E0Bh
E0Ch
E0Dh
E0Eh
E0Fh
E10h
E11h
E12h
E13h
E14h
E15h
E16h
E17h
See Table 3-7 for
E18h
register mapping
E19h
details
E1Ah
E1Bh
E1Ch
E1Dh
E1Eh
E1Fh
E20h
E8Bh
E8Ch
E8Dh
E8Eh
E8Fh
E90h
E91h
E92h
E93h
E94h
E95h
E96h
E97h
See Table 3-7 for
E98h
register mapping
E99h
details
E9Ah
E9Bh
E9Ch
E9Dh
E9Eh
E9Fh
EA0h
F0Bh
F0Ch
F0Dh
F0Eh
F0Fh
F10h
F11h
F12h
F13h
F14h
F15h
F16h
F17h
See Table 3-7 for
F18h
register mapping
F19h
details
F1Ah
F1Bh
F1Ch
F1Dh
F1Eh
F1Fh
F20h
F8Bh
F8Ch
F8Dh
F8Eh
F8Fh
F90h
F91h
F92h
F93h
F94h
F95h
F96h
F97h
See Table 3-8 for
F98h
register mapping
F99h
details
F9Ah
F9Bh
F9Ch
F9Dh
F9Eh
F9Fh
FA0h
E6Fh
E70h
EEFh
EF0h
F6Fh
F70h
FEFh
FF0h
Unimplemented
DEFh
DF0h
Accesses
70h - 7Fh
D7Fh
BANK 28
E00h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
CFFh
BANK 27
D80h
Core Registers
(Table 3-2)
Unimplemented
Accesses
70h - 7Fh
C7Fh
BANK 26
D00h
Accesses
70h - 7Fh
DFFh
Accesses
70h - 7Fh
E7Fh
Accesses
70h - 7Fh
EFFh
Accesses
70h - 7Fh
F7Fh
Accesses
70h - 7Fh
FFFh
PIC16(L)F1703/7
DS40001722C-page 26
TABLE 3-6:
PIC16(L)F1703/7
TABLE 3-7:
PPSLOCK
INTPPS
T0CKIPPS
T1CKIPPS
T1GPPS
CCP1PPS
CCP2PPS
SSPCLKPPS
SSPDATPPS
SSPSSPPS
Bank 29
E8Ch
E8Dh
E8Eh
E8Fh
E90h
E91h
E92h
E93h
E94h
E95h
E96h
E97h
E98h
E99h
E9Ah
E9Bh
E9Ch
E9Dh
E9Eh
E9Fh
EA0h
EA1h
EA2h
EA3h
EA4h
EA5h
EA6h
EA7h
EA8h
EA9h
EAAh
EABh
EACh
EADh
EAEh
EAFh
EB0h
EB1h
EB2h
EB3h
EB4h
EB5h
EB6h
EB7h
EB8h
EB9h
EBAh
EBBh
EBCh
EBDh
EBEh
EBFh
EC0h
E6Fh
Legend:
Note 1:
RA0PPS
RA1PPS
RA2PPS
RA4PPS
RA5PPS
RB4PPS(1)
RB5PPS(1)
RB6PPS(1)
RB7PPS(1)
RC0PPS
RC1PPS
RC2PPS
RC3PPS
RC4PPS
RC5PPS
RC6PPS(1)
RC7PPS(1)
Bank 30
F0Ch
F0Dh
F0Eh
F0Fh
F10h
F11h
F12h
F13h
F14h
F15h
F16h
F17h
F18h
F19h
F1Ah
F1Bh
F1Ch
F1Dh
F1Eh
F1Fh
F20h
F21h
F22h
F23h
F24h
F25h
F26h
F27h
F28h
F29h
F2Ah
F2Bh
F2Ch
F2Dh
F2Eh
F2Fh
F30h
F31h
F32h
F33h
F34h
F35h
F36h
F37h
F38h
F39h
F3Ah
F3Bh
F3Ch
F3Dh
F3Eh
F3Fh
F40h
EEFh
F6Fh
DS40001722C-page 27
PIC16(L)F1703/7
TABLE 3-8:
PIC16(L)F1703/7 MEMORY
MAP, BANK 31
Bank 31
F8Ch
FE3h
FE4h
FE5h
FE6h
FE7h
FE8h
FE9h
FEAh
FEBh
FECh
FEDh
FEEh
FEFh
Legend:
Unimplemented
Read as 0
STATUS_SHAD
WREG_SHAD
BSR_SHAD
PCLATH_SHAD
FSR0L_SHAD
FSR0H_SHAD
FSR1L_SHAD
FSR1H_SHAD
STKPTR
TOSL
TOSH
= Unimplemented data memory locations,
read as 0,
DS40001722C-page 28
PIC16(L)F1703/7
3.4.5
TABLE 3-9:
Addr
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other Resets
Bank 0-31
x00h or
INDF0
x80h
xxxx xxxx
uuuu uuuu
x01h or
INDF1
x81h
xxxx xxxx
uuuu uuuu
x02h or
PCL
x82h
0000 0000
0000 0000
---1 1000
---q quuu
x03h or
STATUS
x83h
TO
PD
DC
x04h or
FSR0L
x84h
0000 0000
uuuu uuuu
x05h or
FSR0H
x85h
0000 0000
0000 0000
x06h or
FSR1L
x86h
0000 0000
uuuu uuuu
x07h or
FSR1H
x87h
0000 0000
0000 0000
---0 0000
---0 0000
0000 0000
uuuu uuuu
-000 0000
-000 0000
0000 000x
0000 000u
x08h or
BSR
x88h
x09h or
WREG
x89h
BSR4
BSR3
BSR2
BSR1
BSR0
Working Register
x0Ah or
PCLATH
x8Ah
x0Bh or
INTCON
x8Bh
GIE
Legend:
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
DS40001722C-page 29
TABLE 3-10:
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
RA5
RA4
RA3
RA2
RA1
RA0
--xx xxxx
--uu uuuu
Bank 0
00Ch
PORTA
(3)
00Dh
PORTB
RB7
RB6
RB5
RB4
xxxx ----
uuuu ----
00Eh
PORTC
RC7(3)
RC6(3)
RC5
RC4
RC3
RC2
RC1
RC0
xxxx xxxx
uuuu uuuu
00Fh
Unimplemented
010h
Unimplemented
011h
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
00-- 0000
00-- 0000
012h
PIR2
BCL1IF
CCP2IF
---- 0--0
---- 0--0
013h
PIR3
ZCDIF
---0 ----
---0 ----
014h
Unimplemented
TMR0
xxxx xxxx
uuuu uuuu
016h
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
xxxx xxxx
uuuu uuuu
017h
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
xxxx xxxx
uuuu uuuu
018h
T1CON
0000 -0-0
uuuu -u-u
019h
T1GCON
0000 0x00
uuuu uxuu
01Ah
TMR2
Holding Register for the Least Significant Byte of the 16-bit TMR2 Register
0000 0000
0000 0000
01Bh
PR2
Holding Register for the Most Significant Byte of the 16-bit TMR2 Register
1111 1111
1111 1111
01Ch
T2CON
-000 0000
-000 0000
01Dh
to
01Fh
Legend:
DS40001722C-page 30
Note 1:
2:
3:
4:
TMR1CS<1:0>
TMR1GE
T1GPOL
T1CKPS<1:0>
T1GTM
T1GSPM
T2OUTPS<3:0>
T1SYNC
T1GGO/
DONE
T1GVAL
TMR2ON
Unimplemented
TMR1ON
T1GSS<1:0>
T2CKPS<1:0>
PIC16(L)F1703/7
015h
TABLE 3-10:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
TRISA5
TRISA4
(1)
Value on
POR, BOR
Value on all
other Resets
Bank 1
TRISA2
TRISA1
TRISA0
--11 1111
--11 1111
08Dh
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
1111 ----
1111 ----
08Eh
TRISC
TRISC7(3)
TRISC6(3)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
1111 1111
1111 1111
08Ch
TRISA
(3)
08Fh
090h
Unimplemented
Unimplemented
SSP1IE
CCP1IE
TMR2IE
TMR1IE
00-- 0000
0000 0000
BCL1IE
CCP2IE
---- 0--0
000- 0000
ZCDIE
---0 ----
---0 ----
PSA
PIE1
TMR1GIE
ADIE
092h
PIE2
093h
PIE3
091h
094h
Unimplemented
095h
OPTION_REG
WPUEN
INTEDG
TMR0CS
TMR0SE
096h
PCON
STKOVF
STKUNF
RWDT
097h
WDTCON
RMCLR
RI
POR
WDTPS<4:0>
OSCTUNE
099h
OSCCON
SPLLEN
09Ah
OSCSTAT
PLLR
OSTS
HFIOFR
HFIOFL
MFIOFR
LFIOFR
09Bh
ADRES
09Bh
ADRESL
09Ch
ADRESH
09Dh
ADCON0
09Eh
ADCON1
ADFM
09Fh
ADCON2
DS40001722C-page 31
Note 1:
2:
3:
4:
1111 1111
BOR
00-1 11qq
qq-q qquu
SWDTEN
--01 0110
--01 0110
TUN<5:0>
--00 0000
--00 0000
0011 1-00
0011 1-00
HFIOFS
-qq0 0q0q
qqqq -q0q
xxxx xxxx
uuuu uuuu
xxxx xxxx
uuuu uuuu
-000 0000
-000 0000
0000 -000
0000 -000
0000 ----
0000 ----
IRCF<3:0>
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
SCS<1:0>
GO/DONE
ADNREF
ADON
ADPREF<1:0>
PIC16(L)F1703/7
098h
Legend:
1111 1111
PS<2:0>
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
Bank 2
10Ch
LATA
10Dh
LATB(3)
10Eh
LATC
LATA5
LATA4
LATA2
LATA1
LATA0
--xx -xxx
--uu -uuu
LATB7
LATB6
LATB5
LATB4
xxxx ----
uuuu ----
LATC7(3)
LATC6(3)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
xxxx xxxx
uuuu uuuu
10Fh
Unimplemented
110h
Unimplemented
111h
Unimplemented
112h
Unimplemented
113h
Unimplemented
114h
Unimplemented
115h
Unimplemented
10-- ---q
uu-- ---u
0q00 0000
0q00 0000
116h
BORCON
SBOREN
BORFS
117h
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
BORRDY
ADFVR<1:0>
118h
Unimplemented
119h
Unimplemented
11Ah
Unimplemented
11Bh
Unimplemented
0-x0 --00
0-x0 --00
11Ch
ZCD1CON
ZCD1EN
ZCD1OUT
ZCD1POL
ZCD1INTP
ZCD1INTN
11Dh
Unimplemented
11Eh
Unimplemented
11Fh
Unimplemented
Legend:
2013-2015 Microchip Technology Inc.
Note 1:
2:
3:
4:
PIC16(L)F1703/7
DS40001722C-page 32
TABLE 3-10:
TABLE 3-10:
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
Bank 3
18Ch
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
---1 -111
---1 -111
18Dh
ANSELB(3)
ANSB5
ANSB4
--11 ----
--11 ----
18Eh
ANSELC
ANSC7(3)
ANSC6(3)
ANSC5(2)
ANSC4(2)
ANSC3
ANSC2
ANSC1
ANSC0
11-- 1111
11-- 1111
18Fh
190h
Unimplemented
Unimplemented
191h
PMADRL
192h
PMADRH
193h
PMDATL
194h
PMDATH
195h
PMCON1
CFGS
196h
PMCON2
197h
VREGCON(4)
0000 0000
1000 0000
1000 0000
xxxx xxxx
uuuu uuuu
--xx xxxx
--uu uuuu
LWLO
FREE
WRERR
WREN
WR
RD
-000 x000
-000 q000
0000 0000
0000 0000
VREGPM
Reserved
---- --01
---- --01
0000 0000
Unimplemented
199h
Unimplemented
19Ah
Unimplemented
19Bh
Unimplemented
19Ch
Unimplemented
19Dh
Unimplemented
19Eh
Unimplemented
19Fh
Unimplemented
Legend:
Note 1:
2:
3:
4:
DS40001722C-page 33
PIC16(L)F1703/7
198h
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
Bank 4
20Ch
WPUA
20Dh
WPUB(3)
20Eh
WPUC
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
--11 1111
--11 1111
WPUB7
WPUB6
WPUB5
WPUB4
1111 ----
1111 ----
WPUC5
WPUC4
WPUC3
WPUC2
WPUC1
WPUC0
(3)
WPUC7
(3)
WPUC6
1111 1111
1111 1111
20Fh
Unimplemented
210h
Unimplemented
xxxx xxxx
uuuu uuuu
211h
SSP1BUF
212h
SSP1ADD
ADD<7:0>
xxxx xxxx
uuuu uuuu
213h
SSP1MSK
MSK<7:0>
xxxx xxxx
uuuu uuuu
0000 0000
0000 0000
0000 0000
0000 0000
214h
SSP1STAT
SMP
CKE
D/A
215h
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
216h
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
0000 0000
0000 0000
217h
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
0000 0000
0000 0000
218h
21Fh
Legend:
Note 1:
2:
3:
4:
R/W
UA
BF
SSPM
Unimplemented
PIC16(L)F1703/7
DS40001722C-page 34
TABLE 3-10:
TABLE 3-10:
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
Bank 5
28Ch
ODCONA
28Dh
ODCONB(3)
28Eh
ODCONC
28Fh
ODA5
ODA4
ODA2
ODA1
ODA0
--00 -000
--00 -000
ODB7
ODB6
ODB5
ODB4
0000 ----
0000 ----
ODC7(3)
ODC6(3)
ODC5
ODC4
ODC3
ODC2
ODC1
ODC0
0000 0000
0000 0000
Unimplemented
290h
291h
CCPR1L
292h
CCPR1H
293h
CCP1CON
294h
297h
Unimplemented
DC1B<1:0>
CCP1M<3:0>
Unimplemented
xxxx xxxx
uuuu uuuu
xxxx xxxx
uuuu uuuu
--00 0000
--00 0000
298h
CCPR2L
xxxx xxxx
uuuu uuuu
299h
CCPR2H
xxxx xxxx
uuuu uuuu
29Ah
CCP2CON
--00 0000
--00 0000
29Bh
29Fh
Legend:
DC2B<1:0>
CCP2M<3:0>
Unimplemented
DS40001722C-page 35
PIC16(L)F1703/7
Note 1:
2:
3:
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
Bank 6
30Ch
SLRCONA
30Dh
SLRCONB(3)
30Eh
SLRCONC
30Fh
31Fh
SLRA5
SLRA4
SLRA2
SLRA1
SLRA0
--11 -111
--11 -111
SLRB7
SLRB6
SLRB5
SLRB4
1111 ----
1111 ----
SLRC7(3)
SLRC6(3)
SLRC5
SLRC4
SLRC3
SLRC2
SLRC1
SLRC0
1111 1111
1111 1111
--11 1111
--11 1111
Unimplemented
Bank 7
38Ch
INLVLA
(3)
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
38Dh
INLVLB
INLVLB7
INLVLB6
INLVLB5
INLVLB4
1111 ----
1111 ----
38Eh
INLVLC
INLVLC7(3)
INLVLC6(3)
INLVLC5
INLVLC4
INLVLC3
INLVLC2
INLVLC1
INLVLC0
1111 1111
1111 1111
38Fh
Unimplemented
390h
Unimplemented
391h
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
--00 0000
--00 0000
392h
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
--00 0000
--00 0000
393h
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
--00 0000
--00 0000
394h
IOCBP(3)
IOCBP7
IOCBP6
IOCBP5
IOCBP4
0000 ----
0000 ----
395h
IOCBN(3)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
0000 ----
0000 ----
396h
IOCBF(3)
IOCBF7
IOCBF6
IOCBF5
IOCBF4
0000 ----
0000 ----
397h
IOCCP
IOCCP7(3)
IOCCP6(3)
IOCCP5
IOCCP4
IOCCP3
IOCCP2
IOCCP1
IOCCP0
0000 0000
0000 0000
398h
IOCCN
IOCCN7(3)
IOCCN6(3)
IOCCN5
IOCCN4
IOCCN3
IOCCN2
IOCCN1
IOCCN0
0000 0000
0000 0000
IOCCF
(3)
(3)
IOCCF5
IOCCF4
IOCCF3
IOCCF2
IOCCF1
IOCCF0
0000 0000
0000 0000
399h
2013-2015 Microchip Technology Inc.
39Ah
39Fh
IOCCF7
IOCCF6
Unimplemented
Unimplemented
Bank 8
40Ch
41Fh
Legend:
Note 1:
2:
3:
4:
PIC16(L)F1703/7
DS40001722C-page 36
TABLE 3-10:
TABLE 3-10:
Address
Value on all
other Resets
Unimplemented
Unimplemented
00-0 --00
00-0 --00
00-0 --00
00-0 --00
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bank 9
48Ch
to
49Fh
Bank 10
50Ch
510h
511h
OPA1CON
512h
514h
515h
OPA2CON
516h
51Fh
OPA1EN
OPA1SP
OPA1UG
OPA1PCH<1:0>
Unimplemented
OPA2EN
OPA2SP
OPA2UG
OPA2PCH<1:0>
Unimplemented
Unimplemented
Bank 11-27
58Ch/
59Fh
D8Ch/
D9Fh
Legend:
DS40001722C-page 37
PIC16(L)F1703/7
Note 1:
2:
3:
4:
Address
Name
Bit 7
Unimplemented
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other Resets
Bank 28
E0Ch
E0Eh
E0Fh
PPSLOCK
---- ---0
---- ---0
E10h
INTPPS
INTPPS<4:0>
---0 0010
---u uuuu
E11h
T0CKIPPS
T0CKIPPS<4:0>
---0 0010
---u uuuu
E12h
T1CKIPPS
T1CKIPPS<4:0>
---0 0101
---u uuuu
E13h
T1GPPS
T1GPPS<4:0>
---0 0100
---u uuuu
E14h
CCP1PPS
CCP1PPS<4:0>
---1 0101
---u uuuu
E15h
CCP2PPS
CCP2PPS<4:0>
---1 0011
---u uuuu
E16h
to
E1Fh
E20h
E21h
E22h
E23h
to
E6Fh
2013-2015 Microchip Technology Inc.
Legend:
Note 1:
2:
3:
4:
SSPCLKPPS
SSPDATPPS
SSPSSPPS
Unimplemented
PPSLOCKED
SSPCLKPPS<4:0>
---1 0000(3)
---u uuuu
SSPCLKPPS<4:0>
---0 1110(4)
---u uuuu
SSPDATPPS<4:0>
---1 0001(3)
---u uuuu
(4)
SSPDATPPS<4:0>
---0 1100
---u uuuu
SSPSSPPS<4:0>
---1 0011(3)
---u uuuu
SSPSSPPS<4:0>
---1 0110(4)
---u uuuu
Unimplemented
PIC16(L)F1703/7
DS40001722C-page 38
TABLE 3-10:
TABLE 3-10:
Address
Value on
POR, BOR
Value on all
other Resets
RA0PPS<4:0>
---0 0000
---u uuuu
RA1PPS<4:0>
---0 0000
---u uuuu
RA2PPS<4:0>
---0 0000
---u uuuu
Name
Bit 7
Bit 5
E8Ch
E8Fh
Unimplemented
E90h
RA0PPS
E91h
RA1PPS
E92h
RA2PPS
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bank 29
E93h
E94h
Unimplemented
RA4PPS<4:0>
---0 0000
---u uuuu
RA5PPS
RA5PPS<4:0>
---0 0000
---u uuuu
E96h
to
E9Fh
EA0h
RC0PPS
RC0PPS<4:0>
---0 0000
---u uuuu
EA1h
RC1PPS
RC1PPS<4:0>
---0 0000
---u uuuu
EA2h
RC2PPS
RC2PPS<4:0>
---0 0000
---u uuuu
EA3h
RC3PPS
RC3PPS<4:0>
---0 0000
---u uuuu
EA4h
RC4PPS
RC4PPS<4:0>
---0 0000
---u uuuu
EA5h
RC5PPS
RC5PPS<4:0>
---0 0000
---u uuuu
EA6h
EEFh
Unimplemented
Unimplemented
Unimplemented
Bank 30
F0Ch
F6Fh
Legend:
DS40001722C-page 39
Note 1:
2:
3:
4:
PIC16(L)F1703/7
RA4PPS
E95h
Address
Name
Bit 7
Unimplemented
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other Resets
---- -xxx
---- -xxx
xxxx xxxx
uuuu uuuu
---x xxxx
---u uuuu
-xxx xxxx
uuuu uuuu
Bank 31
F8Eh
to
FE3h
FE4h
STATUS_
FE5h
WREG_
SHAD
FE6h
BSR_
SHAD
DC
SHAD
FE7h
PCLATH_
SHAD
FE8h
FSR0L_
SHAD
xxxx xxxx
uuuu uuuu
FE9h
FSR0H_
SHAD
xxxx xxxx
uuuu uuuu
FEAh
FSR1L_
SHAD
xxxx xxxx
uuuu uuuu
FEBh
FSR1H_
SHAD
xxxx xxxx
uuuu uuuu
FECh
FEDh
STKPTR
FEEh
TOSL
FEFh
2013-2015 Microchip Technology Inc.
Legend:
Note 1:
2:
3:
4:
TOSH
Unimplemented
---x xxxx
---x xxxx
xxxx xxxx
uuuu uuuu
-xxx xxxx
-uuu uuuu
PIC16(L)F1703/7
DS40001722C-page 40
TABLE 3-10:
PIC16(L)F1703/7
3.5
3.5.3
FIGURE 3-3:
PC
LOADING OF PC IN
DIFFERENT SITUATIONS
14
PCH
14
PCH
PCL
PCLATH
PC
ALU Result
PCL
11
OPCODE <10:0>
PC
14
PCH
PCL
0
CALLW
PCLATH
PC
Instruction with
PCL as
Destination
GOTO, CALL
PCLATH
14
PCH
W
PCL
0
BRW
PC + W
14
PCH
3.5.4
BRANCHING
15
PC
The CALLW instruction enables computed calls by combining PCLATH and W to form the destination address.
A computed CALLW is accomplished by loading the W
register with the desired address and executing CALLW.
The PCL register is loaded with the value of W and
PCH is loaded with PCLATH.
PCL
0
BRA
15
PC + OPCODE <8:0>
3.5.1
MODIFYING PCL
3.5.2
COMPUTED GOTO
DS40001722C-page 41
PIC16(L)F1703/7
3.6
3.6.1
Stack
Note:
FIGURE 3-4:
TOSH:TOSL
0x0F
STKPTR = 0x1F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
0x00
TOSH:TOSL
DS40001722C-page 42
0x1F
0x0000
STKPTR = 0x1F
PIC16(L)F1703/7
FIGURE 3-5:
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
TOSH:TOSL
FIGURE 3-6:
0x00
Return Address
STKPTR = 0x00
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
TOSH:TOSL
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x06
DS40001722C-page 43
PIC16(L)F1703/7
FIGURE 3-7:
TOSH:TOSL
3.6.2
0x0F
Return Address
0x0E
Return Address
0x0D
Return Address
0x0C
Return Address
0x0B
Return Address
0x0A
Return Address
0x09
Return Address
0x08
Return Address
0x07
Return Address
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x10
OVERFLOW/UNDERFLOW RESET
3.7
Indirect Addressing
DS40001722C-page 44
PIC16(L)F1703/7
FIGURE 3-8:
INDIRECT ADDRESSING
0x0000
0x0000
Traditional
Data Memory
0x0FFF
0x1000
0x1FFF
0x0FFF
Reserved
0x2000
Linear
Data Memory
0x29AF
0x29B0
FSR
Address
Range
0x7FFF
0x8000
Reserved
0x0000
Program
Flash Memory
0xFFFF
Note:
0x7FFF
Not all memory regions are completely implemented. Consult device memory tables for memory limits.
DS40001722C-page 45
PIC16(L)F1703/7
3.7.1
FIGURE 3-9:
BSR
Indirect Addressing
From Opcode
7
0
Bank Select
Location Select
FSRxH
0
FSRxL
0
Bank Select
11111
Bank 31
Location Select
0x00
0x7F
DS40001722C-page 46
PIC16(L)F1703/7
3.7.2
3.7.3
FIGURE 3-10:
7
FSRnH
0 0 1
FSRnL
FIGURE 3-11:
7
1
FSRnH
PROGRAM FLASH
MEMORY MAP
0
Location Select
Location Select
0x2000
FSRnL
0x8000
0x0000
0x020
Bank 0
0x06F
0x0A0
Bank 1
0x0EF
0x120
Program
Flash
Memory
(low 8
bits)
Bank 2
0x16F
0xF20
Bank 30
0x29AF
0xF6F
0xFFFF
0x7FFF
DS40001722C-page 47
PIC16(L)F1703/7
4.0
DEVICE CONFIGURATION
4.1
Configuration Words
DS40001722C-page 48
PIC16(L)F1703/7
4.2
REGISTER 4-1:
U-1
R/P-1
CLKOUTEN
R/P-1
U-1
R/P-1
BOREN<1:0>
bit 8
bit 13
R/P-1
CP
(1)
R/P-1
R/P-1
MCLRE
PWRTE
R/P-1
R/P-1
R/P-1
WDTE<1:0>
R/P-1
R/P-1
FOSC<1:0>
bit 0
bit 7
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13-12
Unimplemented: Read as 1
bit 11
bit 10-9
bit 8
Unimplemented: Read as 1
bit 7
bit 6
bit 5
bit 4-3
bit 2
Unimplemented: Read as 1
bit 1-0
Note 1:
The entire Flash program memory will be erased when the code protection is turned off during an erase. When a Bulk
Erase Program Memory Command is executed, the entire program Flash memory and configuration memory will be
erased.
DS40001722C-page 49
PIC16(L)F1703/7
REGISTER 4-2:
(1)
R/P-1
DEBUG
R/P-1
(2)
LPBOR
R/P-1
(3)
BORV
R/P-1
R/P-1
STVREN
PLLEN
bit 13
bit 8
R/P-1
U-1
U-1
U-1
U-1
R/P-1
ZCDDIS
PPS1WAY
R/P-1
bit 7
R/P-1
WRT<1:0>
bit 0
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6-3
Unimplemented: Read as 1
bit 2
bit 1-0
Note 1:
2:
3:
The LVP bit cannot be programmed to 0 when Programming mode is entered via LVP.
The DEBUG bit in Configuration Words is managed automatically by device development tools including debuggers
and programmers. For normal device operation, this bit should be maintained as a 1.
See VBOR parameter for specific trip point voltages.
DS40001722C-page 50
PIC16(L)F1703/7
4.3
Code Protection
4.3.1
4.4
Write Protection
4.5
User ID
DS40001722C-page 51
PIC16(L)F1703/7
4.6
4.7
REGISTER 4-3:
DEV<13:8>
bit 13
R
bit 8
R
DEV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-0
0 = Bit is cleared
DEV<13:0>: Device ID bits
Device
DEVID<13:0> Values
PIC16F1703
PIC16LF1703
PIC16F1707
PIC16LF1707
REGISTER 4-4:
REV<13:8>
bit 13
R
bit 8
R
REV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-0
0 = Bit is cleared
REV<13:0>: Revision ID bits
DS40001722C-page 52
PIC16(L)F1703/7
5.0
RESETS
FIGURE 5-1:
MCLRE
VPP/MCLR
Sleep
WDT
Time-out
Device
Reset
Power-on
Reset
VDD
BOR
Active(1)
Brown-out
Reset
LPBOR
Reset
Note 1:
LFINTOSC
Power-up
Timer
PWRTE
DS40001722C-page 53
PIC16(L)F1703/7
5.1
5.2
The POR circuit holds the device in Reset until VDD has
reached an acceptable level for minimum operation.
Slow rising VDD, fast operating speeds or analog
performance may require greater than minimum VDD.
The PWRT, BOR or MCLR features can be used to
extend the start-up period until all device operation
conditions have been met.
5.1.1
TABLE 5-1:
BOREN<1:0>
SBOREN
Device Mode
BOR Mode
11
Active
Awake
Active
10
Sleep
Disabled
Active
Disabled
Disabled
01
00
Note 1: In these specific cases, Release of POR and Wake-up from Sleep, there is no delay in start-up. The BOR
ready flag, (BORRDY = 1), will be set before the CPU is ready to execute instructions because the BOR
circuit is forced on by the BOREN<1:0> bits.
5.2.1
BOR IS ALWAYS ON
5.2.2
5.2.3
DS40001722C-page 54
PIC16(L)F1703/7
FIGURE 5-2:
BROWN-OUT SITUATIONS
VDD
VBOR
Internal
Reset
TPWRT(1)
VDD
VBOR
Internal
Reset
< TPWRT
TPWRT(1)
VDD
VBOR
Internal
Reset
Note 1:
5.3
TPWRT(1)
REGISTER 5-1:
R/W-1/u
R/W-0/u
U-0
U-0
U-0
U-0
U-0
R-q/u
SBOREN
BORFS(1)
BORRDY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-1
Unimplemented: Read as 0
bit 0
Note 1:
DS40001722C-page 55
PIC16(L)F1703/7
5.4
5.4.1
ENABLING LPBOR
5.4.1.1
5.5
MCLR
5.6
5.7
RESET Instruction
5.8
5.9
5.10
TABLE 5-2:
MCLR CONFIGURATION
MCLRE
LVP
MCLR
Disabled
Enabled
Enabled
5.5.1
MCLR ENABLED
5.5.2
MCLR DISABLED
DS40001722C-page 56
Power-Up Timer
5.11
Start-up Sequence
The total time-out will vary based on oscillator configuration and Power-up Timer configuration. See
Section 6.0 Oscillator Module (with Fail-Safe
Clock Monitor) for more information.
The Power-up Timer and oscillator start-up timer run
independently of MCLR Reset. If MCLR is kept low
long enough, the Power-up Timer and oscillator
start-up timer will expire. Upon bringing MCLR high, the
device will begin execution after 10 FOSC cycles (see
Figure 5-3). This is useful for testing purposes or to
synchronize more than one device operating in parallel.
PIC16(L)F1703/7
FIGURE 5-3:
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
TMCLR
Internal RESET
Oscillator Modes
Internal Oscillator
Oscillator
FOSC
FOSC
DS40001722C-page 57
PIC16(L)F1703/7
5.12
TABLE 5-3:
RMCLR
RI
POR
BOR
TO
PD
Condition
Power-on Reset
Brown-out Reset
WDT Reset
TABLE 5-4:
STATUS
Register
PCON
Register
Power-on Reset
0000h
---1 1000
00-- 110x
0000h
---u uuuu
uu-- 0uuu
0000h
---1 0uuu
uu-- 0uuu
WDT Reset
0000h
---0 uuuu
uu-- uuuu
PC + 1
---0 0uuu
uu-- uuuu
Brown-out Reset
0000h
---1 1uuu
00-- 11u0
---1 0uuu
uu-- uuuu
---u uuuu
uu-- u0uu
Condition
PC + 1
(1)
0000h
0000h
---u uuuu
1u-- uuuu
0000h
---u uuuu
u1-- uuuu
DS40001722C-page 58
PIC16(L)F1703/7
5.13
5.14
REGISTER 5-2:
R/W/HS-0/q
R/W/HS-0/q
U-0
STKOVF
STKUNF
R/W/HC-1/q R/W/HC-1/q
RWDT
R/W/HC-1/q
R/W/HC-q/u
R/W/HC-q/u
RI
POR
BOR
RMCLR
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001722C-page 59
PIC16(L)F1703/7
TABLE 5-5:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
BORCON
SBOREN
BORFS
BORRDY
55
PCON
STKOVF
STKUNF
RWDT
RMCLR
RI
POR
BOR
59
STATUS
TO
PD
DC
21
WDTCON
SWDTEN
92
WDTPS<4:0>
Legend: = unimplemented location, read as 0. Shaded cells are not used by Resets.
DS40001722C-page 60
PIC16(L)F1703/7
6.0
6.1
Overview
DS40001722C-page 61
PIC16(L)F1703/7
SIMPLIFIED PIC MCU CLOCK SOURCE BLOCK DIAGRAM
FIGURE 6-1:
T1CKI
T1OSC
01
CLKIN
External
Oscillator
0
Sleep
0
1
00
PRIMUX
4 x PLL
1
PLLMUX
IRCF<3:0>
16 MHz
8 MHz
4 MHz
2 MHz
1 MHz
500 kHz
250 kHz
125 kHz
62.5 kHz
31.25 kHz
500 kHz
Source
16 MHz
(HFINTOSC)
500 kHz
(MFINTOSC)
31 kHz
Source
INTOSC
SCS<1:0>
31 kHz
0000
WDT, PWRT
31 kHz (LFINTOSC)
Inputs
SCS
FOSC<1:0>
PLLEN or
SPLLEN
0
=00
1
=00
00
00
DS40001722C-page 62
1X
1111
MUX
HFPLL
Postscaler
Internal
Oscillator
Block
FOSC
To CPU and
Peripherals
Outputs
IRCF
PRIMUX
PLLMUX
=1110
1110
PIC16(L)F1703/7
6.2
6.2.1
FIGURE 6-2:
Clock from
Ext. System
FOSC/4 or I/O(1)
Note 1:
6.2.1.1
EC Mode
DS40001722C-page 63
PIC16(L)F1703/7
6.2.1.2
4x PLL
6.2.2
2.
3.
DS40001722C-page 64
6.2.2.1
HFINTOSC
6.2.2.2
MFINTOSC
The
Medium-Frequency
Internal
Oscillator
(MFINTOSC) is a factory calibrated 500 kHz internal
clock source. The frequency of the MFINTOSC can be
altered via software using the OSCTUNE register
(Register 6-3).
The output of the MFINTOSC connects to a postscaler
and multiplexer (see Figure 6-1). One of nine
frequencies derived from the MFINTOSC can be
selected via software using the IRCF<3:0> bits of the
OSCCON register. See Section 6.2.2.7 Internal
Oscillator Clock Switch Timing for more information.
The MFINTOSC is enabled by:
Configure the IRCF<3:0> bits of the OSCCON
register for the desired HF frequency, and
FOSC<1:0> = 00, or
Set the System Clock Source (SCS) bits of the
OSCCON register to 1x
The Medium-Frequency Internal Oscillator Ready bit
(MFIOFR) of the OSCSTAT register indicates when the
MFINTOSC is running.
PIC16(L)F1703/7
6.2.2.3
6.2.2.4
LFINTOSC
6.2.2.5
Note:
DS40001722C-page 65
PIC16(L)F1703/7
6.2.2.6
DS40001722C-page 66
6.2.2.7
5.
6.
7.
PIC16(L)F1703/7
FIGURE 6-3:
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
Oscillator Delay(1)
Start-up Time
2-cycle Sync
Running
LFINTOSC
IRCF <3:0>
System Clock
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
2-cycle Sync
Running
LFINTOSC
IRCF <3:0>
System Clock
LFINTOSC
HFINTOSC/MFINTOSC
LFINTOSC
Oscillator Delay(1)
Start-up Time
2-cycle Sync
Running
HFINTOSC/
MFINTOSC
IRCF <3:0>
=0
System Clock
Note 1: See Table 6-1, Oscillator Switching Delays, for more information.
DS40001722C-page 67
PIC16(L)F1703/7
6.3
Clock Switching
6.3.1
TABLE 6-1:
Switch From
Switch To
Frequency
Oscillator Delay
LFINTOSC(1)
Sleep/POR
MFINTOSC(1)
HFINTOSC(1)
31 kHz
31.25 kHz-500 kHz
31.25 kHz-16 MHz
2 cycles
Sleep/POR
EC
DC 32 MHz
2 cycles
LFINTOSC
EC
DC 32 MHz
1 cycle of each
MFINTOSC(1)
HFINTOSC(1)
2 s (approx.)
LFINTOSC(1)
31 kHz
1 cycle of each
PLL inactive
PLL active
16-32 MHz
2 ms (approx.)
Note 1:
PLL inactive.
DS40001722C-page 68
PIC16(L)F1703/7
6.4
REGISTER 6-1:
R/W-0/0
R/W-1/1
SPLLEN
R/W-1/1
R/W-1/1
IRCF<3:0>
U-0
R/W-0/0
R/W-0/0
SCS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-3
bit 2
Unimplemented: Read as 0
bit 1-0
Note 1:
2:
DS40001722C-page 69
PIC16(L)F1703/7
REGISTER 6-2:
U-0
R-0/q
R-q/q
R-0/q
R-0/q
R-q/q
R-0/0
R-0/q
PLLR
OSTS
HFIOFR
HFIOFL
MFIOFR
LFIOFR
HFIOFS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
q = Conditional
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001722C-page 70
PIC16(L)F1703/7
REGISTER 6-3:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TUN<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
111111 =
000000 = Oscillator module is running at the factory-calibrated frequency
000001 =
011110 =
011111 = Maximum frequency
TABLE 6-2:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 0
Register
on Page
OSCCON
SPLLEN
OSCSTAT
PLLR
OSCTUNE
PIR2
BCL1IF
CCP2IF
82
BCL1IE
CCP2IE
79
PIE2
Legend:
CONFIG1
CONFIG2
Legend:
OSTS
HFIOFR
HFIOFL
SCS<1:0>
MFIOFR
LFIOFR
69
HFIOFS
70
TUN<5:0>
71
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
TABLE 6-3:
Name
IRCF<3:0>
Bit 1
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
CLKOUTEN
Bit 10/2
13:8
7:0
CP
MCLRE
PWRTE
13:8
LVP
DEBUG
LPBOR
BORV
7:0
ZCDDIS
PPS1WAY
WDTE<1:0>
Bit 9/1
BOREN<1:0>
Bit 8/0
FOSC<1:0>
STVREN
PLLEN
WRT<1:0>
Register
on Page
49
50
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
DS40001722C-page 71
PIC16(L)F1703/7
7.0
INTERRUPTS
Operation
Interrupt Latency
Interrupts During Sleep
INT Pin
Automatic Context Saving
FIGURE 7-1:
INTERRUPT LOGIC
TMR0IF
TMR0IE
Peripheral Interrupts
(TMR1IF) PIR1<0>
(TMR1IE) PIE1<0>
Wake-up
(If in Sleep mode)
INTF
INTE
IOCIF
IOCIE
Interrupt
to CPU
PEIE
PIRn<7>
PIEn<7>
DS40001722C-page 72
GIE
PIC16(L)F1703/7
7.1
Operation
7.2
Interrupt Latency
The INTCON, PIR1 and PIR2 registers record individual interrupts via interrupt flag bits. Interrupt flag bits will
be set, regardless of the status of the GIE, PEIE and
individual interrupt enable bits.
The following events happen when an interrupt event
occurs while the GIE bit is set:
Current prefetched instruction is flushed
GIE bit is cleared
Current Program Counter (PC) is pushed onto the
stack
Critical registers are automatically saved to the
shadow registers (See Section 7.5 Automatic
Context Saving)
PC is loaded with the interrupt vector 0004h
The firmware within the Interrupt Service Routine (ISR)
should determine the source of the interrupt by polling
the interrupt flag bits. The interrupt flag bits must be
cleared before exiting the ISR to avoid repeated
interrupts. Because the GIE bit is cleared, any interrupt
that occurs while executing the ISR will be recorded
through its interrupt flag, but will not cause the
processor to redirect to the interrupt vector.
The RETFIE instruction exits the ISR by popping the
previous address from the stack, restoring the saved
context from the shadow registers and setting the GIE
bit.
For additional information on a specific interrupts
operation, refer to its peripheral chapter.
Note 1: Individual interrupt flag bits are set,
regardless of the state of any other
enable bits.
2: All interrupts will be ignored while the GIE
bit is cleared. Any interrupt occurring
while the GIE bit is clear will be serviced
when the GIE bit is set again.
DS40001722C-page 73
PIC16(L)F1703/7
FIGURE 7-2:
INTERRUPT LATENCY
F OSC
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
CLKR
Interrupt Sampled
during Q1
Interrupt
GIE
PC
Execute
PC-1
PC
1 Cycle Instruction at PC
PC+1
0004h
0005h
NOP
NOP
Inst(0004h)
PC+1/FSR
ADDR
New PC/
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
FSR ADDR
PC+1
PC+2
0004h
0005h
INST(PC)
NOP
NOP
NOP
Inst(0004h)
Inst(0005h)
FSR ADDR
PC+1
0004h
0005h
INST(PC)
NOP
NOP
Inst(0004h)
Inst(PC)
Interrupt
GIE
PC
Execute
PC-1
PC
2 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
DS40001722C-page 74
PC+2
NOP
NOP
PIC16(L)F1703/7
FIGURE 7-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
FOSC
CLKOUT (3)
(4)
INT pin
(1)
(1)
INTF
(5)
GIE
INSTRUCTION FLOW
PC
Instruction
Fetched
Instruction
Executed
Note 1:
PC
Inst (PC)
Inst (PC 1)
PC + 1
Inst (PC + 1)
Inst (PC)
PC + 1
Forced NOP
0004h
Inst (0004h)
Forced NOP
0005h
Inst (0005h)
Inst (0004h)
2:
Asynchronous interrupt latency = 3-5 TCY. Synchronous latency = 3-4 TCY, where TCY = instruction cycle time.
Latency is the same whether Inst (PC) is a single cycle or a 2-cycle instruction.
3:
4:
For minimum width of INT pulse, refer to AC specifications in Section 26.0 Electrical Specifications.
5:
DS40001722C-page 75
PIC16(L)F1703/7
7.3
7.4
INT Pin
7.5
W register
STATUS register (except for TO and PD)
BSR register
FSR registers
PCLATH register
Upon exiting the Interrupt Service Routine, these registers are automatically restored. Any modifications to
these registers during the ISR will be lost. If modifications to any of these registers are desired, the corresponding shadow register should be modified and the
value will be restored when exiting the ISR. The
shadow registers are available in Bank 31 and are
readable and writable. Depending on the users
application, other registers may also need to be saved.
DS40001722C-page 76
PIC16(L)F1703/7
7.6
REGISTER 7-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Note:
The IOCIF Flag bit is read-only and cleared when all the interrupt-on-change flags in the IOCxF registers
have been cleared by software.
Interrupt flag bits are set when an interrupt
condition occurs, regardless of the state of
its corresponding enable bit or the Global
Enable bit, GIE, of the INTCON register.
User software should ensure the
appropriate interrupt flag bits are clear
prior to enabling an interrupt.
DS40001722C-page 77
PIC16(L)F1703/7
REGISTER 7-2:
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Note:
DS40001722C-page 78
PIC16(L)F1703/7
REGISTER 7-3:
U-0
U-0
U-0
R/W-0/0
U-0
U-0
R/W-0/0
BCL1IE
CCP2IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
Note:
DS40001722C-page 79
PIC16(L)F1703/7
REGISTER 7-4:
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
ZCDIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3-0
Unimplemented: Read as 0
Note:
DS40001722C-page 80
PIC16(L)F1703/7
REGISTER 7-5:
R/W-0/0
R/W-0/0
TMR1GIF
ADIF
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
SSP1IF
CCP1IF
TMR2IF
TMR1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Note:
DS40001722C-page 81
PIC16(L)F1703/7
REGISTER 7-6:
U-0
U-0
U-0
R/W-0/0
U-0
U-0
R/W-0/0
BCL1IF
CCP2IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
Note:
DS40001722C-page 82
PIC16(L)F1703/7
REGISTER 7-7:
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
ZCDIF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3-0
Unimplemented: Read as 0
Note:
DS40001722C-page 83
PIC16(L)F1703/7
TABLE 7-1:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
TMR0IF
Bit 1
Bit 0
INTF
IOCIF
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PIE1
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIE2
BCL1IE
CCP2IE
79
OPTION_REG
PS<2:0>
77
168
PIE3
ZCDIE
80
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
PIR2
BCL1IF
CCP2IF
82
PIR3
ZCDIF
83
Legend:
DS40001722C-page 84
PIC16(L)F1703/7
8.0
8.1
1.
2.
3.
4.
5.
6.
1.
2.
3.
4.
5.
6.
7.
8.
9.
DS40001722C-page 85
PIC16(L)F1703/7
8.1.1
FIGURE 8-1:
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
CLKIN(1)
TOST(3)
CLKOUT(2)
Interrupt flag
GIE bit
(INTCON reg.)
Instruction Flow
PC
Instruction
Fetched
Instruction
Executed
Note
1:
2:
3:
4:
Processor in
Sleep
PC
Inst(PC) = Sleep
Inst(PC - 1)
PC + 1
PC + 2
PC + 2
Inst(PC + 1)
Inst(PC + 2)
Sleep
Inst(PC + 1)
PC + 2
Forced NOP
0004h
0005h
Inst(0004h)
Inst(0005h)
Forced NOP
Inst(0004h)
DS40001722C-page 86
PIC16(L)F1703/7
8.2
8.2.1
8.2.2
Note:
The Low-Power Sleep mode is beneficial for applications that stay in Sleep mode for long periods of time.
The normal mode is beneficial for applications that
need to wake from Sleep quickly and frequently.
DS40001722C-page 87
PIC16(L)F1703/7
8.3
REGISTER 8-1:
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-1/1
VREGPM
Reserved
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
Note 1:
2:
PIC16F1703/7 only.
See Section 26.0 Electrical Specifications.
TABLE 8-1:
Name
Bit 7
Bit 6
INTCON
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
137
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
137
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
137
IOCBP(1)
IOCBP7
IOCBP6
IOCBP5
IOCBP4
138
IOCBN(1)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
138
IOCAF
(1)
IOCBF
IOCBF7
IOCBF6
IOCBF5
IOCBF4
138
IOCCP
IOCCP7(1)
IOCCP6(1)
IOCCP5
IOCCP4
IOCCP3
IOCCP2
IOCCP1
IOCCP0
139
IOCCN
IOCCN7(1)
IOCCN6(1)
IOCCN5
IOCCN4
IOCCN3
IOCCN2
IOCCN1
IOCCN0
139
IOCCF
IOCCF7(1)
IOCCF6(1)
IOCCF5
IOCCF4
IOCCF3
IOCCF2
IOCCF1
IOCCF0
139
PIE1
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIE2
BCL1IE
CCP2IE
79
PIE3
ZCDIE
80
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
PIR2
BCL1IF
CCP2IF
82
PIR3
ZCDIF
83
STATUS
TO
PD
DC
21
VREGCON(2)
VREGPM
Reserved
88
WDTCON
SWDTEN
92
Legend:
Note 1:
2:
WDTPS<4:0>
= unimplemented location, read as 0. Shaded cells are not used in Power-Down mode.
PIC16(L)F1707 only.
PIC16F1703/7 only.
DS40001722C-page 88
PIC16(L)F1703/7
9.0
FIGURE 9-1:
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 11
LFINTOSC
23-bit Programmable
Prescaler WDT
WDT Time-out
WDTE<1:0> = 10
Sleep
WDTPS<4:0>
DS40001722C-page 89
PIC16(L)F1703/7
9.1
9.4
9.2
9.2.1
WDT IS ALWAYS ON
TABLE 9-1:
Any Reset
CLRWDT instruction is executed
Device enters Sleep
Device wakes up from Sleep
Oscillator fail
WDT is disabled
Oscillator Start-up Timer (OST) is running
9.5
9.2.3
9.2.2
WDTE<1:0>
SWDTEN
Device
Mode
11
10
WDT
Mode
Active
Awake Active
1
01
Sleep
X
0
00
9.3
Disabled
Active
Disabled
Disabled
Time-Out Period
DS40001722C-page 90
PIC16(L)F1703/7
TABLE 9-2:
WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
CLRWDT Command
Cleared
Unaffected
DS40001722C-page 91
PIC16(L)F1703/7
9.6
REGISTER 9-1:
U-0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-1/1
R/W-1/1
(1)
WDTPS<4:0>
R/W-0/0
SWDTEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-1
bit 0
Note 1:
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
DS40001722C-page 92
PIC16(L)F1703/7
TABLE 9-3:
Name
Bit 6
OSCCON
SPLLEN
STATUS
WDTCON
Bit 5
Bit 4
Bit 3
IRCF<3:0>
Bit 2
TO
PD
Bit 1
Bit 0
SCS<1:0>
DC
WDTPS<4:0>
Register
on Page
69
21
SWDTEN
92
Legend: x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by
Watchdog Timer.
TABLE 9-4:
Name
CONFIG1
CONFIG2
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
CLKOUTEN
13:8
7:0
CP
MCLRE
PWRTE
13:8
LVP
DEBUG
7:0
ZCDDIS
WDTE<1:0>
Bit 10/2
Bit 9/1
Bit 8/0
BOREN<1:0>
FOSC<1:0>
LPBOR
BORV
STVREN PLLEN
PPS1WAY
WRT<1:0>
Register
on Page
49
50
Legend: = unimplemented location, read as 0. Shaded cells are not used by Watchdog Timer.
DS40001722C-page 93
PIC16(L)F1703/7
10.0
PMCON1
PMCON2
PMDATL
PMDATH
PMADRL
PMADRH
10.1
DS40001722C-page 94
10.1.1
10.2
See Table 10-1 for Erase Row size and the number of
write latches for Flash program memory.
PIC16(L)F1703/7
TABLE 10-1:
Device
PIC16(L)F1703
PIC16(L)F1707
10.2.1
FLASH MEMORY
ORGANIZATION BY DEVICE
Row Erase
(words)
Write
Latches
(words)
16
16
Write
the
desired
address
to
the
PMADRH:PMADRL register pair.
Clear the CFGS bit of the PMCON1 register.
Then, set control bit RD of the PMCON1 register.
FIGURE 10-1:
FLASH PROGRAM
MEMORY READ
FLOWCHART
Start
Read Operation
Select
Program or Configuration Memory
(CFGS)
Select
Word Address
(PMADRH:PMADRL)
End
Read Operation
DS40001722C-page 95
PIC16(L)F1703/7
FIGURE 10-2:
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
Flash ADDR
Flash Data
PC + 1
INSTR (PC)
INSTR(PC - 1)
executed here
PC
+3
PC+3
PMADRH,PMADRL
INSTR (PC + 1)
BSF PMCON1,RD
executed here
PMDATH,PMDATL
INSTR(PC + 1)
instruction ignored
Forced NOP
executed here
PC + 4
INSTR (PC + 3)
INSTR(PC + 2)
instruction ignored
Forced NOP
executed here
PC + 5
INSTR (PC + 4)
INSTR(PC + 3)
executed here
INSTR(PC + 4)
executed here
RD bit
PMDATH
PMDATL
Register
EXAMPLE 10-1:
PMADRL
PROG_ADDR_LO
PMADRL
PROG_ADDR_HI
PMADRH
BCF
BSF
NOP
NOP
PMCON1,CFGS
PMCON1,RD
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001722C-page 96
PIC16(L)F1703/7
10.2.2
FIGURE 10-3:
FLASH PROGRAM
MEMORY UNLOCK
SEQUENCE FLOWCHART
Start
Unlock Sequence
Write 055h to
PMCON2
Write 0AAh to
PMCON2
Initiate
Write or Erase operation
(WR = 1)
4. NOP instruction
5. NOP instruction
Once the WR bit is set, the processor will always force
two NOP instructions. When an Erase Row or Program
Row operation is being performed, the processor will stall
internal operations (typical 2 ms), until the operation is
complete and then resume with the next instruction.
When the operation is loading the program memory write
latches, the processor will always force the two NOP
instructions and continue uninterrupted with the next
instruction.
End
Unlock Sequence
DS40001722C-page 97
PIC16(L)F1703/7
10.2.3
FIGURE 10-4:
FLASH PROGRAM
MEMORY ERASE
FLOWCHART
Start
Erase Operation
Disable Interrupts
(GIE = 0)
Select
Program or Configuration Memory
(CFGS)
Unlock Sequence
Figure 10-3
(FIGURE
x-x)
Re-enable Interrupts
(GIE = 1)
End
Erase Operation
DS40001722C-page 98
PIC16(L)F1703/7
EXAMPLE 10-2:
Required
Sequence
BCF
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
BCF
BSF
BSF
INTCON,GIE
PMADRL
ADDRL,W
PMADRL
ADDRH,W
PMADRH
PMCON1,CFGS
PMCON1,FREE
PMCON1,WREN
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
BCF
BSF
PMCON1,WREN
INTCON,GIE
; Disable writes
; Enable interrupts
DS40001722C-page 99
PIC16(L)F1703/7
10.2.4
1.
2.
3.
DS40001722C-page 100
0 7
5 4
PMADRH
-
r9
r8
r7
r6
r5
PMADRL
r4
r3
r2
r1
r0
c4
c3
c2
c1
5
-
PMDATH
PMDATL
c0
Rev. 10-000004A_A0
0
8
14
Program Memory Write Latches
10
14
PMADRL<4:0>
Write Latch #0
00h
14
CFGS = 0
PMADRH<6:0>:
PMADRL<7:5>
Row
Address
Decode
14
14
Write Latch #1
01h
14
14
14
14
Row
Addr
Addr
Addr
Addr
000h
0000h
0001h
001Eh
001Fh
001h
0020h
0021h
003Eh
003Fh
002h
0040h
0041h
005Eh
005Fh
3FEh
7FC0h
7FC1h
7FDEh
7FDFh
3FFh
7FE0h
7FE1h
7FFEh
7FFFh
400h
CFGS = 1
8000h - 8003h
8004h 8005h
8006h
8007h 8008h
8009h - 801Fh
USER ID 0 - 3
reserved
DEVICE ID
Dev / Rev
Configuration
Words
reserved
Configuration Memory
PIC16(L)F1703/7
DS40001722C-page 101
FIGURE 10-5:
PIC16(L)F1703/7
FIGURE 10-6:
Start
Write Operation
Disable Interrupts
(GIE = 0)
Select
Program or Config. Memory
(CFGS)
Enable Write/Erase
Operation (WREN = 1)
Last word to
write ?
Yes
No
Unlock Sequence
(Figure10-3
x-x)
Figure
Increment Address
(PMADRH:PMADRL++)
Unlock Sequence
(Figure10-3
x-x)
Figure
Disable
Write/Erase Operation
(WREN = 0)
Re-enable Interrupts
(GIE = 1)
End
Write Operation
DS40001722C-page 102
PIC16(L)F1703/7
EXAMPLE 10-3:
;
;
;
;
;
;
;
INTCON,GIE
PMADRH
ADDRH,W
PMADRH
ADDRL,W
PMADRL
LOW DATA_ADDR
FSR0L
HIGH DATA_ADDR
FSR0H
PMCON1,CFGS
PMCON1,WREN
PMCON1,LWLO
;
;
;
;
;
;
;
;
;
;
;
;
;
MOVIW
MOVWF
MOVIW
MOVWF
FSR0++
PMDATL
FSR0++
PMDATH
MOVF
XORLW
ANDLW
BTFSC
GOTO
PMADRL,W
0x1F
0x1F
STATUS,Z
START_WRITE
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
PMADRL,F
LOOP
PMCON1,LWLO
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
;
;
;
;
;
Required
Sequence
LOOP
NOP
INCF
GOTO
Required
Sequence
START_WRITE
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BCF
BSF
PMCON1,WREN
INTCON,GIE
DS40001722C-page 103
PIC16(L)F1703/7
10.3
FIGURE 10-7:
FLASH PROGRAM
MEMORY MODIFY
FLOWCHART
Start
Modify Operation
Read Operation
(Figure10-1
x.x)
Figure
Modify Image
The words to be modified are
changed in the RAM image
Erase Operation
(Figure10-4
x.x)
Figure
Write Operation
use RAM image
(Figure10-6
x.x)
Figure
End
Modify Operation
DS40001722C-page 104
PIC16(L)F1703/7
10.4
TABLE 10-2:
Address
Function
Read Access
Write Access
8000h-8003h
8005h-8006h
8007h-8008h
User IDs
Device ID/Revision ID
Configuration Words 1 and 2
Yes
Yes
Yes
Yes
No
No
EXAMPLE 10-4:
* This code block will read 1 word of program memory at the memory address:
*
PROG_ADDR_LO (must be 00h-08h) data will be returned in the variables;
*
PROG_DATA_HI, PROG_DATA_LO
BANKSEL
MOVLW
MOVWF
CLRF
PMADRL
PROG_ADDR_LO
PMADRL
PMADRH
BSF
BCF
BSF
NOP
NOP
BSF
PMCON1,CFGS
INTCON,GIE
PMCON1,RD
INTCON,GIE
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001722C-page 105
PIC16(L)F1703/7
10.5
Write Verify
FIGURE 10-8:
FLASH PROGRAM
MEMORY VERIFY
FLOWCHART
Start
Verify Operation
Read Operation
(Figure
x.x)
Figure
10-1
PMDAT =
RAM image
?
Yes
No
No
Fail
Verify Operation
Last
Word ?
Yes
End
Verify Operation
DS40001722C-page 106
PIC16(L)F1703/7
10.6
REGISTER 10-1:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDATL<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 10-2:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDATH<13:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 10-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADRL<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
PMADRL<7:0>: Specifies the Least Significant bits for program memory address
REGISTER 10-4:
U-1
R/W-0/0
(1)
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADRH<14:8>
bit 0
bit 7
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6-0
PMADRH<14:8>: Specifies the Most Significant bits for program memory address
Note
1:
Unimplemented, read as 1.
DS40001722C-page 107
PIC16(L)F1703/7
REGISTER 10-5:
U-1
R/W-0/0
R/W-0/0
R/W/HC-0/0
R/W/HC-x/q(2)
R/W-0/0
R/S/HC-0/0
R/S/HC-0/0
(1)
CFGS
LWLO(3)
FREE
WRERR
WREN
WR
RD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
3:
DS40001722C-page 108
PIC16(L)F1703/7
REGISTER 10-6:
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
PMCON2<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
TABLE 10-3:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
CFGS
LWLO
FREE
WRERR
WREN
WR
RD
108
PMCON1
(1)
PMCON2
PMCON2<7:0>
109
PMADRL
PMADR
107
(1)
PMADRH
PMADR<14:8>
PMDATL
PMDATH
Legend:
Note 1:
CONFIG1
CONFIG2
Legend:
107
PMDAT<13:8>
107
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
Unimplemented, read as 1.
TABLE 10-4:
Name
107
PMDAT
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
CLKOUTEN
WDTE<1:0>
Bit 10/2
Bit 9/1
Bit 8/0
BOREN<1:0>
7:0
CP
MCLRE
PWRTE
13:8
LVP
DEBUG
LPBOR
BORV
7:0
ZCDDIS
PPS1WAY
FOSC<1:0>
STVREN
PLLEN
WRT<1:0>
Register
on Page
49
50
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
DS40001722C-page 109
PIC16(L)F1703/7
11.0
I/O PORTS
FIGURE 11-1:
D
Write LATx
Write PORTx
TRISx
CK
VDD
Data Register
Data Bus
I/O pin
Read PORTx
To digital peripherals
To analog peripherals
ANSELx
VSS
PIC16(L)F1703
PIC16(L)F1707
PORTC
Device
PORTB
TABLE 11-1:
Read LATx
DS40001722C-page 110
PIC16(L)F1703/7
11.1
11.1.1
PORTA Registers
DATA REGISTER
11.1.5
11.1.2
DIRECTION CONTROL
11.1.3
11.1.4
11.1.6
ANALOG CONTROL
EXAMPLE 11-1:
;
;
;
;
INITIALIZING PORTA
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
PORTA
PORTA
LATA
LATA
ANSELA
ANSELA
TRISA
B'00111000'
TRISA
;
;Init PORTA
;Data Latch
;
;
;digital I/O
;
;Set RA<5:3> as inputs
;and set RA<2:0> as
;outputs
DS40001722C-page 111
PIC16(L)F1703/7
11.1.7
DS40001722C-page 112
PIC16(L)F1703/7
11.2
REGISTER 11-1:
U-0
U-0
R/W-x/x
R/W-x/x
R-x/x
R/W-x/x
R/W-x/x
R/W-x/x
RA5
RA4
RA3
RA2
RA1
RA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 11-2:
U-0
U-0
R/W-1/1
R/W-1/1
U-1
R/W-1/1
R/W-1/1
R/W-1/1
TRISA5
TRISA4
(1)
TRISA2
TRISA1
TRISA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 1
bit 2-0
Note 1:
Unimplemented, read as 1.
DS40001722C-page 113
PIC16(L)F1703/7
REGISTER 11-3:
U-0
U-0
R/W-x/u
R/W-x/u
U-0
R/W-x/u
R/W-x/u
R/W-x/u
LATA5
LATA4
LATA2
LATA1
LATA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 11-4:
U-0
U-0
U-0
R/W-1/1
U-0
R/W-1/1
R/W-1/1
R/W-1/1
ANSA4
ANSA2
ANSA1
ANSA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
Unimplemented: Read as 0
bit 2-0
ANSA<2:0>: Analog Select between Analog or Digital Function on pins RA<2:0>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
Note 1:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
DS40001722C-page 114
PIC16(L)F1703/7
REGISTER 11-5:
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
Note 1:
2:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
REGISTER 11-6:
U-0
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
ODA5
ODA4
ODA2
ODA1
ODA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS40001722C-page 115
PIC16(L)F1703/7
REGISTER 11-7:
U-0
U-0
R/W-1/1
R/W-1/1
U-0
R/W-1/1
R/W-1/1
R/W-1/1
SLRA5
SLRA4
SLRA2
SLRA1
SLRA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
REGISTER 11-8:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001722C-page 116
PIC16(L)F1703/7
TABLE 11-2:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
114
INLVLA
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
116
LATA
LATA5
LATA4
LATA2
LATA1
LATA0
114
ODCONA
ODA5
ODA4
ODA2
ODA1
ODA0
115
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PORTA
OPTION_REG
RA5
RA4
RA3
SLRCONA
SLRA5
SLRA4
SLRA2
SLRA1
SLRA0
116
TRISA
TRISA5
TRISA4
(1)
TRISA2
TRISA1
TRISA0
113
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
115
WPUA
Legend:
Note 1:
CONFIG1
CONFIG2
Legend:
168
RA1
RA0
113
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTA.
Unimplemented, read as 1.
TABLE 11-3:
Name
PS<2:0>
RA2
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
CLKOUTEN
7:0
CP
MCLRE
PWRTE
13:8
LVP
7:0
ZCDDIS
WDTE<1:0>
DEBUG
LPBOR
Bit 10/2
Bit 9/1
Bit 8/0
BOREN<1:0>
BORV
PPS1WAY
FOSC<1:0>
STVREN
PLLEN
WRT<1:0>
Register
on Page
49
50
DS40001722C-page 117
PIC16(L)F1703/7
11.3
PORTB Registers
(PIC16(L)F1707 only)
11.3.4
11.3.1
DIRECTION CONTROL
11.3.2
11.3.3
11.3.5
DS40001722C-page 118
ANALOG CONTROL
11.3.6
PIC16(L)F1703/7
11.4
REGISTER 11-9:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
U-0
U-0
U-0
U-0
RB7
RB6
RB5
RB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is return of
actual I/O pin values.
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
TRISB7
TRISB6
TRISB5
TRISB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
R/W-x/u
R/W-x/u
R/W-x/u
U-0
U-0
U-0
U-0
LATB7
LATB6
LATB5
LATB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is return of
actual I/O pin values.
DS40001722C-page 119
PIC16(L)F1703/7
REGISTER 11-12: ANSELB: PORTB ANALOG SELECT REGISTER
U-0
U-0
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
ANSB5
ANSB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
ANSB<5:4>: Analog Select between Analog or Digital Function on pins RB<5:4>, respectively
0 = Digital I/O. Pin is assigned to port or digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
bit 3-0
Unimplemented: Read as 0
Note 1:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
WPUB7
WPUB6
WPUB5
WPUB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
DS40001722C-page 120
PIC16(L)F1703/7
REGISTER 11-14: ODCONB: PORTB OPEN DRAIN CONTROL REGISTER
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
ODB7
ODB6
ODB5
ODB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
SLRB7
SLRB6
SLRB5
SLRB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
INLVLB7
INLVLB6
INLVLB5
INLVLB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
DS40001722C-page 121
PIC16(L)F1703/7
TABLE 11-4:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSB5
ANSB4
120
INLVLB7
INLVLB6
INLVLB5
INLVLB4
121
LATB
LATB7
LATB6
LATB5
LATB4
119
ODCONB
ODB7
ODB6
ODB5
ODB4
121
RB7
RB6
RB5
RB4
119
SLRB7
SLRB6
SLRB5
SLRB4
121
Name
ANSELB
INLVLB
PORTB
SLRCONB
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
121
WPUB
WPUB7
WPUB6
WPUB5
WPUB4
120
Legend:
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by
PORTB.
DS40001722C-page 122
PIC16(L)F1703/7
11.5
11.5.1
PORTC Registers
DATA REGISTER
11.5.2
DIRECTION CONTROL
11.5.3
11.5.4
11.5.5
11.5.6
ANALOG CONTROL
11.5.7
DS40001722C-page 123
PIC16(L)F1703/7
11.6
R/W-x/u
(2)
RC6
RC7
(2)
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
RC5
RC4
RC3
RC2
RC1
RC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
RC<7:0>: PORTC General Purpose I/O Pin bits(1, 2)
1 = Port pin is > VIH
0 = Port pin is < VIL
bit 7-0
Note 1:
2:
Writes to PORTC are actually written to corresponding LATC register. Reads from PORTC register is return of actual
I/O pin values.
RC<7:6> are available on PIC16(L)F1707 only.
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
TRISC<7:0>: PORTC Tri-State Control bits(1)
1 = PORTC pin configured as an input (tri-stated)
0 = PORTC pin configured as an output
bit 7-0
Note 1:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LATC7(1)
LATC6(1)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
DS40001722C-page 124
PIC16(L)F1703/7
REGISTER 11-20: ANSELC: PORTC ANALOG SELECT REGISTER
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
ANSC7(2)
ANSC6(2)
ANSC5(3)
ANSC4(3)
ANSC3
ANSC2
ANSC1
ANSC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
ANSC<7:0>: Analog Select between Analog or Digital Function on pins RC<7:0>, respectively(1)
0 = Digital I/O. Pin is assigned to port or digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
bit 7-0
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
ANSC<7:6> are available on PIC16(L)F1707 only.
ANSC<5:4> are available on PIC16(L)F1703 only.
Note 1:
2:
3:
R/W-1/1
(3)
(3)
WPUC6
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUC5
WPUC4
WPUC3
WPUC2
WPUC1
WPUC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
2:
3:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
WPUC<7:6> are available on PIC16(L)F1707 only.
DS40001722C-page 125
PIC16(L)F1703/7
REGISTER 11-22: ODCONC: PORTC OPEN DRAIN CONTROL REGISTER
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ODC7(1)
ODC6(1)
ODC5
ODC4
ODC3
ODC2
ODC1
ODC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
ODC<7:0>: PORTC Open Drain Enable bits(1)
For RC<7:0> pins, respectively
1 = Port pin operates as open-drain drive (sink current only)
0 = Port pin operates as standard push-pull drive (source and sink current)
bit 7-0
Note 1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
SLRC7(1)
SLRC6(1)
SLRC5
SLRC4
SLRC3
SLRC2
SLRC1
SLRC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
SLRC<7:0>: PORTC Slew Rate Enable bits(1)
For RC<7:0> pins, respectively
1 = Port pin slew rate is limited
0 = Port pin slews at maximum rate
bit 7-0
Note 1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
INLVLC7(1)
INLVLC6(1)
INLVLC5
INLVLC4
INLVLC3
INLVLC2
INLVLC1
INLVLC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
DS40001722C-page 126
PIC16(L)F1703/7
TABLE 11-5:
Name
ANSELC
ANSC6(1)
LATC7
(1)
SLRCONC
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSC5(2) ANSC4(2)
ANSC3
ANSC2
ANSC1
ANSC0
125
INLVLC1 INLVLC0
126
Bit 5
(1)
INLVLC6
Bit 4
INLVLC5
INLVLC4
INLVLC3
INLVLC2
(1)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
(1)
LATC6
ODC5
ODC4
ODC3
ODC2
ODC1
ODC0
126
RC6(1)
RC5
RC4
RC3
RC2
RC1
RC0
124
SLRC7(1)
SLRC6(1)
SLRC5
SLRC4
SLRC3
SLRC2
SLRC1
SLRC0
126
(1)
(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
124
(1)
WPUC5
WPUC4
WPUC3
WPUC2
WPUC1
WPUC0
125
TRISC7
(1)
WPUC7
ODC6
124
RC7(1)
ODC7
PORTC
Note 1:
2:
ANSC7(1)
(1)
ODCONC
Legend:
Bit 6
INLVLC7
LATC
WPUC
Bit 7
(1)
INLVLC
TRISC
TRISC6
WPUC6
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by
PORTC.
PIC16(L)F1707 only.
PIC16(L)F1703 only.
DS40001722C-page 127
PIC16(L)F1703/7
12.0
12.1
PPS Inputs
Although every peripheral has its own PPS input selection register, the selections are identical for every
peripheral
as
shown
in
Register 12-1
for
PIC16(L)F1703 devices and Register 12-2 for
PIC16(L)F1707 devices.
Note:
12.2
PPS Outputs
Each I/O pin has a PPS register with which the pin
output source is selected. With few exceptions, the port
TRIS control associated with that pin retains control
over the pin output driver. Peripherals that control the
pin output driver as part of the peripheral operation will
override the TRIS control as needed. These
peripherals include:
MSSP (I2C)
Although every pin has its own PPS peripheral
selection register, the selections are identical for every
pin as shown in Register 12-3.
Note:
FIGURE 12-1:
PPS Inputs
abcPPS
RA0
RA0
Peripheral abc
RxyPPS
Rxy
Peripheral xyz
RC7
xyzPPS
DS40001722C-page 128
RC7PPS
RC7
PIC16(L)F1703/7
12.3
Bidirectional Pins
Note:
12.5
12.6
12.4
PPS Lock
EXAMPLE 12-1:
12.7
Effects of a Reset
PPS LOCK/UNLOCK
SEQUENCE
; suspend interrupts
bcf
INTCON,GIE
;
BANKSEL PPSLOCK
; set bank
; required sequence, next 5 instructions
movlw
0x55
movwf
PPSLOCK
movlw
0xAA
movwf
PPSLOCK
; Set PPSLOCKED bit to disable writes or
; Clear PPSLOCKED bit to enable writes
bsf
PPSLOCK,PPSLOCKED
; restore interrupts
bsf
INTCON,GIE
DS40001722C-page 129
PIC16(L)F1703/7
12.8
REGISTER 12-1:
U-0
U-0
U-0
R/W-q/u
R/W-q/u
R/W-q/u
R/W-q/u
R/W-q/u
xxxPPS<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4-0
DS40001722C-page 130
PIC16(L)F1703/7
REGISTER 12-2:
U-0
U-0
U-0
R/W-q/u
R/W-q/u
R/W-q/u
R/W-q/u
R/W-q/u
xxxPPS<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4-0
DS40001722C-page 131
PIC16(L)F1703/7
REGISTER 12-3:
U-0
U-0
U-0
R/W-0/u
R/W-0/u
R/W-0/u
R/W-0/u
R/W-0/u
RxyPPS<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4-0
Note 1:
DS40001722C-page 132
PIC16(L)F1703/7
REGISTER 12-4:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
PPSLOCKED
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-1
Unimplemented: Read as 0
bit 0
DS40001722C-page 133
PIC16(L)F1703/7
TABLE 12-1:
Name
Bit 1
Bit 0
Register
on page
PPSLOCKED
133
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
PPSLOCK
INTPPS
INTPPS<4:0>
131
T0CKIPPS
T0CKIPPS<4:0>
131
T1CKIPPS
T1CKIPPS<4:0>
131
T1GPPS
T1GPPS<4:0>
131
CCP1PPS
CCP1PPS<4:0>
131
CCP2PPS
CCP2PPS<4:0>
131
SSPCLKPPS
SSPCLKPPS<4:0>
131
SSPDATPPS
SSPDATPPS<4:0>
131
SSPSSPPS
SSPSSPPS<4:0>
131
RA0PPS
RA0PPS<4:0>
132
RA1PPS
RA1PPS<4:0>
132
RA2PPS
RA2PPS<4:0>
132
RA4PPS
RA4PPS<4:0>
132
RA5PPS
RA5PPS<4:0>
132
RB4PPS(1)
RB4PPS<4:0>
132
(1)
RB5PPS<4:0>
132
RB6PPS(1)
RB6PPS<4:0>
132
RB7PPS(1)
RB7PPS<4:0>
132
RC0PPS
RC0PPS<4:0>
132
RC1PPS
RC1PPS<4:0>
132
RC2PPS
RC2PPS<4:0>
132
RC3PPS
RC3PPS<4:0>
132
RC4PPS
RC4PPS<4:0>
132
RC5PPS
RC5PPS<4:0>
132
(1)
RC6PPS<4:0>
132
RC7PPS(1)
RC7PPS<4:0>
132
RB5PPS
RC6PPS
DS40001722C-page 134
PIC16(L)F1703/7
13.0
INTERRUPT-ON-CHANGE
13.1
13.3
Interrupt Flags
13.4
13.2
EXAMPLE 13-1:
MOVLW
XORWF
ANDWF
13.5
CLEARING INTERRUPT
FLAGS
(PORTA EXAMPLE)
0xff
IOCAF, W
IOCAF, F
Operation in Sleep
DS40001722C-page 135
PIC16(L)F1703/7
FIGURE 13-1:
IOCANx
Q4Q1
edge
detect
RAx
IOCAPx
data bus =
0 or 1
write IOCAFx
to data bus
IOCAFx
IOCIE
Q2
IOC interrupt
to CPU core
from all other
IOCnFx individual
pin detectors
FOSC
Q1
Q1
Q3
Q2
Q3
Q4
Q4Q1
Q1
Q2
Q2
Q3
Q4
Q4Q1
DS40001722C-page 136
Q4
Q4Q1
Q4Q1
PIC16(L)F1703/7
13.6
REGISTER 13-1:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 13-2:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 13-3:
U-0
U-0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001722C-page 137
PIC16(L)F1703/7
IOCBP: INTERRUPT-ON-CHANGE PORTB POSITIVE EDGE REGISTER(1)
REGISTER 13-4:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
IOCBP7
IOCBP6
IOCBP5
IOCBP4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note
1:
PIC16(L)F1707 only.
REGISTER 13-5:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
IOCBN7
IOCBN6
IOCBN5
IOCBN4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Note
Unimplemented: Read as 0
1:
PIC16(L)F1707 only.
REGISTER 13-6:
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
U-0
U-0
U-0
U-0
IOCBF7
IOCBF6
IOCBF5
IOCBF4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note
1:
PIC16(L)F1707 only.
DS40001722C-page 138
PIC16(L)F1703/7
REGISTER 13-7:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCCP7(1)
IOCCP6(1)
IOCCP5
IOCCP4
IOCCP3
IOCCP2
IOCCP1
IOCCP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
REGISTER 13-8:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCCN7(1)
IOCCN6(1)
IOCCN5
IOCCN4
IOCCN3
IOCCN2
IOCCN1
IOCCN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
IOCCN<7:0>: Interrupt-on-Change PORTC Negative Edge Enable bits
1 = Interrupt-on-Change enabled on the pin for a negative going edge. IOCCFx bit and IOCIF flag will be set upon
detecting an edge.
0 = Interrupt-on-Change disabled for the associated pin.
bit 7-0
PIC16(L)F1707 only.
Note 1:
REGISTER 13-9:
R/W/HS-0/0
(1)
IOCCF7
R/W/HS-0/0
(1)
IOCCF6
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
IOCCF5
IOCCF4
IOCCF3
IOCCF2
IOCCF1
IOCCF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
PIC16(L)F1707 only.
DS40001722C-page 139
PIC16(L)F1703/7
TABLE 13-1:
Name
ANSELA
(1)
ANSELB
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
ANSA2
ANSA1
ANSA0
114
ANSB4
120
125
(1)
ANSB5
(1)
ANSC3
ANSC2
ANSC1
ANSC0
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
137
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
137
ANSC7
ANSC5
(2)
GIE
ANSELC
INTCON
ANSC6
(2)
ANSC4
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
137
IOCBF(1)
IOCBF7
IOCBF6
IOCBF5
IOCBF4
138
IOCBN(1)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
138
(1)
IOCBP7
IOCBP6
IOCBP5
IOCBP4
138
IOCAP
IOCBP
IOCCF
IOCCF7
IOCCF6(1)
IOCCF5
IOCCF4
IOCCF3
IOCCF2
IOCCF1
IOCCF0
139
IOCCN
IOCCN7(1) IOCCN6(1)
IOCCN5
IOCCN4
IOCCN3
IOCCN2
IOCCN1
IOCCN0
139
IOCCP
IOCCP7(1) IOCCP6(1)
IOCCP5
IOCCP4
IOCCP3
IOCCP2
IOCCP1
IOCCP0
139
TRISA2
TRISA1
TRISA0
113
TRISA
(1)
TRISB
TRISC
Legend:
Note 1:
2:
3:
(1)
TRISB7
TRISC7
(1)
TRISA5
TRISA4
(3)
TRISB6
TRISB5
TRISB4
119
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
124
DS40001722C-page 140
PIC16(L)F1703/7
14.0
FIGURE 14-1:
14.2
14.1
2
X1
X2
X4
FVR_buffer1
(To ADC Module)
X1
X2
X3
FVR_buffer2
(To Op Amp Module)
HFINTOSC Enable
HFINTOSC
To BOR, LDO
FVREN
+
_
FVRRDY
TABLE 14-1:
Peripheral
HFINTOSC
Description
FOSC<1:0> = 00 and
IRCF<3:0> 000x
BOREN<1:0> = 11
BOR
LDO
The device runs off of the ULP regulator when in Sleep mode
D40001722C-page 141
PIC16(L)F1703/7
14.3
REGISTER 14-1:
R/W-0/0
R-q/q
FVREN
FVRRDY(1)
R/W-0/0
TSEN
(3)
R/W-0/0
TSRNG
R/W-0/0
(3)
R/W-0/0
R/W-0/0
CDAFVR<1:0>
R/W-0/0
ADFVR<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
bit 1-0
Note 1:
2:
3:
TABLE 14-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR<1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
142
Shaded cells are not used with the Fixed Voltage Reference.
D40001722C-page 142
PIC16(L)F1703/7
15.0
TEMPERATURE INDICATOR
MODULE
FIGURE 15-1:
VDD
TSEN
TSRNG
15.1
Circuit Operation
EQUATION 15-1:
VOUT RANGES
TEMPERATURE CIRCUIT
DIAGRAM
VOUT
Temp. Indicator
15.2
To ADC
TABLE 15-1:
Low Range: VOUT = VDD - 2VT
3.6V
1.8V
15.3
Temperature Output
DS40001722C-page 143
PIC16(L)F1703/7
15.4
TABLE 15-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR<1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
142
DS40001722C-page 144
PIC16(L)F1703/7
16.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
FIGURE 16-1:
ADPREF = 00
VREF+
FVR_Buffer1
ADPREF = 10
VREF- = VSS
AN0
00000
VREF+/AN1
00001
AN2
00010
AN3
00011
AN4
00100
AN5
00101
AN6
00110
AN7
00111
Ref+ Ref-
AN8
01000
ADC
AN9
01001
AN10
01010
AN11
01011
10
GO/DONE
ADFM
0 = Left Justify
1 = Right Justify
16
ADON
Temp Indicator
11101
FVR_Buffer1
11111
VSS
ADRESH
ADRESL
CHS<4:0>
Note 1:
DS40001722C-page 145
PIC16(L)F1703/7
16.1
ADC Configuration
Port configuration
Channel selection
ADC voltage reference selection
ADC conversion clock source
Interrupt control
Result formatting
16.1.1
PORT CONFIGURATION
16.1.2
CHANNEL SELECTION
16.1.4
CONVERSION CLOCK
The source of the conversion clock is software selectable via the ADCS bits of the ADCON1 register. There
are seven possible clock options:
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (internal RC oscillator)
16.1.3
VREF+ pin
VDD
FVR 2.048V
FVR 4.096V (Not available on LF devices)
VSS
DS40001722C-page 146
PIC16(L)F1703/7
TABLE 16-1:
ADC
Clock Source
ADCS<2:0>
32 MHz
20 MHz
16 MHz
8 MHz
4 MHz
1 MHz
FOSC/2
000
62.5ns(2)
100 ns(2)
125 ns(2)
250 ns(2)
500 ns(2)
2.0 s
FOSC/4
100
125 ns
(2)
(2)
(2)
(2)
FOSC/8
001
0.5 s(2)
400 ns(2)
0.5 s(2)
FOSC/16
101
800 ns
800 ns
010
1.0 s
FOSC/64
110
FRC
x11
FOSC/32
Legend:
Note 1:
2:
3:
4:
1.0 s
4.0 s
1.0 s
2.0 s
8.0 s(3)
1.0 s
2.0 s
4.0 s
16.0 s(3)
1.6 s
2.0 s
4.0 s
2.0 s
3.2 s
4.0 s
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
200 ns
250 ns
500 ns
8.0 s
32.0 s(2)
(3)
8.0 s
16.0 s
(3)
64.0 s(2)
(2)
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
FIGURE 16-2:
TAD2
TAD3
TAD4
TAD5
TAD6
TAD7
TAD8
TAD9
TAD10
TAD11
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
THCD
Conversion Starts
TACQ
DS40001722C-page 147
PIC16(L)F1703/7
16.1.5
INTERRUPTS
16.1.6
RESULT FORMATTING
FIGURE 16-3:
(ADFM = 0)
ADRESL
MSB
LSB
bit 7
bit 0
bit 7
Unimplemented: Read as 0
MSB
bit 7
Unimplemented: Read as 0
DS40001722C-page 148
bit 0
LSB
bit 0
bit 7
bit 0
10-bit ADC Result
PIC16(L)F1703/7
16.2
16.2.1
ADC Operation
STARTING A CONVERSION
16.2.2
COMPLETION OF A CONVERSION
16.2.3
TERMINATING A CONVERSION
16.2.4
16.2.5
AUTO-CONVERSION TRIGGER
The Auto-conversion Trigger allows periodic ADC measurements without software intervention. When a rising
edge of the selected source occurs, the GO/DONE bit
is set by hardware.
The Auto-conversion Trigger source is selected with
the TRIGSEL<3:0> bits of the ADCON2 register.
Using the Auto-conversion Trigger does not assure
proper ADC timing. It is the users responsibility to
ensure that the ADC timing requirements are met.
See Table 16-2 for auto-conversion sources.
TABLE 16-2:
AUTO-CONVERSION
SOURCES
Source Peripheral
Signal Name
CCP1
CCP2
Timer0
T0_overflow
Timer1
T1_overflow
Timer2
T2_match
DS40001722C-page 149
PIC16(L)F1703/7
16.2.6
2.
3.
4.
5.
6.
7.
8.
Configure Port:
Disable pin output driver (Refer to the TRIS
register)
Configure pin as analog (Refer to the ANSEL
register)
Configure the ADC module:
Select ADC conversion clock
Configure voltage reference
Select ADC input channel
Turn on ADC module
Configure ADC interrupt (optional):
Clear ADC interrupt flag
Enable ADC interrupt
Enable peripheral interrupt
Enable global interrupt(1)
Wait the required acquisition time(2).
Start conversion by setting the GO/DONE bit.
Wait for ADC conversion to complete by one of
the following:
Polling the GO/DONE bit
Waiting for the ADC interrupt (interrupts
enabled)
Read ADC Result.
Clear the ADC interrupt flag (required if interrupt
is enabled).
EXAMPLE 16-1:
ADC CONVERSION
DS40001722C-page 150
PIC16(L)F1703/7
16.3
REGISTER 16-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
CHS<4:0>
R/W-0/0
R/W-0/0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-2
bit 1
bit 0
Note 1:
2:
See Section 14.0 Fixed Voltage Reference (FVR) for more information.
See Section 15.0 Temperature Indicator Module for more information.
DS40001722C-page 151
PIC16(L)F1703/7
REGISTER 16-2:
R/W-0/0
R/W-0/0
ADFM
R/W-0/0
R/W-0/0
ADCS<2:0>
U-0
R/W-0/0
ADNREF
R/W-0/0
bit 7
R/W-0/0
ADPREF<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2
bit 1-0
Note 1:
When selecting the VREF+ pin as the source of the positive reference, be aware that a minimum voltage
specification exists. See Table 26-15 for details.
DS40001722C-page 152
PIC16(L)F1703/7
REGISTER 16-3:
R/W-0/0
R/W-0/0
R/W-0/0
TRIGSEL<3:0>
R/W-0/0
(1)
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Note 1:
2:
DS40001722C-page 153
PIC16(L)F1703/7
REGISTER 16-4:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:2>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 16-5:
R/W-x/u
R/W-x/u
ADRES<1:0>
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-0
DS40001722C-page 154
PIC16(L)F1703/7
REGISTER 16-6:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
bit 1-0
REGISTER 16-7:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001722C-page 155
PIC16(L)F1703/7
16.4
EQUATION 16-1:
Assumptions:
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2s + T C + Temperature - 25C 0.05s/C
The value for TC can be approximated with the following equations:
1
= V CHOLD
V AP P LI ED 1 -------------------------n+1
2
1
TC
----------
RC
V AP P LI ED 1 e = V CHOLD
Tc
---------
1
RC
;combining [1] and [2]
V AP P LI ED 1 e = V A PP LIE D 1 -------------------------n+1
2
1
T C = C HOLD R IC + R SS + R S ln(1/2047)
= 10pF 1k + 7k + 10k ln(0.0004885)
= 1.37 s
Therefore:
T A CQ = 2s + 892ns + 50C- 25C 0.05 s/C
= 4.62s
Note 1: The reference voltage (VREF) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
DS40001722C-page 156
PIC16(L)F1703/7
FIGURE 16-4:
Analog
Input
pin
Rs
VT 0.6V
CPIN
5 pF
VA
RIC 1k
Sampling
Switch
SS Rss
I LEAKAGE(1)
VT 0.6V
CHOLD = 10 pF
Ref-
6V
5V
VDD 4V
3V
2V
= Sample/Hold Capacitance
= Input Capacitance
Legend: CHOLD
CPIN
RSS
= Sampling Switch
VT
= Threshold Voltage
Note 1:
FIGURE 16-5:
5 6 7 8 9 10 11
Sampling Switch
(k)
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
3FBh
03h
02h
01h
00h
Ref-
Zero-Scale
Transition
1.5 LSB
Full-Scale
Transition
Ref+
DS40001722C-page 157
PIC16(L)F1703/7
TABLE 16-3:
Name
ADCON0
ADCON1
ADFM
ADCON2
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
Bit 1
Bit 0
Register
on Page
GO/DONE
ADON
151
ADNREF<1:0>
ADPREF<1:0>
152
153
ADRESH
ADRES<7:0>
154, 155
ADRESL
ADRES<7:0>
154, 155
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
114
ANSB5
ANSB4
120
ANSELC
ANSC7(1)
ANSC6(1)
ANSC5(2)
ANSC4(2)
ANSC3
ANSC2
ANSC1
ANSC0
125
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
81
PIE1
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
TRISA5
TRISA4
(3)
TRISA2
TRISA1
TRISA0
113
TRISB7
TRISB6
TRISB5
TRISB4
119
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
124
ANSELB
(1)
TRISA
TRISB(1)
TRISC
Legend:
Note 1:
2:
3:
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for the ADC module.
PIC16(L)F1707 only.
PIC16(L)F1703 only.
Unimplemented, read as 1.
DS40001722C-page 158
PIC16(L)F1703/7
17.0
OPERATIONAL AMPLIFIER
(OPA) MODULES
FIGURE 17-1:
OPAxIN+
0x
Reserved
10
FVR_Buffer2
11
OPAXEN
OPAXSP(1)
OPAxIN-
OPA
OPAXOUT
1
OPAxNCH<1:0>
Note 1:
OPAXUG
DS40001722C-page 159
PIC16(L)F1703/7
17.1
Common-mode voltage range is the specified voltage range for the OPA+ and OPA- inputs, for which the
OPA module will perform to within its specifications.
The OPA module is designed to operate with input voltages between VSS and VDD. Behavior for
common-mode voltages greater than VDD, or below
VSS, are not guaranteed.
Leakage current is a measure of the small source or
sink currents on the OPA+ and OPA- inputs. To
minimize the effect of leakage currents, the effective
impedances connected to the OPA+ and OPA- inputs
should be kept as small as possible and equal.
Input offset voltage is a measure of the voltage
difference between the OPA+ and OPA- inputs in a
closed loop circuit with the OPA in its linear region. The
offset voltage will appear as a DC offset in the output
equal to the input offset voltage, multiplied by the gain
of the circuit. The input offset voltage is also affected by
the common-mode voltage. The OPA is factory
calibrated to minimize the input offset voltage of the
module.
17.1.1
17.1.2
17.2
Effects of Reset
DS40001722C-page 160
PIC16(L)F1703/7
17.3
REGISTER 17-1:
R/W-0/0
R/W-0/0
U-0
R/W-0/0
U-0
U-0
OPAxEN
OPAxSP
OPAxUG
R/W-0/0
R/W-0/0
OPAxPCH<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1-0
TABLE 17-1:
Name
ANSELB(1)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSB5
ANSB4
120
ANSELC
ANSC7(1)
ANSC6(1)
ANSC5(2)
ANSC4(2)
ANSC3
ANSC2
ANSC1
ANSC0
125
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
OPA1CON
OPA1EN
OPA1SP
OPA1UG
OPA2CON
OPA2EN
OPA2SP
OPA2UG
TRISB7
TRISB6
TRISB5
TRISB4
119
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
124
TRISB(1)
TRISC
Legend:
Note 1:
2:
3:
CDAFVR<1:0>
ADFVR<1:0>
142
OPA1PCH<1:0>
161
OPA2PCH<1:0>
161
DS40001722C-page 161
PIC16(L)F1703/7
18.0
ZERO-CROSS DETECTION
(ZCD) MODULE
18.1
EQUATION 18-1:
FIGURE 18-1:
VMAXPEAK
VMINPEAK
VREF
optional
VDD
Vpullup
Rpullup
External current
limiting resistor
Vref
EXTERNAL VOLTAGE
VPEAK
FIGURE 18-2:
EXTERNAL RESISTOR
V PEAK
R SERIES = ---------------4
3 10
Rseries
ZCD pin
Rpulldown
optional
External
voltage
source
ZCDx_output
D
ZCDxPOL
Q1
ZCDxOUT
LE
Interrupt
det
ZCDxINTP
Sets
ZCDIF flag
ZCDxINTN
Interrupt
det
DS40001722C-page 162
PIC16(L)F1703/7
18.2
18.3
18.5
EQUATION 18-2:
18.4
ZCD Interrupts
T OFFSET
V REF
asin ----------------
V PEAK
= -------------------------------2 Freq
T OFFSET
V DD V REF
asin ---------------------------
V PEAK
= ------------------------------------------2 Freq
EQUATION 18-3:
ZCD PULL-UP/DOWN
R SERIES V REF
R PULLDOWN = ------------------------------------ V DD V REF
DS40001722C-page 163
PIC16(L)F1703/7
The pull-up and pull-down resistor values are
significantly affected by small variations of VREF.
Measuring VREF can be difficult, especially when the
waveform is relative to VDD. However, by combining
Equations 18-2 and 18-3, the resistor value can be
determined from the time difference between the
ZCDx_output high and low periods. Note that the time
difference, T, is 4*TOFFSET. The equation for
determining the pull-up and pull-down resistor values
from the high and low ZCDx_output periods is shown in
Equation 18-4. The ZCDx_output signal can be directly
observed on a pin by routing the ZCDx_output signal
through one of the CLCs.
EQUATION 18-4:
V BI A S
R = R SERIES ---------------------------------------------------------------- 1
T
V PE AK sin Freq ----------
18.6
EQUATION 18-5:
V MAXPEAK + V MINPEAK
R SERIES = --------------------------------------------------------4
7 10
18.7
18.8
Effects of a Reset
DS40001722C-page 164
PIC16(L)F1703/7
18.9
REGISTER 18-1:
R/W-q/q
U-0
R-x/x
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
ZCDxEN
ZCDxOUT
ZCDxPOL
ZCDxINTP
ZCDxINTN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1
bit 0
TABLE 18-1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on page
PIE3
ZCDIE
80
PIR3
ZCDIF
83
ZCD1EN
ZCD1OUT
ZCD1POL
Name
ZCD1CON
Legend:
TABLE 18-2:
Name
CONFIG2
Legend:
ZCD1INTP ZCD1INTN
165
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
Bit 10/2
Bit 9/1
Bit 8/0
13:8
LVP
DEBUG
7:0
ZCDDIS
LPBOR
BORV
STVREN
PLLEN
PPS1WAY
WRT<1:0>
Register
on Page
50
= unimplemented location, read as 0. Shaded cells are not used by ZCD module.
DS40001722C-page 165
PIC16(L)F1703/7
19.0
19.1.2
TIMER0 MODULE
19.1
Timer0 Operation
19.1.1
FIGURE 19-1:
FOSC/4
Data Bus
0
T0CKI
Sync
2 TCY
TMR0
TMR0SE TMR0CS
8-bit
Prescaler
PSA
PS<2:0>
DS40001722C-page 166
PIC16(L)F1703/7
19.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
There are eight prescaler options for the Timer0 module ranging from 1:2 to 1:256. The prescale values are
selectable via the PS<2:0> bits of the OPTION_REG
register. In order to have a 1:1 prescaler value for the
Timer0 module, the prescaler must be disabled by
setting the PSA bit of the OPTION_REG register.
The prescaler is not readable or writable. All instructions
writing to the TMR0 register will clear the prescaler.
19.1.4
TIMER0 INTERRUPT
19.1.5
19.1.6
DS40001722C-page 167
PIC16(L)F1703/7
19.2
REGISTER 19-1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
R/W-1/1
R/W-1/1
R/W-1/1
PS<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
TABLE 19-1:
Name
INTCON
Bit Value
Timer0 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
OPTION_REG WPUEN
Bit 6
PEIE
INTEDG
Bit 5
Bit 4
Bit 3
Bit 2
TMR0IE
INTE
IOCIE
TMR0IF
TMR0CS TMR0SE
TMR0
TRISA
PSA
Bit 1
Bit 0
INTF
IOCIF
PS<2:0>
TRISA5
TRISA4
77
168
TMR0
Register
on Page
166*
(1)
TRISA2
TRISA1
TRISA0
113
Legend: = Unimplemented location, read as 0. Shaded cells are not used by the Timer0 module.
* Page provides register information.
Note 1: Unimplemented, read as 1.
DS40001722C-page 168
PIC16(L)F1703/7
20.0
FIGURE 20-1:
T1GSS<1:0>
PPS
T1G
From Timer0
Overflow
01
Reserved
10
Reserved
T1GSPM
00
t1g_in
T1GVAL
0
Single-Pulse
D
CK
R
11
TMR1ON
T1GTM
T1GPOL
Acq. Control
Q1
Data Bus
D
Q
RD
T1GCON
EN
Interrupt
T1GGO/DONE
det
Set
TMR1GIF
TMR1GE
Set flag bit
TMR1IF on
Overflow
To ADC Auto-Conversion
TMR1ON
TMR1(2)
TMR1H
EN
TMR1L
T1CLK
Synchronized
clock input
1
TMR1CS<1:0>
LFINTOSC
T1CKI
PPS
T1SYNC
11
(1)
Synchronize(3)
Prescaler
1, 2, 4, 8
det
10
FOSC
Internal
Clock
01
FOSC/4
Internal
Clock
00
2
T1CKPS<1:0>
FOSC/2
Internal
Clock
Sleep input
DS40001722C-page 169
PIC16(L)F1703/7
20.1
Timer1 Operation
20.2
TABLE 20-1:
TIMER1 ENABLE
SELECTIONS
20.2.1
Timer1
Operation
TMR1ON
TMR1GE
Off
20.2.2
Off
Always On
Count Enabled
TABLE 20-2:
TMR1CS<1:0>
Clock Source
11
LFINTOSC
10
01
00
DS40001722C-page 170
PIC16(L)F1703/7
20.3
Timer1 Prescaler
20.5
20.5.1
20.4
Timer1 Operation in
Asynchronous Counter Mode
20.4.1
Timer1 Gate
TABLE 20-3:
T1CLK
T1GPOL
T1G
Timer1 Operation
Counts
Holds Count
Holds Count
Counts
DS40001722C-page 171
PIC16(L)F1703/7
20.5.2
TABLE 20-4:
T1GSS
00
01
Overflow of Timer0
(TMR0 increments from FFh to 00h)
10
Reserved
11
Reserved
20.5.2.1
20.5.2.2
20.5.3
When Timer1 Gate Toggle mode is enabled, it is possible to measure the full-cycle length of a Timer1 gate
signal, as opposed to the duration of a single level
pulse.
The Timer1 gate source is routed through a flip-flop that
changes state on every incrementing edge of the signal. See Figure 20-4 for timing details.
Timer1 Gate Toggle mode is enabled by setting the
T1GTM bit of the T1GCON register. When the T1GTM
bit is cleared, the flip-flop is cleared and held clear. This
is necessary in order to control which edge is
measured.
Note:
20.5.4
20.5.5
20.5.6
DS40001722C-page 172
PIC16(L)F1703/7
20.6
Timer1 Interrupt
Note:
20.7
20.8
20.9
Section 22.0
FIGURE 20-2:
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
Note 1:
2:
DS40001722C-page 173
PIC16(L)F1703/7
FIGURE 20-3:
TMR1GE
T1GPOL
t1g_in
T1CKI
T1GVAL
Timer1
FIGURE 20-4:
N+1
N+2
N+3
N+4
TMR1GE
T1GPOL
T1GTM
t1g_in
T1CKI
T1GVAL
Timer1
DS40001722C-page 174
N+4
N+8
PIC16(L)F1703/7
FIGURE 20-5:
TMR1GE
T1GPOL
T1GSPM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
Cleared by software
N+1
N+2
Set by hardware on
falling edge of T1GVAL
Cleared by
software
DS40001722C-page 175
PIC16(L)F1703/7
FIGURE 20-6:
TMR1GE
T1GPOL
T1GSPM
T1GTM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
DS40001722C-page 176
Cleared by software
N+1
N+2
N+3
N+4
Set by hardware on
falling edge of T1GVAL
Cleared by
software
PIC16(L)F1703/7
20.10 Register Definitions: Timer1 Control
REGISTER 20-1:
R/W-0/u
R/W-0/u
R/W-0/u
TMR1CS<1:0>
R/W-0/u
T1CKPS<1:0>
U-0
R/W-0/u
U-0
R/W-0/u
T1SYNC
TMR1ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
Unimplemented: Read as 0
bit 0
DS40001722C-page 177
PIC16(L)F1703/7
REGISTER 20-2:
R/W-0/u
R/W-0/u
R/W-0/u
R/W-0/u
R/W/HC-0/u
R-x/x
TMR1GE
T1GPOL
T1GTM
T1GSPM
T1GGO/
DONE
T1GVAL
R/W-0/u
R/W-0/u
T1GSS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
DS40001722C-page 178
PIC16(L)F1703/7
TABLE 20-5:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
114
CCP1CON
DC1B<1:0>
CCP1M<3:0>
CCP2CON
DC2B<1:0>
CCP2M<3:0>
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
Name
INTCON
PIE1
PIR1
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
TRISA
T1CON
T1GCON
Legend:
*
Note 1:
TMR1CS<1:0>
TMR1GE
T1GPOL
TRISA5
TRISA4
T1CKPS<1:0>
T1GTM
T1GSPM
193
193
81
169*
169*
(1)
TRISA2
TRISA1
TRISA0
113
T1SYNC
TMR1ON
177
T1GGO/
DONE
T1GVAL
T1GSS<1:0>
178
= unimplemented location, read as 0. Shaded cells are not used by the Timer1 module.
Page provides register information.
Unimplemented, read as 1.
DS40001722C-page 179
PIC16(L)F1703/7
21.0
TIMER2 MODULE
FIGURE 21-1:
Fosc/4
Prescaler
1:1, 1:4, 1:16, 1:64
T2_match
TMR2
To Peripherals
2
T2CKPS<1:0>
Comparator
Postscaler
1:1 to 1:16
set bit
TMR2IF
4
PR2
DS40001722C-page 180
T2OUTPS<3:0>
PIC16(L)F1703/7
21.1
Timer2 Operation
21.3
Timer2 Output
21.4
21.2
Timer2 Interrupt
DS40001722C-page 181
PIC16(L)F1703/7
21.5
REGISTER 21-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
T2OUTPS<3:0>
R/W-0/0
R/W-0/0
TMR2ON
bit 7
R/W-0/0
T2CKPS<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
DS40001722C-page 182
PIC16(L)F1703/7
TABLE 21-1:
Bit 6
CCP2CON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
PR2
INTCON
PIE1
T2CON
TMR2
Bit 5
Bit 4
Bit 3
DC2B<1:0>
T2OUTPS<3:0>
Bit 2
Bit 1
Bit 0
Register
on Page
Name
CCP2M<3:0>
193
180*
TMR2ON
T2CKPS<1:0>
182
180*
Legend: = unimplemented location, read as 0. Shaded cells are not used for Timer2 module.
* Page provides register information.
DS40001722C-page 183
PIC16(L)F1703/7
22.0
CAPTURE/COMPARE/PWM
MODULES
DS40001722C-page 184
PIC16(L)F1703/7
22.1
22.1.2
Capture Mode
22.1.1
FIGURE 22-1:
Prescaler
1, 4, 16
CAPTURE MODE
OPERATION BLOCK
DIAGRAM
Set Flag bit CCPxIF
(PIRx register)
CCPx
pin
CCPRxH
22.1.3
22.1.4
CCP PRESCALER
EXAMPLE 22-1:
CCPRxL
CHANGING BETWEEN
CAPTURE PRESCALERS
BANKSEL CCPxCON
and
Edge Detect
Capture
Enable
TMR1H
CCPxM<3:0>
System Clock (FOSC)
TMR1L
CLRF
MOVLW
MOVWF
DS40001722C-page 185
PIC16(L)F1703/7
22.1.5
DS40001722C-page 186
PIC16(L)F1703/7
22.2
22.2.2
Compare Mode
FIGURE 22-2:
COMPARE MODE
OPERATION BLOCK
DIAGRAM
CCPxM<3:0>
Mode Select
S
R
Output
Logic
Match
TRIS
Output Enable
Comparator
TMR1H
TMR1L
Auto-conversion Trigger
22.2.1
22.2.3
22.2.4
AUTO-CONVERSION TRIGGER
CCPx
Pin
DS40001722C-page 187
PIC16(L)F1703/7
22.2.5
DS40001722C-page 188
PIC16(L)F1703/7
22.3
PWM Overview
FIGURE 22-3:
Period
Pulse Width
22.3.1
TMR2 = 0
FIGURE 22-4:
CCPR1H(2) (Slave)
CCP1
R
Comparator
(1)
TMR2
S
TRIS
Comparator
TMR2 = PR2
TMR2 = CCPRxH:CCPxCON<5:4>
PR2
Note
1:
2:
Clear Timer,
toggle CCP1 pin and
latch duty cycle
PR2 registers
T2CON registers
CCPRxL registers
CCPxCON registers
Note:
DS40001722C-page 189
PIC16(L)F1703/7
22.3.2
2.
3.
4.
5.
6.
22.3.3
TMR2 is cleared
The CCPx pin is set. (Exception: If the PWM duty
cycle = 0%, the pin will not be set.)
The PWM duty cycle is latched from CCPRxL into
CCPRxH.
Note:
22.3.5
EQUATION 22-2:
EQUATION 22-3:
22.3.4
PULSE WIDTH
CCPRxL:CCPxCON<5:4>
Duty Cycle Ratio = ----------------------------------------------------------------------4 PR2 + 1
PWM PERIOD
EQUATION 22-1:
PWM PERIOD
TOSC = 1/FOSC
DS40001722C-page 190
PIC16(L)F1703/7
22.3.6
PWM RESOLUTION
EQUATION 22-4:
TABLE 22-1:
log 4 PR2 + 1
Resolution = ------------------------------------------ bits
log 2
Note:
PWM Frequency
1.22 kHz
Timer Prescale
PR2 Value
Maximum Resolution (bits)
TABLE 22-2:
PWM RESOLUTION
4.88 kHz
19.53 kHz
78.12 kHz
156.3 kHz
208.3 kHz
16
0xFF
0xFF
0xFF
0x3F
0x1F
0x17
10
10
10
6.6
PWM Frequency
1.22 kHz
4.90 kHz
19.61 kHz
76.92 kHz
153.85 kHz
200.0 kHz
16
0x65
0x65
0x65
0x19
0x0C
0x09
Timer Prescale
PR2 Value
Maximum Resolution (bits)
DS40001722C-page 191
PIC16(L)F1703/7
22.3.7
22.3.8
22.3.9
EFFECTS OF RESET
Any Reset will force all ports to Input mode and the
CCP registers to their Reset states.
TABLE 22-3:
Name
CCP1CON
Bit 6
Bit 5
PIE1
Bit 3
DC1B<1:0>
CCPR1L
INTCON
Bit 4
Bit 2
Bit 1
Bit 0
CCP1M<3:0>
Register
on Page
193
CCPR1L<7:0>
190*
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIE2
BCL1IE
CCP2IE
79
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
PIR2
BCL1IF
CCP2IF
PR2
PR2
RxyPPS
T2CON
TMR2
RxyPPS<4:0>
T2OUTPS<3:0>
82
180*
TMR2ON
132
T2CKPS<1:0>
TMR2
182
180
Legend: = Unimplemented location, read as 0. Shaded cells are not used by the PWM.
* Page provides register information.
Note 1: Unimplemented, read as 1.
DS40001722C-page 192
PIC16(L)F1703/7
22.4
REGISTER 22-1:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
DCxB<1:0>
R/W-0/0
R/W-0/0
R/W-0/0
CCPxM<3:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3-0
0011 =
0010 =
0001 =
0000 =
Reserved
Compare mode: toggle output on match
Reserved
Capture/Compare/PWM off (resets CCPx module)
DS40001722C-page 193
PIC16(L)F1703/7
23.0
MASTER SYNCHRONOUS
SERIAL PORT (MSSP)
MODULE
23.1
Master mode
Slave mode
Clock Parity
Slave Select Synchronization (Slave mode only)
Daisy-chain connection of slave devices
FIGURE 23-1:
Write
SSPxBUF Reg
SDI
SSPSR Reg
SDO
bit 0
SS
SS Control
Enable
Shift
Clock
2 (CKP, CKE)
Clock Select
Edge
Select
SSPM<3:0>
4
SCK
Edge
Select
TRIS bit
DS40001722C-page 194
T2_match
2
Prescaler TOSC
4, 16, 64
Baud Rate
Generator
(SSPxADD)
PIC16(L)F1703/7
The I2C interface supports the following modes and
features:
Master mode
Slave mode
Byte NACKing (Slave mode)
Limited multi-master support
7-bit and 10-bit addressing
Start and Stop interrupts
Interrupt masking
Clock stretching
Bus collision detection
General call address matching
Address masking
Address Hold and Data Hold modes
Selectable SDA hold times
[SSPM<3:0>]
Write
SSP1BUF
Shift
Clock
SDA in
SCL
SCL in
Bus Collision
LSb
Clock Cntl
SSPSR
MSb
SDA
Baud Rate
Generator
(SSPxADD)
FIGURE 23-2:
DS40001722C-page 195
PIC16(L)F1703/7
FIGURE 23-3:
Write
SSPxBUF Reg
SCL
Shift
Clock
SSPSR Reg
SDA
MSb
LSb
SSPMSK Reg
Match Detect
Addr Match
SSPxADD Reg
Start and
Stop bit Detect
DS40001722C-page 196
Set, Reset
S, P bits
(SSPxSTAT Reg)
PIC16(L)F1703/7
23.2
DS40001722C-page 197
PIC16(L)F1703/7
FIGURE 23-4:
SPI Master
SCK
SCK
SDO
SDI
SDI
SDO
General I/O
General I/O
SS
General I/O
SCK
SDI
SDO
SPI Slave
#1
SPI Slave
#2
SS
SCK
SDI
SDO
SPI Slave
#3
SS
23.2.1
and
The
The
The
DS40001722C-page 198
PIC16(L)F1703/7
23.2.2
DS40001722C-page 199
PIC16(L)F1703/7
FIGURE 23-5:
SDI
SDI
Shift Register
(SSPSR)
MSb
LSb
SCK
General I/O
Processor 1
DS40001722C-page 200
SDO
Serial Clock
Slave Select
(optional)
Shift Register
(SSPSR)
MSb
LSb
SCK
SS
Processor 2
PIC16(L)F1703/7
23.2.3
FIGURE 23-6:
Note:
Write to
SSPxBUF
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
4 Clock
Modes
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
SDO
(CKE = 0)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDO
(CKE = 1)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
(SMP = 0)
bit 0
bit 7
Input
Sample
(SMP = 0)
SDI
(SMP = 1)
bit 7
bit 0
Input
Sample
(SMP = 1)
SSPIF
SSPSR to
SSPxBUF
DS40001722C-page 201
PIC16(L)F1703/7
23.2.4
Daisy-Chain Configuration
23.2.5
SLAVE SELECT
SYNCHRONIZATION
DS40001722C-page 202
PIC16(L)F1703/7
FIGURE 23-7:
SPI Master
SCK
SCK
SDO
SDI
SDI
SPI Slave
#1
SDO
General I/O
SS
SCK
SDI
SPI Slave
#2
SDO
SS
SCK
SDI
SPI Slave
#3
SDO
SS
FIGURE 23-8:
SS
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPxBUF
SSPxBUF to
SSPSR
SDO
bit 7
bit 6
bit 7
SDI
bit 6
bit 0
bit 0
bit 7
bit 7
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPxBUF
DS40001722C-page 203
PIC16(L)F1703/7
FIGURE 23-9:
SS
Optional
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPxBUF
Valid
SDO
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
bit 0
bit 7
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPxBUF
Write Collision
detection active
FIGURE 23-10:
SS
Not Optional
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Write to
SSPxBUF
Valid
SDO
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
bit 7
bit 0
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPxBUF
Write Collision
detection active
DS40001722C-page 204
PIC16(L)F1703/7
23.2.6
TABLE 23-1:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
114
ANSELC
ANSC7(2)
ANSC6(2)
ANSC5(3)
ANSC4(3)
ANSC3
ANSC2
ANSC1
ANSC0
125
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
PIE1
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIR1
SSP1IF
CCP1IF
TMR2IF
TMR1IF
INTCON
TMR1GIF
ADIF
RxyPPS
RxyPPS<4:0>
132
SSPCLKPPS
SSPCLKPPS<4:0>
130, 131
SSPDATPPS
SSPDATPPS<4:0>
130, 131
SSPSSPPS
SSPSSPPS<4:0>
130, 131
SSP1BUF
BUF<7:0>
198*
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SSP1STAT
SMP
CKE
D/A
R/W
TRISA5
TRISA4
(1)
TRISA2
TRISB7
TRISB6
TRISB5
TRISB4
TRISC7(2)
TRISC6(2)
TRISC5
TRISC4
TRISC3
TRISC2
TRISA
TRISB(2)
TRISC
Legend:
*
Note 1:
2:
3:
81
SSPM<3:0>
SDAHT
SBCDE
244
AHEN
DHEN
246
UA
BF
242
TRISA1
TRISA0
113
119
TRISC1
TRISC0
124
= Unimplemented location, read as 0. Shaded cells are not used by the MSSP in SPI mode.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1707 only.
PIC16(L)F1703 only.
DS40001722C-page 205
PIC16(L)F1703/7
23.3
VDD
SCL
DS40001722C-page 206
I2C MASTER/
SLAVE CONNECTION
FIGURE 23-11:
SCL
VDD
Master
Slave
SDA
SDA
PIC16(L)F1703/7
When one device is transmitting a logical one, or letting
the line float, and a second device is transmitting a logical zero, or holding the line low, the first device can
detect that the line is not a logical one. This detection,
when used on the SCL line, is called clock stretching.
Clock stretching gives slave devices a mechanism to
control the flow of data. When this detection is used on
the SDA line, it is called arbitration. Arbitration ensures
that there is only one master device communicating at
any single time.
23.3.1
CLOCK STRETCHING
23.3.2
ARBITRATION
Each master device must monitor the bus for Start and
Stop bits. If the device detects that the bus is busy, it
cannot begin a new message until the bus returns to an
Idle state.
However, two master devices may try to initiate a transmission on or about the same time. When this occurs,
the process of arbitration begins. Each transmitter
checks the level of the SDA data line and compares it
to the level that it expects to find. The first transmitter to
observe that the two levels do not match, loses arbitration, and must stop transmitting on the SDA line.
For example, if one transmitter holds the SDA line to a
logical one (lets it float) and a second transmitter holds
it to a logical zero (pulls it low), the result is that the
SDA line will be low. The first transmitter then observes
that the level of the line is different than expected and
concludes that another transmitter is communicating.
The first transmitter to notice this difference is the one
that loses arbitration and must stop driving the SDA
line. If this transmitter is also a master device, it also
must stop driving the SCL line. It then can monitor the
lines for a Stop condition before trying to reissue its
transmission. In the meantime, the other device that
has not noticed any difference between the expected
and actual levels on the SDA line continues with its
original transmission. It can do so without any complications, because so far, the transmission appears
exactly as expected with no other transmitter disturbing
the message.
Slave Transmit mode can also be arbitrated, when a
master addresses multiple slaves, but this is less
common.
If two master devices are sending a message to two
different slave devices at the address stage, the master
sending the lower slave address always wins arbitration. When two master devices send messages to the
same slave address, and addresses can sometimes
refer to multiple slaves, the arbitration process must
continue into the data stage.
Arbitration usually occurs very rarely, but it is a
necessary process for proper multi-master support.
DS40001722C-page 207
PIC16(L)F1703/7
23.4
BYTE FORMAT
TABLE 23-2:
TERM
Transmitter
DS40001722C-page 208
PIC16(L)F1703/7
23.4.5
23.4.7
START CONDITION
RESTART CONDITION
STOP CONDITION
FIGURE 23-12:
SDA
SCL
S
Start
P
Change of
Change of
Data Allowed
Data Allowed
Condition
FIGURE 23-13:
Stop
Condition
Sr
Change of
Change of
Data Allowed
Restart
Data Allowed
Condition
DS40001722C-page 209
PIC16(L)F1703/7
23.4.9
ACKNOWLEDGE SEQUENCE
23.5
DS40001722C-page 210
PIC16(L)F1703/7
23.5.2
SLAVE RECEPTION
23.5.2.2
DS40001722C-page 211
DS40001722C-page 212
SSPOV
BF
SSPIF
A7
A6
A5
A4
A3
A2
A1
ACK
D7
D6
D4
D3
D2
D1
SSPxBUF is read
Cleared by software
D5
Receiving Data
D6
First byte
of data is
available
in SSPxBUF
D0 ACK D7
D4
D3
D2
D1
Cleared by software
D5
Receiving Data
D0
ACK = 1
FIGURE 23-14:
SCL
SDA
Receiving Address
PIC16(L)F1703/7
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 0, DHEN = 0)
CKP
SSPOV
BF
SSPIF
SCL
A7
A6
A5
A4
A3
A2
A1
R/W=0 ACK
SEN
2
D6
D5
D4
D3
D2
D1
D0
SSPxBUF is read
Cleared by software
D7
Receive Data
ACK
SEN
3
D5
D4
D3
First byte
of data is
available
in SSPxBUF
D2
D1
Cleared by software
D6
D7
Receive Data
D0
ACK
FIGURE 23-15:
SDA
Receive Address
PIC16(L)F1703/7
DS40001722C-page 213
DS40001722C-page 214
ACKTIM
CKP
ACKDT
BF
SSPIF
Receiving Address
Slave software
clears ACKDT to
Address is
read from
SSBUF
If AHEN = 1:
SSPIF is set
When AHEN=1:
CKP is cleared by hardware
and SCL is stretched
A7 A6 A5 A4 A3 A2 A1
Receiving Data
9
2
ACKTIM cleared by
hardware in 9th
rising edge of SCL
When DHEN=1:
CKP is cleared by
hardware on 8th falling
edge of SCL
SSPIF is set on
9th falling edge of
SCL, after ACK
ACK D7 D6 D5 D4 D3 D2 D1 D0
Received Data
Slave software
sets ACKDT to
not ACK
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0
ACK
No interrupt
after not ACK
from Slave
ACK=1
Master sends
Stop condition
FIGURE 23-16:
SCL
SDA
PIC16(L)F1703/7
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 1, DHEN = 1)
ACKTIM
CKP
ACKDT
BF
SSPIF
Receiving Address
4
5
6 7
When AHEN = 1;
on the 8th falling edge
of SCL of an address
byte, CKP is cleared
Received
address is loaded into
SSPxBUF
2 3
A7 A6 A5 A4 A3 A2 A1
ACK
Receive Data
2 3
6 7
When DHEN = 1;
on the 8th falling edge
of SCL of a received
data byte, CKP is cleared
Received data is
available on SSPxBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0
ACK
Receive Data
1
3 4
6 7
Set by software,
release SCL
Slave sends
not ACK
SSPxBUF can be
read any time before
next byte is loaded
D7 D6 D5 D4 D3 D2 D1 D0
ACK
No interrupt after
if not ACK
from Slave
Master sends
Stop condition
FIGURE 23-17:
SCL
SDA
R/W = 0
Master releases
SDA to slave for ACK sequence
PIC16(L)F1703/7
DS40001722C-page 215
PIC16(L)F1703/7
23.5.3
SLAVE TRANSMISSION
23.5.3.2
7-bit Transmission
1.
23.5.3.1
DS40001722C-page 216
D/A
R/W
ACKSTAT
CKP
BF
SSPIF
Receiving Address
Indicates an address
has been received
R/W = 1 Automatic
ACK
Received address
is read from SSPxBUF
A7 A6 A5 A4 A3 A2 A1
Transmitting Data
Automatic
Set by software
Data to transmit is
loaded into SSPxBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Transmitting Data
CKP is not
held for not
ACK
BF is automatically
cleared after 8th falling
edge of SCL
D7 D6 D5 D4 D3 D2 D1 D0
9
ACK
FIGURE 23-18:
SCL
SDA
Master sends
Stop condition
PIC16(L)F1703/7
DS40001722C-page 217
PIC16(L)F1703/7
23.5.3.3
DS40001722C-page 218
D/A
R/W
ACKTIM
CKP
ACKSTAT
ACKDT
BF
SSPIF
Receiving Address
Slave clears
ACKDT to ACK
address
ACK
When R/W = 1;
CKP is always
cleared after ACK
R/W = 1
Received address
is read from SSPxBUF
When AHEN = 1;
CKP is cleared by hardware
after receiving matching
address.
A7 A6 A5 A4 A3 A2 A1
3
Cleared by software
Set by software,
releases SCL
Data to transmit is
loaded into SSPxBUF
Transmitting Data
Automatic
D7 D6 D5 D4 D3 D2 D1 D0 ACK
ACKTIM is cleared
on 9th rising edge of SCL
Automatic
Transmitting Data
Masters ACK
response is copied
to SSPxSTAT
BF is automatically
cleared after 8th falling
edge of SCL
D7 D6 D5 D4 D3 D2 D1 D0
9
ACK
Master sends
Stop condition
FIGURE 23-19:
SCL
SDA
PIC16(L)F1703/7
DS40001722C-page 219
PIC16(L)F1703/7
23.5.4
3.
4.
5.
6.
7.
8.
23.5.5
DS40001722C-page 220
CKP
UA
BF
SSPIF
0 A9 A8
Set by hardware
on 9th falling edge
When UA = 1;
SCL is held low
ACK
If address matches
SSPxADD it is loaded into
SSPxBUF
A7 A6 A5 A4 A3 A2 A1 A0 ACK
9
1
Data is read
from SSPxBUF
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Receive Data
Set by software,
When SEN = 1;
releasing SCL
CKP is cleared after
9th falling edge of received byte
Receive address is
read from SSPxBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Receive Data
FIGURE 23-20:
SCL
SDA
Master sends
Stop condition
PIC16(L)F1703/7
DS40001722C-page 221
DS40001722C-page 222
ACKTIM
CKP
UA
ACKDT
BF
A9
A8
Set by hardware
on 9th falling edge
If when AHEN = 1;
on the 8th falling edge
of SCL of an address
byte, CKP is cleared
R/W = 0
ACK
UA
A6
A5
A4
A3
A2
A1
Update to SSPxADD is
not allowed until 9th
falling edge of SCL
SSPxBUF can be
read anytime before
the next received byte
Cleared by software
A7
A0
ACK
UA
D6
D5
D4
D2
D1
Update of SSPxADD,
clears UA and releases
SCL
D3
Receive Data
Cleared by software
D7
Received data
is read from
SSPxBUF
D6 D5
Receive Data
D0 ACK D7
FIGURE 23-21:
SSPIF
SCL
SDA
PIC16(L)F1703/7
I2C SLAVE, 10-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 1, DHEN = 0)
D/A
R/W
ACKSTAT
CKP
UA
BF
SSPIF
Set by hardware
Indicates an address
has been received
UA indicates SSPxADD
must be updated
SSPxBUF loaded
with received address
SCL
1
3
7 8
After SSPxADD is
updated, UA is cleared
and SCL is released
Cleared by software
A7 A6 A5 A4 A3 A2 A1 A0 ACK
1
4
7 8
Set by hardware
2 3
When R/W = 1;
CKP is cleared on
9th falling edge of SCL
Received address is
read from SSPxBUF
Sr
1 1 1 1 0 A9 A8
ACK
Set by software
releases SCL
Data to transmit is
loaded into SSPxBUF
D7 D6 D5 D4 D3 D2 D1 D0
Master sends
Stop condition
ACK = 1
Master sends
not ACK
FIGURE 23-22:
SDA
Master sends
Restart event
PIC16(L)F1703/7
DS40001722C-page 223
PIC16(L)F1703/7
23.5.6
CLOCK STRETCHING
23.5.6.2
FIGURE 23-23:
Byte NACKing
Any time the CKP bit is cleared, the module will wait
for the SCL line to go low and then hold it. However,
clearing the CKP bit will not assert the SCL output low
until the SCL output is already sampled low. Therefore, the CKP bit will not assert the SCL line until an
external I2C master device has already asserted the
SCL line. The SCL output will remain low until the CKP
bit is set and all other devices on the I2C bus have
released SCL. This ensures that a write to the CKP bit
will not violate the minimum high time requirement for
SCL (see Figure 23-23).
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
SDA
DX 1
DX
SCL
CKP
Master device
asserts clock
Master device
releases clock
WR
SSPxCON1
DS40001722C-page 224
PIC16(L)F1703/7
23.5.8
FIGURE 23-24:
SDA
SCL
S
Receiving Data
ACK
D6
D5
D4
D3
D2
D1
D0
SSPIF
BF (SSPxSTAT<0>)
Cleared by software
GCEN (SSPCON2<7>)
SSPxBUF is read
1
23.5.9
DS40001722C-page 225
PIC16(L)F1703/7
23.6
23.6.1
DS40001722C-page 226
PIC16(L)F1703/7
23.6.2
CLOCK ARBITRATION
FIGURE 23-25:
SDA
DX 1
DX
SCL deasserted but slave holds
SCL low (clock arbitration)
SCL
BRG decrements on
Q2 and Q4 cycles
BRG
Value
03h
02h
01h
03h
02h
23.6.3
DS40001722C-page 227
PIC16(L)F1703/7
23.6.4
CONDITION TIMING
FIGURE 23-26:
SDA = 1,
SCL = 1
TBRG
TBRG
SDA
2nd bit
1st bit
TBRG
SCL
S
DS40001722C-page 228
TBRG
PIC16(L)F1703/7
23.6.5
FIGURE 23-27:
Write to SSPCON2
occurs here
SDA = 1,
SCL (no change)
SDA = 1,
SCL = 1
TBRG
TBRG
TBRG
1st bit
SDA
Sr
TBRG
Repeated Start
DS40001722C-page 229
PIC16(L)F1703/7
23.6.6
23.6.6.1
BF Status Flag
23.6.6.3
7.
8.
9.
10.
11.
12.
13.
23.6.6.2
DS40001722C-page 230
R/W
PEN
SEN
BF (SSPxSTAT<0>)
SSPIF
SCL
SDA
A6
A5
A4
A3
A2
A1
Cleared by software
SSPxBUF written
D7
1
SCL held low
while CPU
responds to SSPIF
ACK = 0
R/W = 0
A7
D5
D4
D3
D2
D1
D0
D6
Cleared by software
ACK
ACKSTAT in
SSPCON2 = 1
FIGURE 23-28:
SEN = 0
PIC16(L)F1703/7
DS40001722C-page 231
PIC16(L)F1703/7
23.6.7
23.6.7.1
BF Status Flag
23.6.7.4
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
23.6.7.2
12.
13.
14.
23.6.7.3
15.
DS40001722C-page 232
RCEN
ACKEN
SSPOV
BF
(SSPxSTAT<0>)
SDA = 0, SCL = 1
while CPU
responds to SSPIF
SSPIF
SCL
SDA
A7
4
5
Cleared by software
A6 A5 A4 A3 A2
7
8
ACK
D0
ACK
RCEN cleared
automatically
5
6
Cleared by software
Cleared in
software
ACK
RCEN cleared
automatically
P
Set SSPIF interrupt
at end of Acknowledge sequence
Bus master
terminates
transfer
Set P bit
(SSPxSTAT<4>)
and SSPIF
PEN bit = 1
written here
D0
RCEN cleared
automatically
D7 D6 D5 D4 D3 D2 D1
Cleared by software
Cleared by software
D7 D6 D5 D4 D3 D2 D1
A1 R/W
RCEN = 1, start
next receive
FIGURE 23-29:
RCEN cleared
automatically
SEN = 0
Write to SSPxBUF occurs here,
ACK from Slave
start XMIT
Write to SSPCON2<4>
to start Acknowledge sequence
SDA = ACKDT (SSPCON2<5>) = 0
PIC16(L)F1703/7
DS40001722C-page 233
PIC16(L)F1703/7
23.6.8
ACKNOWLEDGE SEQUENCE
TIMING
23.6.9
23.6.8.1
23.6.9.1
FIGURE 23-30:
TBRG
SDA
ACK
D0
SCL
SSPIF
SSPIF set at
the end of receive
Cleared in
software
Cleared in
software
SSPIF set at the end
of Acknowledge sequence
FIGURE 23-31:
Write to SSPCON2,
set PEN
Falling edge of
9th clock
TBRG
SCL
SDA
ACK
P
TBRG
TBRG
TBRG
DS40001722C-page 234
PIC16(L)F1703/7
23.6.10
SLEEP OPERATION
23.6.13
23.6.11
EFFECTS OF A RESET
23.6.12
MULTI-MASTER MODE
Address Transfer
Data Transfer
A Start Condition
A Repeated Start Condition
An Acknowledge Condition
Multi-Master mode support is achieved by bus arbitration. When the master outputs address/data bits onto
the SDA pin, arbitration takes place when the master
outputs a 1 on SDA, by letting SDA float high and
another master asserts a 0. When the SCL pin floats
high, data should be stable. If the expected data on
SDA is a 1 and the data sampled on the SDA pin is 0,
then a bus collision has taken place. The master will set
the Bus Collision Interrupt Flag, BCLIF and reset the
I2C port to its Idle state (Figure 23-32).
If a transmit was in progress when the bus collision
occurred, the transmission is halted, the BF flag is
cleared, the SDA and SCL lines are deasserted and the
SSPxBUF can be written to. When the user services
the bus collision Interrupt Service Routine and if the I2C
bus is free, the user can resume communication by
asserting a Start condition.
If a Start, Repeated Start, Stop or Acknowledge condition was in progress when the bus collision occurred, the
condition is aborted, the SDA and SCL lines are
deasserted and the respective control bits in the
SSPCON2 register are cleared. When the user services
the bus collision Interrupt Service Routine and if the I2C
bus is free, the user can resume communication by
asserting a Start condition.
The master will continue to monitor the SDA and SCL
pins. If a Stop condition occurs, the SSPIF bit will be set.
A write to the SSPxBUF will start the transmission of
data at the first data bit, regardless of where the
transmitter left off when the bus collision occurred.
In Multi-Master mode, the interrupt generation on the
detection of Start and Stop conditions allows the determination of when the bus is free. Control of the I2C bus
can be taken when the P bit is set in the SSPxSTAT
register, or the bus is Idle and the S and P bits are
cleared.
FIGURE 23-32:
SDA
SCL
BCLIF
DS40001722C-page 235
PIC16(L)F1703/7
23.6.13.1
FIGURE 23-33:
SDA
SCL
Set SEN, enable Start
condition if SDA = 1, SCL = 1
SEN
BCLIF
SSPIF
SSPIF and BCLIF are
cleared by software
DS40001722C-page 236
PIC16(L)F1703/7
FIGURE 23-34:
TBRG
SDA
Set SEN, enable Start
sequence if SDA = 1, SCL = 1
SCL
SEN
SCL = 0 before BRG time-out,
bus collision occurs. Set BCLIF.
BCLIF
Interrupt cleared
by software
S
SSPIF
FIGURE 23-35:
SDA
Set SSPIF
TBRG
SCL
SEN
BCLIF
SSPIF
SDA = 0, SCL = 1,
set SSPIF
Interrupts cleared
by software
DS40001722C-page 237
PIC16(L)F1703/7
23.6.13.2
FIGURE 23-36:
If, at the end of the BRG time-out, both SCL and SDA
are still high, the SDA pin is driven low and the BRG is
reloaded and begins counting. At the end of the count,
regardless of the status of the SCL pin, the SCL pin is
driven low and the Repeated Start condition is
complete.
SDA
SCL
Sample SDA when SCL goes high.
If SDA = 0, set BCLIF and release SDA and SCL.
RSEN
BCLIF
Cleared by software
S
SSPIF
FIGURE 23-37:
TBRG
SDA
SCL
BCLIF
RSEN
S
SSPIF
DS40001722C-page 238
PIC16(L)F1703/7
23.6.13.3
b)
FIGURE 23-38:
TBRG
TBRG
SDA
SDA sampled
low after TBRG,
set BCLIF
SSPIF
FIGURE 23-39:
TBRG
TBRG
SDA
Assert SDA
SCL
PEN
BCLIF
P
SSPIF
DS40001722C-page 239
PIC16(L)F1703/7
TABLE 23-3:
Name
Bit 6
ANSELA
ANSELB(1)
ANSELC
INTCON
Reset
Values on
Page:
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
ANSA4
ANSA2
ANSA1
ANSA0
114
ANSB5
ANSB4
120
ANSC7(1)
ANSC6(1)
ANSC5(2)
ANSC4(2)
ANSC3
ANSC2
ANSC1
ANSC0
125
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
77
PIE1
TMR1GIE
ADIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
78
PIE2
BCL1IE
CCP2IE
79
PIR1
TMR1GIF
ADIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
81
PIR2
BCL1IF
CCP2IF
RxyPPS
82
RxyPPS<4:0>
132
SSPCLKPPS
SSPCLKPPS<4:0>
130, 131
SSPDATPPS
SSPDATPPS<4:0>
130, 131
SSPSSPPS
SSPSSPPS<4:0>
130, 131
SSP1ADD
ADD<7:0>
SSP1BUF
SSP1CON1
248
198*
WCOL
SSPOV
SSPEN
CKP
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
245
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
246
SMP
CKE
D/A
R/W
UA
BF
242
TRISA5
TRISA4
(3)
TRISA2
TRISA1
TRISA0
113
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
119
TRISC
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
124
SSP1MSK
SSP1STAT
TRISA
(1)
Legend:
*
Note 1:
2:
3:
SSPM<3:0>
244
MSK<7:0>
248
= unimplemented location, read as 0. Shaded cells are not used by the MSSP module in I C mode.
Page provides register information.
PIC16(L)F1707 only.
PIC16(L)F1703 only.
Unimplemented, read as 1.
DS40001722C-page 240
PIC16(L)F1703/7
23.7
The MSSP module has a Baud Rate Generator available for clock generation in both I2C and SPI Master
modes. The Baud Rate Generator (BRG) reload value
is placed in the SSPxADD register (Register 23-6).
When a write occurs to SSPxBUF, the Baud Rate
Generator will automatically begin counting down.
Once the given operation is complete, the internal clock
will automatically stop counting and the clock pin will
remain in its last state.
EQUATION 23-1:
FOSC
FCLOCK = ------------------------------------------------ SSPxADD + 1 4
FIGURE 23-40:
SSPM<3:0>
Reload
SSPxADD<7:0>
Reload
Control
SCL
SSPCLK
FOSC/2
TABLE 23-4:
Note:
FOSC
FCY
BRG Value
FCLOCK
(2 Rollovers of BRG)
32 MHz
8 MHz
13h
400 kHz
32 MHz
8 MHz
19h
308 kHz
32 MHz
8 MHz
4Fh
100 kHz
16 MHz
4 MHz
09h
400 kHz
16 MHz
4 MHz
0Ch
308 kHz
16 MHz
4 MHz
27h
100 kHz
4 MHz
1 MHz
09h
100 kHz
Refer to the I/O port electrical specifications in Table 26-4 to ensure the system is designed to support IOL
requirements.
DS40001722C-page 241
PIC16(L)F1703/7
23.8
REGISTER 23-1:
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R-0/0
R-0/0
R-0/0
R-0/0
SMP
CKE
D/A
R/W
UA
BF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 4
P: Stop bit
(I2C mode only. This bit is cleared when the MSSP 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 MSSP 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
In I2 C Master mode:
1 = Transmit is in progress
0 = Transmit is not in progress
OR-ing this bit with SEN, RSEN, PEN, RCEN or ACKEN will indicate if the MSSP is in Idle mode.
bit 1
DS40001722C-page 242
PIC16(L)F1703/7
REGISTER 23-1:
bit 0
DS40001722C-page 243
PIC16(L)F1703/7
REGISTER 23-2:
R/C/HS-0/0
R/C/HS-0/0
R/W-0/0
R/W-0/0
WCOL
SSPOV(1)
SSPEN
CKP
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
SSPM<3:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
C = User cleared
bit 7
bit 6
bit 5
bit 4
bit 3-0
Note
1:
2:
3:
4:
5:
In Master mode, the overflow bit is not set since each new reception (and transmission) is initiated by writing to the SSPxBUF register.
When enabled, these pins must be properly configured as input or output. Use SSPSSPPS, SSPCLKPPS, SSPDATPPS, and RxyPPS
to select the pins.
When enabled, the SDA and SCL pins must be configured as inputs. Use SSPCLKPPS, SSPDATPPS, and RxyPPS to select the pins.
SSPxADD values of 0, 1 or 2 are not supported for I2C mode.
SSPxADD value of 0 is not supported. Use SSPM = 0000 instead.
DS40001722C-page 244
PIC16(L)F1703/7
SSP1CON2: SSP CONTROL REGISTER 2(1)
REGISTER 23-3:
R/W-0/0
R-0/0
R/W-0/0
R/S/HS-0/0
R/S/HS-0/0
R/S/HS-0/0
R/S/HS-0/0
R/W/HS-0/0
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
HC = Cleared by hardware
S = User set
bit 7
GCEN: General Call Enable bit (in I2C Slave mode only)
1 = Enable interrupt when a general call address (0x00 or 00h) is received in the SSPSR
0 = General call address disabled
bit 6
bit 5
bit 4
ACKEN: Acknowledge Sequence Enable bit (in I2C Master mode only)
In Master Receive mode:
1 = Initiate Acknowledge sequence on SDA and SCL pins, and transmit ACKDT data bit.
Automatically cleared by hardware.
0 = Acknowledge sequence idle
bit 3
bit 2
PEN: Stop Condition Enable bit (in I2C Master mode only)
SCKMSSP Release Control:
1 = Initiate Stop condition on SDA and SCL pins. Automatically cleared by hardware.
0 = Stop condition Idle
bit 1
RSEN: Repeated Start Condition Enable bit (in I2C Master mode only)
1 = Initiate Repeated Start condition on SDA and SCL pins. Automatically cleared by hardware.
0 = Repeated Start condition Idle
bit 0
Note 1:
For bits ACKEN, RCEN, PEN, RSEN, SEN: If the I2C module is not in the Idle mode, this bit may not be
set (no spooling) and the SSPxBUF may not be written (or writes to the SSPxBUF are disabled).
DS40001722C-page 245
PIC16(L)F1703/7
REGISTER 23-4:
R-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ACKTIM(3)
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
SBCDE: Slave Mode Bus Collision Detect Enable bit (I2C Slave mode only)
If, on the rising edge of SCL, SDA is sampled low when the module is outputting a high state, the
BCL1IF bit of the PIR2 register is set, and bus goes idle
1 = Enable slave bus collision interrupts
0 = Slave bus collision interrupts are disabled
bit 1
bit 0
DS40001722C-page 246
PIC16(L)F1703/7
REGISTER 23-4:
Note 1:
2:
3:
For daisy-chained SPI operation; allows the user to ignore all but the last received byte. SSPOV is still set
when a new byte is received and BF = 1, but hardware continues to write the most recent byte to
SSPxBUF.
This bit has no effect in Slave modes that Start and Stop condition detection is explicitly listed as enabled.
The ACKTIM Status bit is only active when the AHEN bit or DHEN bit is set.
DS40001722C-page 247
PIC16(L)F1703/7
REGISTER 23-5:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
MSK<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-1
bit 0
REGISTER 23-6:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ADD<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
Master mode:
bit 7-0
Not used: Unused for Most Significant Address Byte. Bit state of this register is a dont care. Bit
pattern sent by master is fixed by I2C specification and must be equal to 11110. However, those bits
are compared by hardware and are not affected by the value in this register.
bit 2-1
bit 0
bit 0
DS40001722C-page 248
PIC16(L)F1703/7
24.0
IN-CIRCUIT SERIAL
PROGRAMMING (ICSP)
24.1
24.2
24.3
FIGURE 24-1:
VDD
ICSPDAT
NC
2 4 6
ICSPCLK
1 3 5
Target
VPP/MCLR
VSS
PC Board
Bottom Side
Pin Description*
1 = VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
DS40001722C-page 249
PIC16(L)F1703/7
FIGURE 24-2:
Pin 1 Indicator
Pin Description*
1 = VPP/MCLR
1
2
3
4
5
6
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
FIGURE 24-3:
Device to be
Programmed
VDD
VDD
VDD
VPP
MCLR/VPP
VSS
VSS
Data
ICSPDAT
Clock
ICSPCLK
To Normal Connections
DS40001722C-page 250
PIC16(L)F1703/7
25.0
25.1
Read-Modify-Write Operations
Byte Oriented
Bit Oriented
Literal and Control
TABLE 25-1:
Each instruction is a 14-bit word containing the operation code (opcode) and all required operands. The
opcodes are broken into three broad categories.
OPCODE FIELD
DESCRIPTIONS
Field
f
Description
Register file address (0x00 to 0x7F)
mm
TABLE 25-2:
ABBREVIATION
DESCRIPTIONS
Field
Program Counter
TO
Time-Out bit
C
DC
Z
PD
Description
PC
Carry bit
Digit Carry bit
Zero bit
Power-Down bit
DS40001722C-page 251
PIC16(L)F1703/7
FIGURE 25-1:
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 #)
General
13
OPCODE
0
k (literal)
OPCODE
k (literal)
0
k (literal)
5 4
0
k (literal)
0
k (literal)
6
n
0
k (literal)
n = appropriate FSR
k = 6-bit immediate value
FSR Increment instructions
13
OPCODE
2 1
0
n m (mode)
n = appropriate FSR
m = 2-bit mode value
OPCODE only
13
0
OPCODE
DS40001722C-page 252
PIC16(L)F1703/7
TABLE 25-3:
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
ADDWF
ADDWFC
ANDWF
ASRF
LSLF
LSRF
CLRF
CLRW
COMF
DECF
INCF
IORWF
MOVF
MOVWF
RLF
RRF
SUBWF
SUBWFB
SWAPF
XORWF
f, d
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f, d
Add W and f
Add with Carry W and f
AND W with f
Arithmetic Right Shift
Logical Left Shift
Logical Right Shift
Clear f
Clear W
Complement f
Decrement f
Increment f
Inclusive OR W with f
Move f
Move W to f
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Subtract with Borrow W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
00
11
00
11
11
11
00
00
00
00
00
00
00
00
00
00
00
11
00
00
0111
1101
0101
0111
0101
0110
0001
0001
1001
0011
1010
0100
1000
0000
1101
1100
0010
1011
1110
0110
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0000
dfff
dfff
dfff
dfff
dfff
1fff
dfff
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
00xx
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
C, DC, Z
C, DC, Z
Z
C, Z
C, Z
C, Z
Z
Z
Z
Z
Z
Z
Z
C
C
C, DC, Z
C, DC, Z
Z
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
DECFSZ
INCFSZ
f, d
f, d
Decrement f, Skip if 0
Increment f, Skip if 0
BCF
BSF
f, b
f, b
Bit Clear f
Bit Set f
1(2)
1(2)
00
00
1, 2
1, 2
1
1
01
01
2
2
1, 2
1, 2
BTFSC
BTFSS
f, b
f, b
1 (2)
1 (2)
01
01
1
1
1
1
1
1
1
1
11
11
11
00
11
11
11
11
1110
1001
1000
0000
0001
0000
1100
1010
LITERAL OPERATIONS
ADDLW
ANDLW
IORLW
MOVLB
MOVLP
MOVLW
SUBLW
XORLW
k
k
k
k
k
k
k
k
Note 1:
If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require
one additional instruction cycle.
2:
kkkk
kkkk
kkkk
001k
1kkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
C, DC, Z
Z
Z
C, DC, Z
Z
DS40001722C-page 253
PIC16(L)F1703/7
TABLE 25-3:
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
CONTROL OPERATIONS
BRA
BRW
CALL
CALLW
GOTO
RETFIE
RETLW
RETURN
k
k
k
Relative Branch
Relative Branch with W
Call Subroutine
Call Subroutine with W
Go to address
Return from interrupt
Return with literal in W
Return from Subroutine
2
2
2
2
2
2
2
2
CLRWDT
NOP
OPTION
RESET
SLEEP
TRIS
ADDFSR
MOVIW
n, k
n mm
MOVWI
k[n]
n mm
11
00
10
00
10
00
11
00
001k
0000
0kkk
0000
1kkk
0000
0100
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
1011
kkkk
1010
kkkk
1001
kkkk
1000
00
00
00
00
00
00
0000
0000
0000
0000
0000
0000
0110
0000
0110
0000
0110
0110
0100 TO, PD
0000
0010
0001
0011 TO, PD
0fff
INHERENT OPERATIONS
1
1
1
1
1
1
C-COMPILER OPTIMIZED
k[n]
Note 1:
2:
3:
1
1
11
00
2, 3
1
1
11
00
2
2, 3
11
If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require
one additional instruction cycle.
See Table in the MOVIW and MOVWI instruction descriptions.
DS40001722C-page 254
PIC16(L)F1703/7
25.2
Instruction Descriptions
ADDFSR
ANDLW
Syntax:
Syntax:
[ label ] ANDLW
Operands:
-32 k 31
n [ 0, 1]
Operands:
0 k 255
Operation:
FSR(n) + k FSR(n)
Status Affected:
None
Description:
Operation:
Status Affected:
Description:
ANDWF
AND W with f
ADDLW
Syntax:
[ label ] ADDLW
Operands:
0 k 255
Operation:
Status Affected:
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d 0,1
(W) + k (W)
Operation:
C, DC, Z
Status Affected:
Description:
Description:
ASRF
ADDWF
Add W and f
Syntax:
[ label ] ADDWF
Operands:
0 f 127
d 0,1
Operation:
Status Affected:
C, DC, Z
Description:
ADDWFC
f,d
Syntax:
[ label ] ADDWFC
Operands:
0 f 127
d [0,1]
Operation:
Syntax:
[ label ] ASRF
Operands:
0 f 127
d [0,1]
f {,d}
Operation:
(f<7>) dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
f {,d}
Status Affected:
C, DC, Z
Description:
Add W, the Carry flag and data memory location f. If d is 0, the result is
placed in W. If d is 1, the result is
placed in data memory location f.
f,d
DS40001722C-page 255
PIC16(L)F1703/7
BCF
Bit Clear f
Syntax:
[ label ] BCF
BTFSC
f,b
Syntax:
Operands:
0 f 127
0b7
Operands:
Operation:
0 (f<b>)
Operation:
skip if (f<b>) = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
BRA
Relative Branch
BTFSS
Syntax:
Syntax:
Operands:
0 f 127
0b<7
Operands:
Operation:
skip if (f<b>) = 1
Operation:
(PC) + 1 + k PC
Status Affected:
None
Status Affected:
None
Description:
Description:
BRW
Syntax:
[ label ] BRW
Operands:
None
Operation:
(PC) + (W) PC
Status Affected:
None
Description:
BSF
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
None
Description:
DS40001722C-page 256
f,b
PIC16(L)F1703/7
CALL
Call Subroutine
CLRWDT
Syntax:
[ label ] CALL k
Syntax:
[ label ] CLRWDT
Operands:
0 k 2047
Operands:
None
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<6:3>) PC<14:11>
Operation:
Status Affected:
None
00h WDT
0 WDT prescaler,
1 TO
1 PD
Description:
Status Affected:
TO, PD
Description:
CLRWDT instruction resets the Watchdog Timer. It also resets the prescaler
of the WDT. Status bits TO and PD
are set.
CALLW
COMF
Complement f
Syntax:
[ label ] CALLW
Syntax:
[ label ] COMF
Operands:
None
Operands:
Operation:
(PC) +1 TOS,
(W) PC<7:0>,
(PCLATH<6:0>) PC<14:8>
0 f 127
d [0,1]
Operation:
(f) (destination)
Status Affected:
Description:
DECF
Decrement f
Syntax:
Status Affected:
None
Description:
CLRF
Clear f
Syntax:
[ label ] CLRF
f,d
Operands:
0 f 127
Operands:
Operation:
00h (f)
1Z
0 f 127
d [0,1]
Operation:
(f) - 1 (destination)
Status Affected:
Status Affected:
Description:
Description:
CLRW
Clear W
Syntax:
[ label ] CLRW
Operands:
None
Operation:
00h (W)
1Z
Status Affected:
Description:
DS40001722C-page 257
PIC16(L)F1703/7
DECFSZ
Decrement f, Skip if 0
INCFSZ
Increment f, Skip if 0
Syntax:
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination);
skip if result = 0
Operation:
(f) + 1 (destination),
skip if result = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
GOTO
Unconditional Branch
IORLW
Syntax:
[ label ]
Syntax:
[ label ]
GOTO k
INCFSZ f,d
IORLW k
Operands:
0 k 2047
Operands:
0 k 255
Operation:
k PC<10:0>
PCLATH<6:3> PC<14:11>
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
INCF
Increment f
IORWF
Inclusive OR W with f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (destination)
Operation:
Status Affected:
Status Affected:
Description:
Description:
DS40001722C-page 258
INCF f,d
IORWF
f,d
PIC16(L)F1703/7
LSLF
MOVF
f {,d}
Move f
Syntax:
[ label ] LSLF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f<7>) C
(f<6:0>) dest<7:1>
0 dest<0>
Operation:
(f) (dest)
Status Affected:
C, Z
Description:
register f
Status Affected:
Description:
Words:
Cycles:
Example:
Syntax:
[ label ] LSRF
Operands:
0 f 127
d [0,1]
Operation:
0 dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
f {,d}
register f
MOVF
FSR, 0
After Instruction
W = value in FSR register
Z = 1
LSRF
MOVF f,d
DS40001722C-page 259
PIC16(L)F1703/7
MOVIW
Move INDFn to W
Syntax:
Operands:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
Operation:
INDFn W
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
Status Affected:
MOVLP
Syntax:
[ label ] MOVLP k
Operands:
0 k 127
Operation:
k PCLATH
Status Affected:
None
Description:
MOVLW
Move literal to W
Syntax:
[ label ]
0 k 255
Operation:
k (W)
Status Affected:
None
Description:
The 8-bit literal k is loaded into W register. The dont cares will assemble as
0s.
Words:
1
1
Mode
Syntax
mm
Cycles:
Preincrement
++FSRn
00
Example:
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
MOVLB
Syntax:
[ label ] MOVLB k
Operands:
0 k 31
Operation:
k BSR
Status Affected:
None
Description:
DS40001722C-page 260
MOVLW k
Operands:
Predecrement
MOVLW
0x5A
After Instruction
W =
MOVWF
Move W to f
Syntax:
[ label ]
MOVWF
Operands:
0 f 127
Operation:
(W) (f)
0x5A
Status Affected:
None
Description:
Words:
Cycles:
Example:
MOVWF
OPTION_REG
Before Instruction
OPTION_REG = 0xFF
W = 0x4F
After Instruction
OPTION_REG = 0x4F
W = 0x4F
PIC16(L)F1703/7
MOVWI
Move W to INDFn
Syntax:
Operands:
Operation:
Status Affected:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
W INDFn
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
None
No Operation
Syntax:
[ label ]
Operands:
None
Operation:
No operation
Status Affected:
None
Description:
No operation.
Words:
Cycles:
Example:
OPTION
Syntax:
[ label ] OPTION
Operands:
None
Operation:
(W) OPTION_REG
Status Affected:
None
Description:
Syntax
Preincrement
++FSRn
00
Predecrement
--FSRn
01
Postincrement
FSRn++
10
Words:
Postdecrement
FSRn--
11
Cycles:
Example:
OPTION
Before Instruction
OPTION_REG = 0xFF
W = 0x4F
After Instruction
OPTION_REG = 0x4F
W = 0x4F
NOP
NOP
Mode
Description:
mm
NOP
RESET
Software Reset
Syntax:
[ label ] RESET
Operands:
None
Operation:
Status Affected:
None
Description:
DS40001722C-page 261
PIC16(L)F1703/7
RETFIE
RETURN
Syntax:
[ label ]
Syntax:
[ label ]
None
RETFIE k
RETURN
Operands:
None
Operands:
Operation:
TOS PC,
1 GIE
Operation:
TOS PC
Status Affected:
None
Status Affected:
None
Description:
Description:
Words:
Cycles:
Example:
RETFIE
After Interrupt
PC =
GIE =
TOS
1
RETLW
Syntax:
[ label ]
Operands:
0 k 255
Operation:
k (W);
TOS PC
Status Affected:
None
Description:
Words:
Cycles:
Example:
TABLE
RETLW k
RLF
Syntax:
[ label ]
Operands:
0 f 127
d [ 0, 1]
Operation:
Status Affected:
Description:
RLF
C
CALL TABLE;W contains table
;offset value
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2 ;
Before Instruction
W =
After Instruction
W =
DS40001722C-page 262
Words:
Cycles:
Example:
RLF
f,d
Register f
REG1,0
Before Instruction
REG1
C
After Instruction
REG1
W
C
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
0x07
value of k8
PIC16(L)F1703/7
SUBLW
Syntax:
[ label ]
RRF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
Operation:
k - (W) W)
Operation:
Status Affected:
C, DC, Z
Status Affected:
Description:
Description:
RRF f,d
Register f
SUBLW k
C=0
Wk
C=1
Wk
DC = 0
W<3:0> k<3:0>
DC = 1
W<3:0> k<3:0>
SLEEP
SUBWF
Subtract W from f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
C, DC, Z
Description:
SLEEP
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
Description:
SUBWF f,d
C=0
Wf
C=1
Wf
DC = 0
W<3:0> f<3:0>
DC = 1
W<3:0> f<3:0>
SUBWFB
Syntax:
SUBWFB
Operands:
0 f 127
d [0,1]
Operation:
f {,d}
Status Affected:
C, DC, Z
Description:
DS40001722C-page 263
PIC16(L)F1703/7
SWAPF
Swap Nibbles in f
XORLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
SWAPF f,d
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Status Affected:
None
Description:
Operands:
0 k 255
Operation:
(W) .XOR. k W)
Status Affected:
Description:
XORWF
TRIS
XORLW k
Exclusive OR W with f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
XORWF
f,d
Syntax:
[ label ] TRIS f
Operands:
5f7
Operation:
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
DS40001722C-page 264
PIC16(L)F1703/7
26.0
ELECTRICAL SPECIFICATIONS
26.1
2:
Maximum current rating requires even load distribution across I/O pins. Maximum current rating may be
limited by the device package power dissipation characterizations, see Table 26-6 to calculate device
specifications.
Power dissipation is calculated as follows: PDIS = VDD x {IDD IOH} + {(VDD VOH) x IOH} + (VOl x
IOL).
NOTICE: Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for
extended periods may affect device reliability.
DS40001722C-page 265
PIC16(L)F1703/7
26.2
The standard operating conditions for any device are defined as:
Operating Voltage:
Operating Temperature:
DS40001722C-page 266
PIC16(L)F1703/7
VOLTAGE FREQUENCY GRAPH, -40C TA +125C, PIC16F1703/7 ONLY
FIGURE 26-1:
VDD (V)
5.5
2.5
2.3
0
10
16
32
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 26-7 for each Oscillator modes supported frequencies.
VDD (V)
FIGURE 26-2:
3.6
2.5
1.8
0
10
16
32
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 26-7 for each Oscillator modes supported frequencies.
DS40001722C-page 267
PIC16(L)F1703/7
26.3
DC Characteristics
TABLE 26-1:
SUPPLY VOLTAGE
PIC16LF1703/7
PIC16F1703/7
Param.
No.
D001
Sym.
VDD
Characteristic
Typ
Max.
Units
VDDMIN
1.8
2.5
VDDMAX
3.6
3.6
V
V
FOSC 16 MHz
FOSC 32 MHz (Note 2)
2.3
2.5
5.5
5.5
V
V
FOSC 16 MHz:
FOSC 32 MHz (Note 2)
1.5
1.7
1.6
1.6
0.8
1.5
1x (1.024 typical)
-4
+4
2x (2.048 typical)
-4
+4
4x (4.096 typical)
-5
+5
0.05
PIC16F1703/7
VDR
D002*
D002A* VPOR
Conditions
Supply Voltage
D001
D002*
Min.
D002A*
D002B* VPORR* Power-on Reset Rearm Voltage(3)
D002B*
D003
D004*
VFVR
SVDD
DS40001722C-page 268
PIC16(L)F1703/7
FIGURE 26-3:
VDD
VPOR
VPORR
SVDD
VSS
NPOR(1)
POR REARM
VSS
TVLOW(2)
Note 1:
2:
3:
TPOR(3)
DS40001722C-page 269
PIC16(L)F1703/7
TABLE 26-2:
PIC16LF1703/7
PIC16F1703/7
Param
No.
Device
Characteristics
LDO Regulator
D009
D014
D014
D015
D015
D017
D017
D019
D019
D020
D020
Conditions
Min.
Typ
Max.
Units
VDD
Note
75
15
Sleep, VREGCON<1> = 0
0.3
Sleep, VREGCON<1> = 1
120
180
1.8
210
300
3.0
FOSC = 4 MHz,
External Clock (ECM),
Medium-Power mode
185
280
2.3
245
350
3.0
305
420
5.0
1.6
2.3
mA
3.0
2.6
mA
3.6
2.3
mA
3.0
2.5
mA
5.0
115
170
1.8
135
200
3.0
150
200
2.3
170
220
3.0
215
280
5.0
0.7
0.9
mA
1.8
1.2
1.4
mA
3.0
0.9
1.1
mA
2.3
1.1
1.5
mA
3.0
1.2
1.6
mA
5.0
2.5
mA
3.0
2.4
3.0
mA
3.6
2.6
mA
3.0
2.2
2.8
mA
5.0
FOSC = 4 MHz,
External Clock (ECM),
Medium-Power mode
FOSC = 32 MHz,
External Clock (ECH),
High-Power mode (Note 3)
FOSC = 32 MHz,
External Clock (ECH),
High-Power mode (Note 3)
FOSC = 500 kHz,
MFINTOSC mode
FOSC = 500 kHz,
MFINTOSC mode
FOSC = 16 MHz,
HFINTOSC mode
FOSC = 16 MHz,
HFINTOSC mode
FOSC = 32 MHz,
HFINTOSC mode (Note 3)
FOSC = 32 MHz,
HFINTOSC mode (Note 3)
Data in Typ column is at 3.0V, 25C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: all I/O pins tri-stated, pulled to VDD; MCLR =
VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin loading
and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current
consumption.
3: 8 MHz clock with 4x PLL enabled.
DS40001722C-page 270
PIC16(L)F1703/7
TABLE 26-3:
PIC16LF1703/7
PIC16F1703/7
Param
No.
Device Characteristics
D022
Base IPD
D022
Base IPD
D022A
Base IPD
D024
D024
D025
D025
Conditions
Min.
Typ
Max.
+85C
Max.
+125C
Units
0.05
1.0
8.0
1.8
0.08
2.0
9.0
3.0
0.3
11
2.3
0.4
12
3.0
0.5
15
5.0
9.8
16
18
2.3
10.3
18
20
3.0
Note
VDD
11.5
21
26
5.0
0.5
14
1.8
0.8
17
3.0
0.8
15
2.3
0.9
20
3.0
1.0
22
5.0
15
28
30
1.8
18
30
33
3.0
18
33
35
2.3
19
35
37
3.0
FVR Current
FVR Current
20
37
39
5.0
D026
7.5
25
28
3.0
BOR Current
D026
10
25
28
3.0
BOR Current
12
28
31
5.0
D027
0.5
10
3.0
LPBOR Current
D027
0.8
14
3.0
LPBOR Current
17
5.0
0.05
1.8
0.08
10
3.0
0.3
12
2.3
0.4
13
3.0
D029
D029
D030
D030
Note 1:
2:
3:
0.5
16
5.0
250
1.8
250
3.0
280
2.3
280
3.0
280
5.0
DS40001722C-page 271
PIC16(L)F1703/7
TABLE 26-3:
PIC16LF1703/7
PIC16F1703/7
Param
No.
Device Characteristics
Min.
Typ
Conditions
Max.
+85C
Max.
+125C
Units
VDD
Note
D031
250
650
3.0
Op Amp (High-power)
D031
250
650
3.0
Op Amp (High-power)
350
850
5.0
Note 1:
2:
3:
DS40001722C-page 272
PIC16(L)F1703/7
TABLE 26-4:
I/O PORTS
Sym.
VIL
Characteristic
Min.
Typ
Max.
Units
Conditions
0.8
0.15 VDD
0.2 VDD
0.3 VDD
0.8
0.2 VDD
I/O PORT:
D034
D034A
D035
D036
MCLR
VIH
I/O ports:
D040
2.0
0.25 VDD +
0.8
0.8 VDD
0.7 VDD
D040A
D041
MCLR
IIL
D060
MCLR(2)
IPUR
VOL
D070*
D080
125
nA
1000
nA
50
200
nA
25
100
200
0.6
VDD - 0.7
50
pF
I/O Ports
D061
I/O ports
VOH
D090
I/O ports
CIO
D101A*
2.1
0.8 VDD
DS40001722C-page 273
PIC16(L)F1703/7
TABLE 26-5:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
Program Memory
Programming Specifications
D110
VIHH
Voltage on MCLR/VPP
8.0
9.0
D111
IDDP
10
mA
D112
VBE
2.7
VDDMAX
D113
VPEW
VDDMIN
VDDMAX
D114
IPPGM
1.0
mA
D115
5.0
mA
D121
EP
Cell Endurance
10K
E/W
D122
VPRW
VDDMIN
VDDMAX
D123
TIW
2.5
ms
D124
TRETD
Characteristic Retention
40
Year
Provided no other
specifications are violated
D125
EHEFC
100K
E/W
(Note 3, Note 4)
Data in Typ column is at 3.0V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
Note 1: Self-write and Block Erase.
2: Refer to Section Section 3.2 High-Endurance Flash for a more detailed discussion on data EEPROM
endurance.
3: Required only if single-supply programming is disabled.
4:
The MPLAB ICD 2 does not support variable VPP output. Circuitry to limit the ICD 2 VPP voltage must be
placed between the ICD 2 and target system when programming or debugging with the ICD 2.
DS40001722C-page 274
PIC16(L)F1703/7
TABLE 26-6:
THERMAL CHARACTERISTICS
TH01
TH02
TH03
TH04
TH05
Sym.
Characteristic
Typ.
Units
JA
70.0
C/W
95.3
C/W
100.0
C/W
51.5
C/W
62.2
C/W
87.3
C/W
20-pin SSOP
77.7
C/W
JC
TJMAX
PD
Conditions
43.0
C/W
32.75
C/W
31.0
C/W
24.4
C/W
5.4
C/W
27.5
C/W
31.1
C/W
20-pin SSOP
23.1
C/W
5.3
C/W
150
PD = PINTERNAL + PI/O
TH06
PI/O
TH07
PDER
Derated Power
Note 1: IDD is current to run the chip alone without driving any load on the output pins.
2: TA = Ambient Temperature, TJ = Junction Temperature
DS40001722C-page 275
PIC16(L)F1703/7
26.4
AC Characteristics
Timing Parameter Symbology has been created with one of the following formats:
1. TppS2ppS
2. TppS
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 (High-impedance)
L
Low
FIGURE 26-4:
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
High-impedance
LOAD CONDITIONS
Load Condition
Pin
CL
VSS
DS40001722C-page 276
PIC16(L)F1703/7
FIGURE 26-5:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
CLKIN
OS12
OS02
OS11
OS03
CLKOUT
(CLKOUT Mode)
Note
1:
TABLE 26-7:
OS01
Sym.
FOSC
Characteristic
Min.
Typ
Max.
Units
Conditions
DC
0.5
MHz
DC
MHz
DC
20
MHz
OS02
TOSC
50
ns
OS03
TCY
125
TCY
DC
ns
TCY = 4/FOSC
DS40001722C-page 277
PIC16(L)F1703/7
TABLE 26-8:
OSCILLATOR PARAMETERS
Sym.
Characteristic
Freq.
Tolerance
Min.
Typ
Max.
Units
OS08
HFOSC
2%
16.0
MHz
OS08A
MFOSC
2%
500
kHz
OS09
LFOSC
31
kHz
OS10*
TIOSC ST
HFINTOSC
Wake-up from Sleep Start-up Time
MFINTOSC
Wake-up from Sleep Start-up Time
3.2
24
35
0.5
ms
OS10A* TLFOSC ST
*
LFINTOSC
Wake-up from Sleep Start-up Time
Conditions
-40C TA +125C
-40C TA +125C
Note 1: To ensure these oscillator frequency tolerances, VDD and VSS must be capacitively decoupled as close to the device as
possible. 0.1 F and 0.01 F values in parallel are recommended.
2: See Figure 27-43: LFINTOSC Frequency, PIC16LF1703/7 Only., and
Figure 27-44: LFINTOSC Frequency, PIC16F1703/7 Only..
FIGURE 26-6:
125
5%
85
Temperature (C)
3%
60
2%
25
0
-20
-40
1.8
5%
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40001722C-page 278
PIC16(L)F1703/7
TABLE 26-9:
Sym.
F10
Characteristic
Min.
Typ
Max.
Units
MHz
F11
FSYS
16
32
MHz
F12
TRC
F13*
CLK
ms
-0.25%
+0.25%
Conditions
DS40001722C-page 279
PIC16(L)F1703/7
FIGURE 26-7:
Cycle
Write
Fetch
Q1
Q4
Read
Execute
Q2
Q3
FOSC
OS12
OS11
OS20
OS21
CLKOUT
OS19
OS18
OS16
OS13
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
OS11*
TosH2ckL
70
ns
OS12*
TosH2ckH
72
ns
OS13*
TckL2ioV
OS14*
TioV2ckH
OS15*
TosH2ioV
OS16*
(1)
20
ns
TOSC + 200 ns
ns
50
70*
ns
TosH2ioI
50
ns
OS17*
TioV2osH
20
ns
OS18*
TioR
40
15
72
32
ns
VDD = 1.8V
3.3V VDD 5.0V
OS19*
TioF
28
15
55
30
ns
VDD = 1.8V
3.3V VDD 5.0V
OS20*
Tinp
25
ns
OS21*
Tioc
25
ns
DS40001722C-page 280
PIC16(L)F1703/7
FIGURE 26-8:
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Start-up Time
Internal Reset(1)
Watchdog Timer
Reset(1)
31
34
34
I/O pins
Note 1: Asserted low.
TABLE 26-11: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
AND BROWN-OUT RESET PARAMETERS
Standard Operating Conditions (unless otherwise stated)
Param
No.
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
10
16
27
ms
40
65
140
ms
2.0
2.55
2.70
2.85
BORV = 0
2.30
1.80
2.45
1.90
2.60
2.10
V
V
BORV = 1 (PIC16F1703/7)
BORV = 1 (PIC16LF1703/7)
1.8
2.1
2.5
LPBOR = 1
25
75
mV
-40C TA +85C
35
VDD VBOR
30
TMCL
31
33*
TPWRT
34*
TIOZ
35
VBOR
35A
36*
VHYST
37*
VDD = 3.3V-5V
1:16 Prescaler used
DS40001722C-page 281
PIC16(L)F1703/7
FIGURE 26-9:
T0CKI
40
41
42
T1CKI
45
46
49
47
TMR0 or
TMR1
FIGURE 26-10:
VDD
VBOR and VHYST
VBOR
37
Reset
(due to BOR)
33(1)
Note 1: 64 ms delay only if PWRTE bit in the Configuration Word register is programmed to 0;
2 ms delay if PWRTE = 0.
DS40001722C-page 282
PIC16(L)F1703/7
TABLE 26-12: TIMER0 AND TIMER1 EXTERNAL CLOCK REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Operating Temperature -40C TA +125C
Param
No.
40*
Sym.
TT0H
Characteristic
No Prescaler
With Prescaler
TT0L
41*
No Prescaler
With Prescaler
42*
TT0P
T0CKI Period
45*
TT1H
TT1L
46*
Typ
Max.
Units
0.5 TCY + 20
ns
10
ns
0.5 TCY + 20
ns
10
ns
Greater of:
20 or (TCY + 40)*N
ns
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
Greater of:
30 or (TCY + 40)*N
ns
60
ns
2 TOSC
7 TOSC
47*
TT1P
49*
Min.
Conditions
N = prescale value
N = prescale value
Timers in Sync
mode
DS40001722C-page 283
PIC16(L)F1703/7
FIGURE 26-11:
CCPx
(Capture mode)
CC01
CC02
CC03
Note:
Characteristic
CC01* TccL
No Prescaler
CC02* TccH
No Prescaler
Min.
Typ
Max.
Units
0.5TCY + 20
ns
ns
With Prescaler
20
0.5TCY + 20
ns
20
ns
(3TCY + 40)*N
ns
With Prescaler
CC03* TccP
*
Conditions
N = prescale value
TABLE 26-14:
Characteristic
Min.
Typ
Max.
Units
Conditions
AD01
NR
Resolution
10
AD02
EIL
Integral Error
1.7
bit
Differential Error
2.5
AD03
EDL
AD04
AD05
EGN
Gain Error
2.0
AD06
1.8
VDD
AD07
VAIN
Full-Scale Range
VSS
VREF
AD08
ZAIN
Recommended Impedance of
Analog Voltage Source
10
Note 1:
2:
3:
DS40001722C-page 284
PIC16(L)F1703/7
TABLE 26-15: ADC CONVERSION REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param
Sym.
No.
Characteristic
Min.
Typ
Max.
Units
Conditions
1.0
9.0
FOSC-based
1.0
6.0
11
TAD
5.0
1/2 TAD
AD130* TAD
AD131 TCNV
DS40001722C-page 285
PIC16(L)F1703/7
FIGURE 26-12:
BSF ADCON0, GO
AD133
1 TCY
AD131
Q4
AD130
ADC_clk
9
ADC Data
0
NEW_DATA
OLD_DATA
ADRES
1 TCY
ADIF
GO
Sample
DONE
Sampling Stopped
AD132
FIGURE 26-13:
BSF ADCON0, GO
AD133
1 TCY
AD131
Q4
AD130
ADC_clk
9
ADC Data
OLD_DATA
ADRES
0
NEW_DATA
1 TCY
ADIF
GO
Sample
DONE
AD132
Sampling Stopped
Note 1: If the ADC clock source is selected as FRC, a time of TCY is added before the ADC clock starts. This allows the
SLEEP instruction to be executed.
DS40001722C-page 286
PIC16(L)F1703/7
TABLE 26-16: OPERATIONAL AMPLIFIER (OPA)
Operating Conditions (unless otherwise stated)
VDD = 3.0V, TA = 25C, OPAxSP = 1 (High GBWP mode)
Param
No.
Symbol
OPA01*
GBWP
Parameters
Min.
Typ.
Max.
Units
3.5
MHz
OPA02*
TON
Turn-on Time
10
OPA03*
PM
Phase Margin
40
degrees
OPA04*
SR
Slew Rate
V/s
OPA05
OFF
Offset
mV
OPA06
CMRR
52
70
dB
OPA07*
AOL
90
dB
OPA08
VICM
VDD
OPA09*
PSRR
80
dB
Min.
Typ.
Max.
Conditions
Sym.
Characteristics
Units
ZC01
ZCPINV
0.75
ZC02
ZCSRC
Source current
-600
ZC03
ZCSNK
Sink current
600
ZC04
ZCISW
ZC05
ZCOUT
*
Comments
DS40001722C-page 287
PIC16(L)F1703/7
FIGURE 26-14:
SS
SP81
SCK
(CKP = 0)
SP71
SP72
SP78
SP79
SP79
SP78
SCK
(CKP = 1)
SP80
bit 6 - - - - - -1
MSb
SDO
LSb
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
SP73
Note: Refer to Figure 26-4 for load conditions.
FIGURE 26-15:
SS
SP81
SCK
(CKP = 0)
SP71
SP72
SP79
SP73
SCK
(CKP = 1)
SP80
SDO
MSb
bit 6 - - - - - -1
SP78
LSb
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
Note: Refer to Figure 26-4 for load conditions.
DS40001722C-page 288
PIC16(L)F1703/7
FIGURE 26-16:
SS
SP70
SCK
(CKP = 0)
SP83
SP71
SP72
SP78
SP79
SP79
SP78
SCK
(CKP = 1)
SP80
MSb
SDO
LSb
bit 6 - - - - - -1
SP77
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
SP73
Note: Refer to Figure 26-4 for load conditions.
FIGURE 26-17:
SS
SCK
(CKP = 0)
SP71
SP72
SCK
(CKP = 1)
SP80
SDO
MSb
bit 6 - - - - - -1
LSb
SP77
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
Note: Refer to Figure 26-4 for load conditions.
DS40001722C-page 289
PIC16(L)F1703/7
TABLE 26-18: SPI MODE REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param
No.
Symbol
Characteristic
Min.
Typ
Max. Units
2.25 TCY
ns
SP70* TSSL2SCH,
TSSL2SCL
SP71* TSCH
TCY + 20
ns
TCY + 20
ns
SP72*
TSCL
Conditions
SP73* TDIV2SCH,
TDIV2SCL
100
ns
SP74* TSCH2DIL,
TSCL2DIL
100
ns
SP75* TDOR
10
25
ns
25
50
ns
SP76* TDOF
10
25
ns
SP77* TSSH2DOZ
10
50
ns
SP78* TSCR
10
25
ns
25
50
ns
SP79* TSCF
10
25
ns
SP80* TSCH2DOV,
TSCL2DOV
50
ns
SP83* TSCH2SSH,
TSCL2SSH
145
ns
1 Tcy
ns
50
ns
1.5 TCY + 40
ns
DS40001722C-page 290
PIC16(L)F1703/7
FIGURE 26-18:
SCL
SP93
SP91
SP90
SP92
SDA
Stop
Condition
Start
Condition
Note: Refer to Figure 26-4 for load conditions.
Symbol
Characteristic
SP90*
TSU:STA
Start condition
SP91*
THD:STA
SP92*
TSU:STO
SP93*
Typ
4700
Max. Units
Setup time
600
Start condition
4000
Hold time
600
Stop condition
4700
Setup time
Hold time
*
Min.
600
4000
600
Conditions
ns
ns
ns
ns
FIGURE 26-19:
SCL
SP100
SP90
SP102
SP101
SP106
SP107
SP91
SDA
In
SP92
SP110
SP109
SP109
SDA
Out
Note: Refer to Figure 26-4 for load conditions.
DS40001722C-page 291
PIC16(L)F1703/7
TABLE 26-20: I2C BUS DATA REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Symbol
SP100* THIGH
Characteristic
Clock high time
Min.
Max.
Units
4.0
0.6
1.5TCY
4.7
1.3
1.5TCY
SSP module
SP101*
TLOW
SSP module
SP102* TR
SP103* TF
1000
ns
20 + 0.1CB
300
ns
250
ns
20 + 0.1CB
250
ns
ns
SP106* THD:DAT
0.9
SP107* TSU:DAT
250
ns
100
ns
SP109* TAA
3500
ns
ns
SP110*
4.7
1.3
400
pF
SP111*
*
Note 1:
2:
TBUF
CB
Conditions
CB is specified to be from
10-400 pF
CB is specified to be from
10-400 pF
(Note 2)
(Note 1)
Time the bus must be free
before a new transmission
can start
DS40001722C-page 292
PIC16(L)F1703/7
27.0
DC AND AC
CHARACTERISTICS GRAPHS
AND CHARTS
The graphs and tables provided in this section are for design guidance and are not tested.
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 ensured to operate properly only within the specified range.
Unless otherwise noted, all graphs apply to both the L and LF devices.
Note:
The graphs and tables provided following this note are a statistical summary based on a limited number of
samples and are provided for informational purposes only. The performance characteristics listed herein
are not tested or guaranteed. In some graphs or tables, the data presented may be outside the specified
operating range (e.g., outside specified power supply range) and therefore, outside the warranted range.
Typical represents the mean of the distribution at 25C. MAXIMUM, Max., MINIMUM or Min.
represents (mean + 3) or (mean - 3) respectively, where is a standard deviation, over each
temperature range.
DS40001722C-page 293
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
,
12
60
Max.
Max: 85C + 3
Typical: 25C
10
Max.
Max: 85C + 3
Typical: 25C
50
Typical
40
IDD (A)
IDD (A)
8
Typical
6
30
20
10
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
2.0
3.8
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
VDD (V)
FIGURE 27-1:
IDD, EC Oscillator,
Low-Power Mode, FOSC = 32 kHz,
PIC16LF1703/7 Only.
FIGURE 27-4:
IDD, EC Oscillator,
Low-Power Mode, FOSC = 500 kHz,
PIC16F1703/7 Only.
350
25
Max.
300
Max: 85C + 3
Typical: 25C
20
Typical: 25C
4 MHz
Typical
15
IDD (A)
IDD (A)
250
200
150
10
100
1 MHz
5
50
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
1.6
6.0
1.8
2.0
2.2
2.4
2.6
FIGURE 27-2:
IDD, EC Oscillator,
Low-Power Mode, FOSC = 32 kHz,
PIC16F1703/7 Only.
,
3.0
3.2
3.4
3.6
3.8
FIGURE 27-5:
IDD Typical, EC Oscillator,
Medium-Power Mode, PIC16LF1703/7 Only.
350
50
Max.
45
4 MHz
Max: 85C + 3
300
Max: 85C + 3
Typical: 25C
40
250
30
IDD (A)
35
IDD (A)
2.8
VDD (V)
VDD (V)
Typical
25
200
150
20
15
1 MHz
100
10
50
5
0
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
VDD (V)
FIGURE 27-3:
IDD, EC Oscillator,
Low-Power Mode, FOSC = 500 kHz,
PIC16LF1703/7 Only.
DS40001722C-page 294
3.6
3.8
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-6:
IDD Maximum, EC Oscillator,
Medium-Power Mode, PIC16LF1703/7 Only.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
3.0
400
350
Max: 85C + 3
Typical: 25C
2.5
4 MHz
32 MHz
300
IDD (mA)
IDD (A)
2.0
250
200
1 MHz
1.5
16 MHz
150
1.0
100
8 MHz
0.5
50
0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
1.6
1.8
2.0
2.2
2.4
2.6
FIGURE 27-7:
IDD Typical, EC Oscillator,
Medium-Power Mode, PIC16F1703/7 Only.
,
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
VDD (V)
FIGURE 27-10:
IDD Maximum, EC Oscillator,
High-Power Mode, PIC16LF1703/7 Only.
,
2.5
450
32 MHz
400
Typical: 25C
Max: 85C + 3
2.0
350
4 MHz
1.5
IDD (mA)
IDD (A)
300
250
200
1 MHz
16 MHz
1.0
8 MHz
150
100
0.5
50
0.0
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
2.0
6.0
2.5
3.0
3.5
FIGURE 27-8:
IDD Maximum, EC Oscillator,
Medium-Power Mode, PIC16F1703/7 Only.
4.5
5.0
5.5
6.0
FIGURE 27-11:
IDD Typical, EC Oscillator,
High-Power Mode, PIC16F1703/7 Only.
2.5
2.5
Max: 85C + 3
32 MHz
Typical: 25C
2.0
2.0
1.5
1.5
IDD (mA)
IDD (mA)
4.0
VDD (V)
VDD (V)
16 MHz
32 MHz
16 MHz
1.0
1.0
8 MHz
8 MHz
0.5
0.5
0.0
0.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-9:
IDD Typical, EC Oscillator,
High-Power Mode, PIC16LF1703/7 Only.
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-12:
IDD Maximum, EC Oscillator,
High-Power Mode, PIC16F1703/7 Only.
DS40001722C-page 295
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
7
260
Max.
Max: 85C + 3
Typical: 25C
240
Max: 85C + 3
Typical: 25C
Max.
220
Typical
IDD (A)
IDD (A)
Typical
200
4
180
3
160
2
140
120
100
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
2.0
3.8
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
VDD (V)
FIGURE 27-16:
IDD, MFINTOSC Mode,
Fosc = 500 kHz, PIC16F1703/7 Only.
FIGURE 27-13:
IDD, LFINTOSC Mode,
Fosc = 31 kHz, PIC16LF1703/7 Only.
25
1.6
16 MHz
Max.
1.4
Typical: 25C
20
1.2
15
IDD (mA)
IDD (A)
Typical
10
1.0
8 MHz
0.8
4 MHz
0.6
2 MHz
0.4
5
1 MHz
Max: 85C + 3
Typical: 25C
0.2
0.0
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
1.6
6.0
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
VDD (V)
FIGURE 27-14:
IDD, LFINTOSC Mode,
Fosc = 31 kHz, PIC16F1703/7 Only.
FIGURE 27-17:
IDD Typical, HFINTOSC
Mode, PIC16LF1703/7 Only.
180
1.8
1.6
170
Max: 85C + 3
Typical: 25C
160
Max.
16 MHz
Max: 85C + 3
1.4
1.2
140
IDD (mA)
IDD (A)
150
Typical
8 MHz
1.0
0.8
4 MHz
130
2 MHz
0.6
120
0.4
110
1 MHz
0.2
0.0
100
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
VDD (V)
FIGURE 27-15:
IDD, MFINTOSC Mode,
Fosc = 500 kHz, PIC16LF1703/7 Only.
DS40001722C-page 296
3.8
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-18:
IDD Maximum, HFINTOSC
Mode, PIC16LF1703/7 Only.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
p
1.6
1.2
16 MHz
1.4
Ma
Max.
Typical: 25C
1
1.2
0.8
8 MHz
IPD (A
(A)
IDD (mA)
1.0
0.8
4 MHz
0.6
2 MHz
0.4
1 MHz
Max: 85C + 3
Typical: 25C
0.6
0.4
Typical
0.2
0.2
0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
2.0
6.0
2.5
3.0
3.5
4.0
5.0
5.5
6.0
FIGURE 27-22:
IPD Base, Low-Power Sleep
Mode (VREGPM = 1), PIC16F1703/7 Only.
FIGURE 27-19:
IDD Typical, HFINTOSC
Mode, PIC16F1703/7 Only.
1.6
16 MHz
1.4
4.5
VDD (V)
VDD (V)
Max: 85C + 3
Typical: 25C
Max: 85C + 3
2.5
1.2
IPD (A)
IDD (mA)
0.8
Max.
8 MHz
1.0
4 MHz
1.5
2 MHz
0.6
1
1 MHz
0.4
Typical
0.5
0.2
0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
1.6
6.0
1.8
2.0
2.2
2.4
2.6
3.0
3.2
3.4
3.6
3.8
VDD (V)
VDD (V)
FIGURE 27-20:
IDD Maximum, HFINTOSC
Mode, PIC16F1703/7 Only.
p
2.8
FIGURE 27-23:
IPD, Watchdog Timer (WDT),
PIC16LF1703/7 only.
p
450
2.5
400
Max: 85C + 3
Typical: 25C
Max.
2
350
Max.
IPD (A)
IDD (nA
(nA)
300
250
Max: 85C + 3
Typical: 25C
200
1.5
150
Typical
100
0.5
Typical
50
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-21:
IPD Base, Low-Power Sleep
Mode, PIC16LF1703/7 Only.
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-24:
IPD, Watchdog Timer (WDT),
PIC16F1703/7 only.
DS40001722C-page 297
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
p ,
13
35
Max: 85C + 3
Typical: 25C
Max: 85C + 3
Typical: 25C
12
30
Max.
11
Max.
10
IDD
D (nA)
IDD (nA)
25
20
Typical
Typical
8
7
15
6
10
5
4
5
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
2.8
3.8
3.0
3.2
3.4
3.6
3.8
4.0
4.4
4.6
4.8
5.0
5.2
5.4
5.6
FIGURE 27-28:
IPD, Brown-Out Reset
(BOR), BORV = 1, PIC16F1703/7 only.
FIGURE 27-25:
IPD, Fixed Voltage
Reference (FVR), PIC16LF1703/7 only.
p ,
4.2
VDD (V)
VDD (V)
p ,
1.8
35
Max.
Max.
1.6
30
1.4
25
1.2
IDD (nA
(nA)
IDD (nA
(nA)
Typical
20
15
Max: 85C + 3
Typical: 25
C
25C
1
0.8
0.6
10
Typical
0.4
Max: 85C + 3
Typical: 25C
0.2
0
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
2.9
6.0
3.0
3.1
3.2
3.3
3.4
3.5
3.6
3.7
VDD (V)
VDD (V)
FIGURE 27-26:
IPD, Fixed Voltage
Reference (FVR), PIC16F1703/7 only.
FIGURE 27-29:
IPD, Low-Power Brown-Out
Reset (BOR), LPBOR = 0, PIC16LF1703/7 only.
1.8
11
Max: 85C + 3
Typical: 25C
10
Max.
Max: 85C + 3
T i l 25C
Typical:
16
1.6
Max.
1.4
9
IDD (A
(A)
IDD ((nA)
1.2
Typical
8
1.0
08
0.8
0.6
Typical
0.4
0.2
0.0
4
2.9
3.0
3.1
3.2
3.3
3.4
3.5
3.6
VDD (V)
FIGURE 27-27:
IPD, Brown-Out Reset
(BOR), BORV = 1, PIC16LF1703/7 only.
DS40001722C-page 298
3.7
2.8
3.0
3.2
3.4
3.6
3.8
4.0
4.2
4.4
4.6
4.8
5.0
5.2
5.4
5.6
VDD (V)
FIGURE 27-30:
IPD, Low-Power Brown-Out
Reset (BOR), LPBOR = 0, PIC16F1703/7 only.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
p
p ,
900
Max: 85C + 3
Typical: 25C
Max: 85C + 3
Typical: 25C
800
Max.
Max.
700
IDD (A)
IDD (A
(A)
600
4
3
Typical
500
Typical
400
300
2
200
1
100
0
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
1.5
3.8
2.0
2.5
3.0
3.5
4.5
5.0
5.5
6.0
FIGURE 27-34:
IPD, Op Amp, High GBWP
Mode (OPAxSP = 1), PIC16F1703/7 Only.
FIGURE 27-31:
IPD, Timer1 Oscillator,
Fosc = 32 kHz, PIC16LF1703/7 Only.
p ,
4.0
VDD (V)
VDD (V)
p ,
12
500
Max: 85C + 3
Typical: 25C
Max: 85C + 3
Typical: 25C
450
10
Max.
400
Max.
350
IDD (A)
IDD (A)
6
Typical
300
250
200
150
100
Typical
50
0
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
1.6
6.0
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
VDD (V)
FIGURE 27-32:
IPD, Timer1 Oscillator,
Fosc = 32 kHz, PIC16F1703/7 Only.
FIGURE 27-35:
IPD, ADC Non-Converting,
PIC16LF1703/7 only
700
1.4
Max: 85C + 3
Typical: 25C
600
Max: 85C + 3
Typical: 25C
1.2
Max.
Max.
500
400
IDD (A)
IDD (A)
Typical
300
0.8
0.6
200
0.4
100
0.2
Typical
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-33:
IPD, Op Amp, High GBWP
Mode (OPAxSP = 1), PIC16LF1703/7 Only.
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-36:
IPD, ADC Non-Converting,
PIC16F1703/7 only
DS40001722C-page 299
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
,
6
3.0
Graph represents 3 Limits
2.5
2.0
VOL (V)
VOH (V)
4
-40C
3
-40C
Typical
1.5
125C
125C
2
1.0
Typical
0.5
0.0
-30
-25
-20
-15
-10
-5
10
15
IOH (mA)
FIGURE 27-37:
VOH vs. IOH Over
Temperature, VDD = 5.0V, PIC16F1703/7 Only.
e
20
25
30
IOL (mA)
FIGURE 27-40:
VOL vs. IOL Over
Temperature, VDD = 3.0V.
5.0V
2.0
5
Graph represents 3 Limits
1.8
1.6
1.4
VOH (V)
VOL (V)
3
-40C
2
1.2
125C
1.0
0.8
Typical
Typical
-40C
0.6
125C
0.4
0.2
0.0
-4.0
0
0
10
20
30
40
IOL (mA)
50
60
70
80
-3.5
-3.0
-2.5
-2.0
-1.5
-1.0
-0.5
0.0
IOH (mA)
FIGURE 27-38:
VOL vs. IOL Over
Temperature, VDD = 5.0V, PIC16F1703/7 Only.
FIGURE 27-41:
VOH vs. IOH Over
Temperature, VDD = 1.8V, PIC16LF1703/7 Only.
,
3.5
1.8
Graph represents 3 Limits
1.6
3.0
1.4
2.5
Vol (V)
VOH (V)
1.2
2.0
1.5
1.0
125C
Typical
0.8
125C
-40C
0.6
Typical
1.0
0.4
-40C
0.5
0.2
0.0
0.0
-14
-12
-10
-8
-6
-4
IOH (mA)
FIGURE 27-39:
VOH vs. IOH Over
Temperature, VDD = 3.0V.
DS40001722C-page 300
-2
10
IOL (mA)
FIGURE 27-42:
VOL vs. IOL Over
Temperature, VDD = 1.8V, PIC16F1703/7 Only.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
q
y
24
40,000
38,000
22
Max.
Max.
36,000
20
34,000
Time (mS)
Frequency (Hz)
Typical
32,000
30,000
Min.
18
Typical
16
28,000
26,000
14
24,000
Min.
22,000
12
10
20,000
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
1.6
3.8
1.8
2.2
2.4
VDD (V)
2.8
3.2
3.4
3.6
3.8
FIGURE 27-46:
WDT Time-Out Period,
PIC16LF1703/7 Only.
FIGURE 27-43:
LFINTOSC Frequency,
PIC16LF1703/7 Only.
q
2.6
VDD (V)
40,000
2.00
38,000
Max.
Max.
36,000
1.95
Typical
Typical
32,000
Voltage (V)
Frequency (Hz)
34,000
30,000
Min.
28,000
1.90
Min.
26,000
1.85
24,000
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
22,000
20,000
1.80
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
-60
-40
-20
20
VDD (V)
40
60
80
24
70
22
60
140
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
Max.
Max.
50
Voltage (mV)
20
Time (mS)
120
FIGURE 27-47:
Brown-Out Reset Voltage,
Low Trip Point (BORV = 1), PIC16LF1703/7 only.
FIGURE 27-44:
LFINTOSC Frequency,
PIC16F1703/7 Only.
18
100
Temperature (C)
Typical
16
Min.
40
30
Typical
20
14
Min.
12
10
10
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 27-45:
WDT Time-Out Period,
PIC16F1703/7 Only.
6.0
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 27-48:
Brown-Out Reset
Hysteresis, Low Trip Point (BORV = 1),
PIC16LF1703/7 only.
DS40001722C-page 301
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
,
2.60
80
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
70
2.55
Max.
Max.
60
Typical
Voltage (mV)
Voltage (V)
2.50
Min.
2.45
2.40
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
2.35
50
Typical
40
30
20
Min.
10
2.30
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
20
40
60
FIGURE 27-49:
Brown-Out Reset Voltage,
Low Trip Point (BORV = 1), PIC16F1703/7 only.
100
120
140
FIGURE 27-52:
Brown-Out Reset
Hysteresis, High Trip Point (BORV = 0).
70
2.6
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
Max.
60
Max.
2.5
2.4
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
50
Voltage (V)
2.3
Voltage (mV)
80
Temperature (C)
Temperature (C)
40
Typical
30
2.2
Typical
2.1
2.0
20
1.9
Min.
Min.
10
1.8
0
1.7
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
FIGURE 27-53:
FIGURE 27-50:
Brown-Out Reset
Hysteresis, Low Trip Point (BORV = 1),
PIC16F1703/7 only.
2.85
40
60
80
100
120
140
50
Max.
40
Max.
35
Voltage (mV)
2.75
Typical
Min.
2.70
Max: Typical + 3
Typical: statistical mean
45
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
2.80
Voltage (V)
20
Temperature (C)
Temperature (C)
30
25
20
Typical
15
2.65
10
5
2.60
0
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
FIGURE 27-51:
Brown-Out Reset Voltage,
High Trip Point (BORV = 0).
DS40001722C-page 302
20
40
60
80
100
120
140
Temperature (C)
Temperature (C)
FIGURE 27-54:
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
1.58
1.58
100
Max: Typical + 3 (-40C to +125C)
Typical; statistical mean @ 25C
Min: Typical - 3 (-40C to +125C)
90
Max: Typical + 3
Typical: 25C
Max. Min: Typical - 3
1.561.56
Max.
1.541.54
Voltage (V)
Typical
70
Typical
Voltage (V)
Time (mS)
80
1.521.52
1.51.50
Min.
Min.
60
1.481.48
50
Max: Typical + 3
Typical: statistical mean
Min:-20
Typical - 30
1.46
1.46
-40
20
40
60
80
100
120
Temperature (C)
1.44
40
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
-50
6.0
-25
25
50
75
100
125
Temperature (C)
VDD (V)
FIGURE 27-55:
PWRT Period,
PIC16F1703/7 Only.
FIGURE 27-58:
POR REARM Voltage,
Normal-Power Mode (VREGPM1 = 0),
PIC16F1703/7 Only.
,
110
1.4
Max: Typical + 3 (-40C to +125C)
Typical; statistical mean @ 25C
Min: Typical - 3 (-40C to +125C)
100
1.3
Max.
1.2
90
Voltage (V)
Time (mS)
Max.
80
Typical
70
1.1
Typical
1.0
0.9
Min.
60
Min.
0.8
50
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
0.7
40
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
0.6
3.8
-50
-25
25
50
75
100
125
Temperature (C)
VDD (V)
FIGURE 27-59:
POR REARM Voltage,
Normal-Power Mode, PIC16LF1703/7 Only.
FIGURE 27-56:
PWRT Period,
PIC16LF1703/7 Only.
12
1.70
1.68
Max.
10
Typical
Voltage (V)
1.64
Time (s)
1.66
1.62
1.60
Min.
Max.
6
Typical
1.58
4
1.56
Max: Typical + 3
Typical: statistical mean
Min: Typical - 3
1.54
1.52
1.50
-50
-25
25
50
75
100
125
1.5
2.0
2.5
Temperature (C)
FIGURE 27-57:
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-60:
VREGPM = 0.
DS40001722C-page 303
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
1.0
50
45
40
0.5
Max.
DNL(LSb)
Time (s)
35
30
Typical
25
0.0
20
15
0.5
10
1.0
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
128
256
384
FIGURE 27-61:
VREGPM = 1.
512
640
768
896
1024
OutputCode
VDD (V)
FIGURE 27-64:
ADC 10-bit Mode,
Single-ended DNL, VDD = 3.0V, TAD = 4 S,
25C.
1.0
40
Max: Typical + 3
Typical: statistical mean @ 25C
35
0.5
Max.
INL(LSb)
Time (s)
30
Typical
25
0.0
20
0.5
Note:
The FVR Stabiliztion Period applies when coming out of Reset
or exiting Sleep mode.
15
1.0
10
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
128
256
384
512
640
768
896
1024
OutputCode
VDD (mV)
FIGURE 27-65:
ADC 10-bit Mode,
Single-ended INL, VDD = 3.0V, TAD = 1 S, 25C.
FIGURE 27-62:
FVR Period,
PIC16LF1703/7 Only.
2.0
1.0
1.0
1.5
1.0
INL(LSb)
DNL(LSb)
DNL(LSb)
0.5
0.0
0.5
0.5
0.0
0.5
0.0
1.0
1.5
0.5
0.5
2.0
0
512
1024
1536
2048
2560
3072
3584
4096
640
768
896
1024
OutputCode
1.0
0
128
256
384
512
640
768
896
OutputCode
FIGURE 27-63:
ADC 10-bit Mode,
Single-ended DNL, VDD = 3.0V, TAD = 1 S,
25C.
DS40001722C-page 304
1024
1.0
0
128
256
384
512
OutputCode
FIGURE 27-66:
ADC 10-bit Mode,
Single-ended INL, VDD = 3.0V, TAD = 4 S, 25C.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
1.5
1.5
1.0
Min40C
Max40C
1.0
Min25C
Max25C
DNL(LSb)
Min125C
0.0
Min125C
INL(LSb)
0.5
0.5
Max125C
0.0
Min25C
0.5
Min125C
Min40C
Min40C
0.5
1.0
1.5
5.00E07
1.00E06
2.00E06
4.00E06
Min25C
1.0
8.00E06
1.8
2.3
TADs
FIGURE 27-67:
ADC 10-bit Mode,
Single-ended DNL, VDD = 3.0V, VREF = 3.0V.
FIGURE 27-70:
ADC 10-bit Mode,
Single-ended INL, VDD = 3.0V, TAD = 1 S.
1.5
800
Max40C
INL(LSb)
0.5
700
Max
600
Max125C
Typical
0.0
0.5
Max25C
Min25C
Min125C
Min40C
1.0
VREF
500
Min
400
300
200
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
1.0
100
1.5
5.00E07
1.00E06
2.00E06
4.00E06
8.00E06
2.5
3.0
3.5
4.0
TADs
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-68:
ADC 10-bit Mode,
Single-ended INL, VDD = 3.0V, VREF = 3.0V.
FIGURE 27-71:
Temperature Indicator Initial
Offset, High Range, Temp. = 20C,
PIC16F1703/7 only.
1.5
900
1.0
800
Max
Typical
Max40C
Max25C
Max125C
0.0
Min125C
0.5
Min25C
Min40C
1.0
700
ADC Output Codes
DNL(LSb)
0.5
Min
600
500
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
400
300
1.5
1.8
2.3
VREF
FIGURE 27-69:
ADC 10-bit Mode,
Single-ended DNL, VDD = 3.0V, TAD = 1 S.
2.0
2.4
2.8
3.2
3.6
4.0
4.4
4.8
5.2
5.6
VDD (V)
FIGURE 27-72:
Temperature Indicator Initial
Offset, Low Range, Temp. = 20C,
PIC16F1703/7 only.
DS40001722C-page 305
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
800
150
ADC VREF+ SET TO VDD
ADC VREF- SET TO GND
Max
700
Typical
Typical
Min
600
Min
ADC Output Codes
Max
100
500
400
300
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
200
50
-50
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
100
-100
1.6
2.0
2.4
2.8
3.2
3.6
4.0
-60
-40
-20
20
VDD (V)
FIGURE 27-73:
Temperature Indicator Initial
Offset, Low Range, Temp. = 20C,
PIC16LF1703/7 only.
80
100
120
140
160
250
Max
125
Max
Typical
Min
150
75
50
25
0
-25
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-50
200
Typical
100
60
FIGURE 27-76:
Temperature Indicator Slope
Normalized to 20C, Low Range, VDD = 3.0,
PIC16F1703/7 only.
150
Min
100
50
0
-50
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-100
-150
-75
-60
-40
-20
20
40
60
80
100
120
140
-60
160
-40
-20
20
40
60
80
100
120
140
160
Temperature (C)
Temperature (C)
FIGURE 27-74:
Temperature Indicator Slope
Normalized to 20C, High Range, VDD = 5.0,
PIC16F1703/7 only.
FIGURE 27-77:
Temperature Indicator Slope
Normalized to 20C, Low Range, VDD = 1.8,
PIC16LF1703/7 only.
250
150
ADC VREF+ SET TO VDD
ADC VREF- SET TO GND
200
Max
Typical
150
Max
Typical
Min
100
Min
100
40
Temperature (C)
50
0
-50
50
-50
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-100
-150
-100
-60
-40
-20
20
40
60
80
100
120
140
160
Temperature (C)
FIGURE 27-75:
Temperature Indicator Slope
Normalized to 20C, High Range, VDD = 3.0,
PIC16F1703/7 only.
DS40001722C-page 306
-60
-40
-20
20
40
60
80
100
120
140
160
Temperature (C)
FIGURE 27-78:
Temperature Indicator Slope
Normalized to 20C, Low Range, VDD = 3.0,
PIC16LF1703/7 only.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
g
250
Max
200
Typical
Min
100
50
0
Max
Typical
150
2
0
Min
-2
-50
-4
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-100
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-6
-150
-8
-60
-40
-20
20
40
60
80
100
120
140
160
0.0
0.3
0.6
0.9
1.2
1.5
1.8
2.1
2.4
2.7
3.0
Temperature (C)
FIGURE 27-79:
Temperature Indicator Slope
Normalized to 20C, High Range, VDD = 3.0,
PIC16LF1703/7 only.
FIGURE 27-82:
Op Amp, Offset Over
Common-Mode Voltage, VDD = 3.0V,
Temp. = 25C
8
80
Max
Max
6
75
70
Typical
CMRR (dB)
65
60
Min
55
Typical
2
0
-2
-4
50
Min
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
45
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-6
-8
40
-50
-30
-10
10
30
50
70
90
110
0.0
130
0.5
1.0
1.5
FIGURE 27-80:
Op Amp, Common-Mode
Rejection Ratio (CMRR), VDD = 3.0V
,
2.0
2.5
3.0
3.5
4.0
4.5
5.0
Temperature (C)
FIGURE 27-83:
Op Amp, Offset Over
Common-Mode Voltage, VDD = 5.0V,
Temp. = 25C, PIC16F1703/7 only.
,
35%
7.75
7.70
30%
VDD = 3V
7.65
7.60
Slew Rate (V/s)
Percent of Units
25%
20%
-40C
15%
25C
10%
7.55
VDD = 3.6V
7.50
7.45
85C
7.40
125C
7.35
7.30
5%
VDD = 2.3V
7.25
7.20
0%
-7
-5
-4
-3
-2
-1
0
1
2
Offset Voltage (mV)
FIGURE 27-81:
Op Amp, Offset Voltage
Histogram, VDD = 3.0V, VCM = VDD/2
-60
-40
-20
20
40
60
80
100
120
140
VDD (V)
FIGURE 27-84:
Op Amp, Output Slew Rate,
Rising Edge, PIC16LF1703/7 only.
DS40001722C-page 307
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
g ,
4.0
0.85
0.80
VDD = 3.6V
-40C
VDD= 3V
3.4
VDD = 2.3V
3.7
0.75
25C
0.70
85C
3.1
0.65
2.8
125
0.60
-60
-40
-20
20
40
60
80
100
120
140
2.0
2.5
3.0
3.5
VDD (V)
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-85:
Op Amp, Output Slew Rate,
Falling Edge, PIC16LF1703/7 only.
FIGURE 27-88:
Zero-Cross Detection (ZCD)
Pin Voltage, Typical Measured Values.
1.4
8.0
Fall-2.3V
1.2
7.8
Fall-3.0V
VDD = 3V
Fall-5.5V
7.6
7.4
VDD = 3.6V
7.2
Time (us)
1.0
VDD = 2.3V
0.8
0.6
0.4
Rise-2.3V
Rise-3.0V
7.0
0.2
Rise-5.5V
VDD = 5V
6.8
0.0
-60
-40
-20
20
40
60
80
100
120
140
-40
-20
20
VDD (V)
40
60
80
100
120
140
160
Temperature (C)
FIGURE 27-86:
Op Amp, Output Slew Rate,
Rising Edge, PIC16F1703/7 only.
FIGURE 27-89:
Zero-Cross Detection (ZCD)
Time Over Voltage, Typical Measured Values.
8
4.4
VDD = 5V
Slew Rate (V/s)
4.0
3.8
VDD = 3.6V
3.6
VDD = 3V
3.4
3.2
5.5V
4.2
3.0V
6
2.3V
1.8V
VDD = 2.3V
-2
3.0
-4
2.8
-60
-40
-20
20
40
60
80
100
120
140
VDD (V)
FIGURE 27-87:
Op Amp, Output Slew Rate,
Falling Edge, PIC16F1703/7 only.
DS40001722C-page 308
0.0
0.5
1.0
1.5
2.0
FIGURE 27-90:
Zero-Cross Detection (ZCD)
Pin Current Over ZCD Pin Voltage, Typical
Measured Values from -40C to 125C.
PIC16(L)F1703/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 500 kHz, CIN = 0.1 F, TA = 25C.
1.0
0.9
0.8
Time (us)
0.7
0.6
0.5
0.4
1.8V
0.3
2.3V
3.0V
0.2
5.5V
0.1
0
50
100
150
200
250
300
350
400
450
500
FIGURE 27-91:
Zero-Cross Detection (ZCD)
Pin Response Time Over Current, Typical
Measured Values from -40C to 125C.
DS40001722C-page 309
PIC16(L)F1703/7
28.0
DEVELOPMENT SUPPORT
28.1
Multiple projects
Multiple tools
Multiple configurations
Simultaneous debugging sessions
DS40001722C-page 310
PIC16(L)F1703/7
28.2
MPLAB XC Compilers
28.3
MPASM Assembler
28.4
28.5
DS40001722C-page 311
PIC16(L)F1703/7
28.6
28.7
DS40001722C-page 312
28.8
28.9
The MPLAB PICkit 3 allows debugging and programming of PIC and dsPIC Flash microcontrollers at a most
affordable price point using the powerful graphical user
interface of the MPLAB IDE. The MPLAB PICkit 3 is
connected to the design engineers PC using a fullspeed USB interface and can be connected to the target via a Microchip debug (RJ-11) connector (compatible with MPLAB ICD 3 and MPLAB REAL ICE). The
connector uses two device I/O pins and the Reset line
to implement in-circuit debugging and In-Circuit Serial
Programming (ICSP).
PIC16(L)F1703/7
28.11 Demonstration/Development
Boards, Evaluation Kits, and
Starter Kits
A wide variety of demonstration, development and
evaluation boards for various PIC MCUs and dsPIC
DSCs allows quick application development on fully
functional systems. Most boards include prototyping
areas for adding custom circuitry and provide application firmware and source code for examination and
modification.
The boards support a variety of features, including LEDs,
temperature sensors, switches, speakers, RS-232
interfaces, LCD displays, potentiometers and additional
EEPROM memory.
DS40001722C-page 313
PIC16(L)F1703/7
29.0
PACKAGING INFORMATION
29.1
Example
PIC16F1703
-I/P e3
1331017
28-Lead SOIC (7.50 mm)
14-Lead SOIC (3.90 mm)
Example
Example
PIC16F1703
-I/SL e3
1331017
XXXXXXXX
YYWW
NNN
Legend: XX...X
Y
YY
WW
NNN
e3
Note:
DS40001722C-page 314
Example
F1703IST
1331
017
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
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.
PIC16(L)F1703/7
Package Marking Information (Continued)
16-Lead QFN (4x4x0.9 mm)
PIN 1
Example
PIN 1
PIC16
F1703
-I/ML
331017
e3
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
YYWWNNN
Example
PIC16F1707
-E/P e3
1331017
Example
PIC16F1707
-E/SS e3
1331017
Example
PIC16F1707
-E/SO e3
1331017
DS40001722C-page 315
PIC16(L)F1703/7
Package Marking Information (Continued)
PIN 1
Example
PIN 1
PIC16
F1707
E/ML
331017
e3
DS40001722C-page 316
PIC16(L)F1703/7
29.2
Package Details
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
NOTE 1
E1
D
E
A2
L
A1
b1
b
eB
6%
&
9&%
7!&(
$
7+8-
7
7:
;
%
%
%
<
<
""4
4
0
,
0
1 %
%
0
<
<
!" %
!" ="%
,
,0
""4="%
-
0
>
: 9%
,0
0
0
%
%
0
,
0
9" 4
>
0
(
0
?
>
1
<
<
6 9"="%
9
) 9"="%
:
)*
1+
,
!"#$%! & '(!%&! %(
%")%%%"
*$%+ % %
, &
"-"
%!"&
"$
% !
"$
% !
%#". "
&
"%
-/0
1+21 &
%#%!
))%
!%%
) +01
DS40001722C-page 317
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 318
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 319
PIC16(L)F1703/7
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
DS40001722C-page 320
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 321
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 322
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 323
PIC16(L)F1703/7
!
" #
$
%& ' (()* "#
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D2
D
EXPOSED
PAD
e
E2
E
2
TOP VIEW
N
NOTE 1
BOTTOM VIEW
A3
A
A1
6%
&
9&%
7!&(
$
99-
-
7
7:
;
?
%
: 8%
>
%"
$$
0
+
%%
4
,
: ="%
-#
""="%
-
: 9%
-#
""9%
?01+
-3
1+
0
?0
>
1+
0
?0
+
%%="%
0
,
,0
+
%%9%
,
0
+
%%%
-#
""
V
<
!"#$%! & '(!%&! %(
%")%%%"
4 ) !%"
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
>
<
) +1
DS40001722C-page 324
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 325
PIC16(L)F1703/7
+
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
E1
NOTE 1
3
D
E
A2
A1
b1
b
eB
e
6%
&
9&%
7!&(
$
7+8-
7
7:
;
%
%
%
<
<
""4
4
0
,
0
1 %
%
0
<
<
!" %
!" ="%
,
,
,0
""4="%
-
0
>
: 9%
>
,
?
%
%
0
,
0
9" 4
>
0
(
0
?
>
1
<
<
6 9"="%
9
) 9"="%
:
)*
1+
,
!"#$%! & '(!%&! %(
%")%%%"
*$%+ % %
, &
"-"
%!"&
"$
% !
"$
% !
%#". "
&
"%
-/0
1+2 1 &
%#%!
))%
!%%
) +1
DS40001722C-page 326
PIC16(L)F1703/7
+
,-.% , /
,, 0) ,,/
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D
N
E
E1
NOTE 1
1 2
e
b
c
A2
A1
L1
6%
&
9&%
7!&(
$
L
99-
-
7
7:
;
%
: 8%
<
?01+
<
""4
4
?0
0
>0
%"
$$
0
<
<
: ="%
>
>
""4="%
-
0
0,
0?
: 9%
?
0
%9%
00
0
0
% %
9
0-3
9" 4
<
%
W
W
0
>W
9"="%
<
,>
!"#$%! & '(!%&! %(
%")%%%"
&
"-"
%!"&
"$
% !
"$
% !
%#"&& "
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
) +1
DS40001722C-page 327
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 328
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 329
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 330
PIC16(L)F1703/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001722C-page 331
PIC16(L)F1703/7
+
" #
$
%& ' (()* "#
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D2
EXPOSED
PAD
e
E2
2
E
b
1
K
N
N
NOTE 1
TOP VIEW
BOTTOM VIEW
A
A1
A3
6%
&
9&%
7!&(
$
99-
-
7
7:
;
%
: 8%
>
%"
$$
0
+
%%
4
,
: ="%
-#
""="%
-
: 9%
-#
""9%
01+
-3
1+
?
>
1+
?
>
+
%%="%
>
0
,
+
%%9%
,
0
+
%%%
-#
""
<
<
!"#$%! & '(!%&! %(
%")%%%"
4 ) !%"
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
) +?1
DS40001722C-page 332
PIC16(L)F1703/7
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
DS40001722C-page 333
PIC16(L)F1703/7
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (10/2013)
Initial release of this document.
Revision B (02/2015)
Changed from Preliminary to Final data sheet.
Added Section 3.2: High-Endurance Flash.
Removed Figures 6-3, 6-4, 6-6, 6-10.
Removed Sections 6.2.1.2, 6.2.1.3, 6.2.1.6, 6.3.2, 6.4,
6.4.2, 6.5.
Replaced Section 18.0.
Updated Figures 2-1, 6-1, 6-2, 6-10, 7-2, 7-3, 14-1,
16-1, 17-1.
Updated PIC16(L)F170x Family Types Table.
Updated Registers 4-1, 6-1, 6-2, 14-1, 16-1, 16-2, 17-1.
Updated Section 23.0 from SSP to SSPx.
Updated Sections 6.1, 6.2, 6.2.1, 6.2.1.1, 6.2.2,
6.2.2.1, 6.2.2.2, 6.2.2.4, 6.2.2.6, 6.3.1, 8.2.2, 11.3.6,
16.1.3, 17.0, 17.1, 17.1.1.
Updated Tables 1, 2, 1-2, 1-3, 3-1, 6-1, 6-2, 26-18.
Revision C (09/2015)
Added High Endurance Flash Data Memory (HEF)
bullet on front page. Updated PIC16(L)F170x Family
Types Table. Updated graphs 27-63 through 27-70.
DS40001722C-page 334
PIC16(L)F1703/7
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or Field Application Engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://www.microchip.com/support
DS40001722C-page 335
PIC16(L)F1703/7
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
[X](1)
PART NO.
Device
/XX
XXX
Package
Pattern
Examples:
a)
b)
Device:
PIC16F1703, PIC16LF1703,
PIC16F1707, 7PIC16LF1707
Blank
T
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:(2)
ML
P
SL
SO
SS
ST
=
=
=
=
=
=
Pattern:
(Industrial)
(Extended)
QFN
PDIP
SOIC
SOIC
SSOP
TSSOP
DS40001722C-page 336
PIC16LF1703- I/P
Industrial temperature
PDIP package
PIC16F1707- E/SS
Extended temperature,
SSOP package
Note
1:
2:
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
== ISO/TS 16949 ==
2013-2015 Microchip Technology Inc.
DS40001722C-page 337
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Germany - Dusseldorf
Tel: 49-2129-3766400
Hong Kong
Tel: 852-2943-5100
Fax: 852-2401-3431
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
Austin, TX
Tel: 512-257-3370
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Novi, MI
Tel: 248-848-4000
Houston, TX
Tel: 281-894-5983
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
New York, NY
Tel: 631-435-6000
San Jose, CA
Tel: 408-735-9110
Canada - Toronto
Tel: 905-673-0699
Fax: 905-673-6509
China - Dongguan
Tel: 86-769-8702-9880
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
Germany - Karlsruhe
Tel: 49-721-625370
India - Pune
Tel: 91-20-3019-1500
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Italy - Venice
Tel: 39-049-7625286
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-213-7828
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Poland - Warsaw
Tel: 48-22-3325737
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
Sweden - Stockholm
Tel: 46-8-5090-4654
UK - Wokingham
Tel: 44-118-921-5800
Fax: 44-118-921-5820
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
07/14/15
DS40001722C-page 338