Professional Documents
Culture Documents
Memory Features:
Up to 8 KW Flash Program Memory:
- Self-programmable under software control
- Programmable code protection
- Programmable write protection
256 Bytes of Data EEPROM
Up to 1024 Bytes of RAM
I/O Features:
Up to 36 I/O Pins and 1 Input-only Pin:
High Current Sink/Source for LED Drivers
Individually Programmable Interrupt-on-Change
Pins
Individually Programmable Weak Pull-Ups
Individual Input Level Selection
Individually Programmable Slew Rate Control
Individually Programmable Open Drain Outputs
DS40001637C-page 1
PIC16(L)F1784/6/7
Digital Peripheral Features:
Oscillator Features:
Operate up to 32 MHz from Precision Internal
Oscillator:
- Factory calibrated to 1%, typical
- Software selectable frequency range from
32 MHz to 31 kHz
31 kHz Low-Power Internal Oscillator
32.768 kHz Timer1 Oscillator:
- Available as system clock
- Low-power RTC
External Oscillator Block with:
- 4 crystal/resonator modes up to 32 MHz
using 4x PLL
- 3 external clock modes up to 32 MHz
4x Phase-Locked Loop (PLL)
Fail-Safe Clock Monitor:
- Detect and recover from external oscillator
failure
Two-Speed Start-up:
- Minimize latency between code execution
and external oscillator start-up
DS40001637C-page 2
PIC16(L)F1784/6/7
PIC16(L)F1782
(1)
2048
256
256 25 11 3
2
1/0
2/1
2
2
1
1
I
PIC16(L)F1783
(1)
4096
256
512 25 11 3
2
1/0
2/1
2
2
1
1
I
PIC16(L)F1784
(2)
4096
256
512 36 15 4
3
1/0
2/1
3
3
1
1
I
PIC16(L)F1786
(2)
8192
256 1024 25 11 4
2
1/0
2/1
3
3
1
1
I
PIC16(L)F1787
(2)
8192
256 1024 36 15 4
3
1/0
2/1
3
3
1
1
I
PIC16(L)F1788
(3) 16384 256 2048 25 11 4
2
1/3
2/1
4
3
1
1
I
PIC16(L)F1789
(3) 16384 256 2048 36 15 4
3
1/3
2/1
4
3
1
1
I
Note 1: I - Debugging, Integrated on Chip; H - Debugging, available using Debug Header.
2: One pin is input-only.
Data Sheet Index: (Unshaded devices are described in this document.)
1: DS40001579
PIC16(L)F1782/3 Data Sheet, 28-Pin Flash, 8-bit Advanced Analog MCUs.
2: DS40001637
PIC16(L)F1784/6/7 Data Sheet, 28/40/44-Pin Flash, 8-bit Advanced Analog MCUs.
3: DS40001675
PIC16(L)F1788/9 Data Sheet, 28/40/44-Pin Flash, 8-bit Advanced Analog MCUs.
Note:
XLP
Debug(1)
MSSP (I2C/SPI)
EUSART
CCP
Programmable Switch
Mode Controllers
(PSMC)
Timers
(8/16-bit)
DAC (8/5-bit)
Operational
Amplifiers
Comparators
I/Os(2)
Data SRAM
(bytes)
Data EEPROM
(bytes)
Program Memory
Flash (words)
Device
Y
Y
Y
Y
Y
Y
Y
For other small form-factor package availability and marking information, please visit
http://www.microchip.com/packaging or contact your local sales office.
DS40001637C-page 3
PIC16(L)F1784/6/7
Pin Diagram 28-Pin SPDIP, SOIC, SSOP
28
RB7/ICSPDAT
RA0
RA1
27
RB6/ICSPCLK
RB5
RA2
RA3
RA4
RA5
VSS
26
25
24
23
RA7
RA6
RC0
RC1
RC2
RC3
Note:
6
7
8
9
10
11
PIC16(L)F1786
VPP/MCLR/RE3
22
21
20
19
RB4
RB3
RB2
RB1
RB0
VDD
12
18
17
13
16
VSS
RC7
RC6
RC5
14
15
RC4
28
27
26
25
24
23
22
RA1
RA0
RE3/MCLR/VPP
RB7/ICSPDAT
RB6/ICSPCLK
RB5
RB4
PIC16(L)F1786
8
9
10
11
12
13
14
1
2
3
4
5
6
7
21
20
19
18
17
16
15
RB3
RB2
RB1
RB0
VDD
VSS
RC7
RC0
RC1
RC2
RC3
RC4
RC5
RC6
RA2
RA3
RA4
RA5
VSS
RA7
RA6
Note:
DS40001637C-page 4
PIC16(L)F1784/6/7
Pin Diagram 40-Pin PDIP
Note:
VPP/MCLR/RE3
40
RB7ICSPDAT
RA0
39
RB6/ICSPCLK
RA1
38
RB5
RA2
37
RB4
36
35
RB2
RA5
RE0
34
33
RB1
RB0
RE1
32
VDD
RE2
10
31
VSS
VDD
11
30
RD7
VSS
12
29
RD6
RA7
13
28
RD5
RA6
14
27
RD4
RC0
15
26
RC7
RC1
16
25
RC6
RC2
RC3
17
24
RC5
18
23
RD0
19
22
RC4
RD3
RD1
20
21
RD2
PIC16(L)F1787
RA4
PIC16(L)F1784
RA3
RB3
DS40001637C-page 5
PIC16(L)F1784/6/7
31
32
34
33
35
36
37
30
29
4
5
28
27
PIC16(L)F1784
PIC16(L)F1787
26
25
24
23
20
19
18
17
16
15
14
13
22
21
RC0
RA6
RA7
VSS
VDD
RE2
RE1
RE0
RA5
RA4
RB3
RB4
RB5
ICSPCLK/RB6
ICSPDAT/RB7
VPP/MCLR/RE3
RA0
RA1
RA2
RA3
11
10
12
RD5
RD6
RD7
VSS
VDD
RB0
RB1
RB2
38
RC7 1
RD4 2
39
40
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
Note:
DS40001637C-page 6
PIC16(L)F1784/6/7
Note:
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
RC0
44
43
42
41
40
39
38
37
36
35
34
RC7
33
RA6
RD4
32
RA7
RD5
31
N/C
RD6
30
AVSS
RD7
VSS
VDD
PIC16(L)F1784
29
N/C
28
AVDD
27
RE2
PIC16(L)F1787
19
20
21
22
RA1
RA2
RA3
RA4
RA0
23
18
11
VPP/MCLR/RE3
RB2
17
RA5
ICSPDAT/RB7
24
16
10
ICSPCLK/RB6
RB1
15
RE0
RB5
25
13
14
RE1
N/C
RB4
26
12
RB3
VDD
RB0
DS40001637C-page 7
PIC16(L)F1784/6/7
PIC16(L)F1784
PIC16(L)F1787
33
32
31
30
29
28
27
26
25
24
23
NC
RC0
RA6
RA7
VSS
VDD
RE2
RE1
RE0
RA5
RA4
NC
NC
RB4
RB5
ICSPCLK/RB6
ICSPDAT/RB7
VPP/MCLR/RE3
RA0
RA1
RA2
RA3
RB0
RB1
RB2
RB3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
RC7
RD4
RD5
RD6
RD7
VSS
VDD
44
43
42
41
40
39
38
37
36
35
34
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
NC
Note:
DS40001637C-page 8
ADC
Reference
Comparator
Operation
Amplifiers
8-bit DAC
Timers
PSMC
CCP
EUSART
MSSP
Interrupt
Pull-up
Basic
RA0
27
AN0
C1IN0C2IN0C3IN0C4IN0-
IOC
RA1
28
AN1
C1IN1C2IN1C3IN1C4IN1-
OPA1OUT
IOC
RA2
AN2
VREFDAC1VREF-
C1IN0+
C2IN0+
C3IN0+
C4IN0+
DAC1OUT1
IOC
RA3
AN3
VREF+
DAC1VREF+
C1IN1+
IOC
RA4
C1OUT
OPA1IN+
T0CKI
IOC
RA5
AN4
C2OUT
OPA1IN-
SS
IOC
RA6
10
C2OUT(1)
IOC
VCAP
OSC2
CLKOUT
RA7
PSMC1CLK
PSMC2CLK
PSMC3CLK
IOC
OSC1
CLKIN
RB0
21
18
AN12
C2IN1+
CCP1(1)
INT
IOC
RB1
22
19
AN10
C1IN3C2IN3C3IN3C4IN3-
OPA2OUT
PSMC1IN
PSMC2IN
PSMC3IN
IOC
DS40001637C-page 9
RB2
23
20
AN8
OPA2IN-
IOC
CLKR
RB3
24
21
AN9
C1IN2C2IN2C3IN2C3IN1+
OPA2IN+
CCP2(1)
IOC
RB4
25
22
AN11
IOC
RB5
26
23
AN13
C4IN2C3OUT
T1G
CCP3(1)
SDO(1)
IOC
RB6
27
24
C4IN1+
TX(1)
CK(1)
SDI(1)
SDA(1)
IOC
ICSPCLK
Note
1:
Alternate pin function selected with the APFCON1 (Register 13-1) and APFCON2 (Register 13-2) registers.
PIC16(L)F1782/3
28-Pin QFN,
28-Pin SPDIP,
SOIC, SSOP
TABLE 1:
I/O
I/O
28-Pin SPDIP,
SOIC, SSOP
28-Pin QFN,
ADC
Reference
Comparator
Operation
Amplifiers
8-bit DAC
Timers
PSMC
CCP
EUSART
MSSP
Interrupt
Pull-up
Basic
RB7
28
25
DAC1OUT2
RX(1)
DT(1)
SCK(1)
SCL(1)
IOC
ICSPDAT
RC0
11
T1OSO
T1CKI
PSMC1A
IOC
RC1
12
T1OSI
PSMC1B
CCP2
IOC
RC2
13
10
PSMC1C
PSMC3B
CCP1
IOC
RC3
14
11
PSMC1D
SCK
SCL
IOC
RC4
15
12
PSMC1E
SDI
SDA
IOC
RC5
16
13
PSMC1F
PSMC3A
SDO
IOC
RC6
17
14
PSMC2A
CCP3
TX
CK
IOC
RC7
18
15
C4OUT
PSMC2B
RX
DT
IOC
RE3
26
IOC
MCLR
VPP
VDD
20
17
VDD
VSS
8,
19
5, 16
VSS
Note
1:
Alternate pin function selected with the APFCON1 (Register 13-1) and APFCON2 (Register 13-2) registers.
PIC16(L)F1784/6/7
DS40001637C-page 10
TABLE 1:
40-Pin PDIP
40-Pin UQFN
44-Pin TQFP
44-Pin QFN
ADC
Reference
Comparator
Op Amps
8-bit DAC
Timers
PSMC
CCP
EUSART
MSSP
Interrupt
Pull-up
Basic
I/O
TABLE 2:
RA0
17
19
19
AN0
C1IN0C2IN0C3IN0C4IN0-
IOC
RA1
18
20
20
AN1
C1IN1C2IN1C3IN1C4IN1-
OPA1OUT
IOC
RA2
19
21
21
AN2
DAC1VREFVREF-
C1IN0+
C2IN0+
C3IN0+
C4IN0+
DAC1OUT1
IOC
RA3
20
22
22
AN3
DAC1VREF+
VREF+
C1IN1+
IOC
21
23
23
C1OUT
OPA1IN+
T0CKI
IOC
RA5
22
24
24
AN4
C2OUT
OPA1IN-
SS
IOC
RA6
14
29
31
33
C2OUT(1)
IOC
VCAP
CLKOUT
OSC2
RA7
13
28
30
32
PSMC1CLK
PSMC2CLK
PSMC3CLK
IOC
CLKIN
OSC1
RB0
33
AN12
C2IN1+
PSMC1IN
PSMC2IN
PSMC3IN
CCP1(1)
INT
IOC
RB1
34
10
AN10
C1IN3C2IN3C3IN3C4IN3-
OPA2OUT
IOC
RB2
35
10
10
11
AN8
OPA2IN-
IOC
CLKR
RB3
36
11
11
12
AN9
C1IN2C2IN2C3IN2-
OPA2IN+
CCP2(1)
IOC
DS40001637C-page 11
RB4
37
12
14
14
AN11
C3IN1+
IOC
RB5
38
13
15
15
AN13
C4IN2-
T1G
CCP3(1)
SDO(1)
IOC
RB6
39
14
16
16
C4IN1+
TX(1)
CK(1)
SDA(1)
SDI(1)
IOC
ICSPCLK
RB7
40
15
17
17
DAC1OUT2
RX(1)
DT(1)
SCL(1)
SCK(1)
IOC
ICSPDAT
RC0
15
30
32
34
T1CKI
T1OSO
PSMC1A
IOC
Note
1:
Alternate pin function selected with the APFCON1 (Register 13-1) and APFCON2 (Register 13-2) registers.
PIC16(L)F1782/3
RA4
I/O
40-Pin PDIP
40-Pin UQFN
44-Pin TQFP
44-Pin QFN
ADC
Reference
Comparator
Op Amps
8-bit DAC
Timers
PSMC
CCP
EUSART
MSSP
Interrupt
Pull-up
Basic
RC1
16
31
35
35
T1OSI
PSMC1B
CCP2
IOC
RC2
17
32
36
36
PSMC1C
CCP1
IOC
RC3
18
33
37
37
PSMC1D
SCL
SCK
IOC
RC4
23
38
42
42
PSMC1E
SDI
SDA
IOC
RC5
24
39
43
43
PSMC1F
SDO
IOC
RC6
25
40
44
44
PSMC2A
TX
CK
IOC
RC7
26
PSMC2B
RX
DT
IOC
RD0
19
34
38
38
OPA3IN+
RD1
20
35
39
39
AN21
C1IN4C2IN4C3IN4C4IN4-
OPA3OUT
RD2
21
36
40
40
OPA3IN-
RD3
22
37
41
41
RD4
27
PSMC3F
RD5
28
PSMC3E
RD6
29
C3OUT
PSMC3D
RD7
30
C4OUT
PSMC3C
RE0
23
25
25
AN5
CCP3
RE1
24
26
26
AN6
PSMC3B
RE2
10
25
27
27
AN7
PSMC3A
RE3
16
18
18
IOC
MCLR
VPP
VDD
11,32
7,26
7,28
7,8,
28
VDD
12,31
6,27
6,29
6,30,
VSS
Vss
Note
1:
Alternate pin function selected with the APFCON1 (Register 13-1) and APFCON2 (Register 13-2) registers.
PIC16(L)F1784/6/7
DS40001637C-page 12
TABLE 2:
PIC16(L)F1784/6/7
Table of Contents
1.0 Device Overview ........................................................................................................................................................................ 14
2.0 Enhanced Mid-Range CPU ........................................................................................................................................................ 21
3.0 Memory Organization ................................................................................................................................................................. 23
4.0 Device Configuration .................................................................................................................................................................. 53
5.0 Resets ........................................................................................................................................................................................ 59
6.0 Oscillator Module........................................................................................................................................................................ 67
7.0 Reference Clock Module ............................................................................................................................................................ 85
8.0 Interrupts .................................................................................................................................................................................... 88
9.0 Power-Down Mode (Sleep) ...................................................................................................................................................... 103
10.0 Low Dropout (LDO) Voltage Regulator .................................................................................................................................... 107
11.0 Watchdog Timer (WDT) ........................................................................................................................................................... 108
12.0 Date EEPROM and Flash Program Memory Control ............................................................................................................... 112
13.0 I/O Ports ................................................................................................................................................................................... 125
14.0 Interrupt-on-Change ................................................................................................................................................................. 156
15.0 Fixed Voltage Reference (FVR) ............................................................................................................................................... 160
16.0 Temperature Indicator .............................................................................................................................................................. 163
17.0 Analog-to-Digital Converter (ADC) Module .............................................................................................................................. 165
18.0 Operational Amplifier (OPA) Module ........................................................................................................................................ 180
19.0 Digital-to-Analog Converter (DAC) Module .............................................................................................................................. 183
20.0 Comparator Module.................................................................................................................................................................. 187
21.0 Timer0 Module ......................................................................................................................................................................... 196
22.0 Timer1 Module ......................................................................................................................................................................... 200
23.0 Timer2 Module ......................................................................................................................................................................... 212
24.0 Programmable Switch Mode Control (PSMC) Module ............................................................................................................. 214
25.0 Capture/Compare/PWM Module .............................................................................................................................................. 271
26.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 281
27.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 335
28.0 In-Circuit Serial Programming (ICSP) ............................................................................................................................... 364
29.0 Instruction Set Summary .......................................................................................................................................................... 366
30.0 Electrical Specifications............................................................................................................................................................ 380
31.0 DC and AC Characteristics Graphs and Tables....................................................................................................................... 412
32.0 Development Support............................................................................................................................................................... 436
33.0 Packaging Information.............................................................................................................................................................. 440
Appendix A: Revision History............................................................................................................................................................. 460
The Microchip Web Site ..................................................................................................................................................................... 461
Customer Change Notification Service .............................................................................................................................................. 461
Customer Support .............................................................................................................................................................................. 461
Product Identification System ............................................................................................................................................................ 462
DS40001637C-page 13
PIC16(L)F1784/6/7
1.0
DEVICE OVERVIEW
Peripheral
PIC16(L)F1783
PIC16(L)F1784
PIC16(L)F1786
PIC16(L)F1787
PIC16(L)F1788
PIC16(L)F1789
TABLE 1-1:
Temperature Indicator
CCP1
CCP2
CCP3
Comparators
C1
C2
C3
C4
Digital-to-Analog Converter (DAC)
(8-bit DAC) D1
(5-bit DAC) D2
(5-bit DAC) D3
(5-bit DAC) D4
MSSP
Op Amp 1
Op Amp 2
Op Amp 3
PSMC2
PSMC3
PSMC4
Timers
DS40001637C-page 14
Timer0
Timer1
Timer2
PIC16(L)F1784/6/7
FIGURE 1-1:
Program
Flash Memory
RAM
PORTA
PORTB
CLKOUT
Timing
Generation
HFINTOSC/
LFINTOSC
Oscillator
CLKIN
PORTC
CPU
Figure 2-1
PORTD(1)
MCLR
PORTE
Op Amps
PSMCs
Temp.
Indicator
Note
1:
2:
Timer0
ADC
12-Bit
Timer1
FVR
Timer2
DAC
MSSP
CCPs
Comparators
EUSART
PIC16(L)F1784/7 only.
See applicable chapters for more information on peripherals.
DS40001637C-page 15
PIC16(L)F1784/6/7
TABLE 1-2:
Name
RA0/AN0/C1IN0-/C2IN0-/
C3IN0-/C4IN0-
RA1/AN1/C1IN1-/C2IN1-/
C3IN1-/C4IN1-/OPA1OUT
RA2/AN2/C1IN0+/C2IN0+/
C3IN0+/C4IN0+/DAC1OUT1/
VREF-/DAC1VREF-/OPA1IN-
RA3/AN3/VREF+/C1IN1+/
DAC1VREF+
Function
RA0
Description
C1IN0-
AN
C2IN0-
AN
C3IN0-
AN
C4IN0-
AN
RA1
AN1
AN
C1IN1-
AN
C2IN1-
AN
C3IN1-
AN
C4IN1-
AN
OPA1OUT
AN
RA2
AN2
AN
C1IN0+
AN
C2IN0+
AN
C3IN0+
AN
C4IN0+
AN
DAC1OUT1
AN
VREF-
AN
DAC1VREF-
AN
RA3
AN3
AN
VREF+
AN
C1IN1+
AN
AN
RA4
C1OUT
OPA1IN+
AN
ST
T0CKI
RA5/AN4/C2OUT(1)/OPA1IN-/
SS
Output
Type
AN0
DAC1VREF+
RA4/C1OUT/OPA1IN+/T0CKI
Input
Type
RA5
AN4
AN
C2OUT
OPA1IN-
AN
SS
ST
DS40001637C-page 16
PIC16(L)F1784/6/7
TABLE 1-2:
Name
RA6/C2OUT(1)/OSC2/
CLKOUT/VCAP
RA7/PSMC1CLK/PSMC2CLK/
PSMC3CLK/OSC1/CLKIN
RB0/AN12/C2IN1+/PSMC1IN/
PSMC2IN/PSMC3IN/CCP1(1)/
INT
RB1/AN10/C1IN3-/C2IN3-/
C3IN3-/C4IN3-/OPA2OUT
RB2/AN8/OPA2IN-/CLKR
RB3/AN9/C1IN2-/C2IN2-/
C3IN2-/OPA2IN+/CCP2(1)
RB4/AN11/C3IN1+
Function
RA6
Input
Type
Output
Type
Description
C2OUT
OSC2
CLKOUT
VCAP
Power
RA7
XTAL
PSMC1CLK
ST
PSMC2CLK
ST
PSMC3CLK
ST
OSC1
XTAL
CLKIN
st
RB0
AN12
AN
C2IN1+
AN
PSMC1IN
ST
PSMC2IN
ST
PSMC3IN
ST
CCP1
ST
INT
ST
RB1
CMOS Capture/Compare/PWM1.
External interrupt.
AN10
AN
C1IN3-
AN
C2IN3-
AN
C3IN3-
AN
C4IN3-
AN
OPA2OUT
AN
RB2
AN8
AN
OPA2IN-
AN
CLKR
RB3
AN9
AN
C1IN2-
AN
C2IN2-
AN
C3IN2-
AN
OPA2IN+
AN
CCP2
ST
RB4
CMOS Capture/Compare/PWM2.
AN11
AN
C3IN1+
AN
DS40001637C-page 17
PIC16(L)F1784/6/7
TABLE 1-2:
Name
Function
RB5/AN13/C4IN2-/T1G/CCP3(1)
SDO(1)
RB5
(1)
(1)
RB7/DAC1OUT2/RX /DT /
SCK(1)/SCL(1)/ICSPDAT
RC1/T1OSI/PSMC1B/CCP2
AN
T1G
ST
CCP3
ST
CMOS Capture/Compare/PWM3.
RB6
AN
TX
RC4/PSMC1E/SDI /SDA
(1)
CK
ST
SDI
ST
SDA
I2C
OD
ICSPCLK
ST
RB7
DAC1OUT2
AN
RX
ST
DT
ST
SCK
ST
SCL
I2C
RC0
ST
OD
XTAL
XTAL
T1CKI
ST
PSMC1A
RC1
I2C clock.
T1OSO
T1OSI
XTAL
PSMC1B
ST
CMOS Capture/Compare/PWM2.
XTAL
PSMC1C
CCP1
ST
CMOS Capture/Compare/PWM1.
RC3
PSMC1D
(1)
C4IN1+
RC2
RC3/PSMC1D/SCK(1)/SCL(1)
CCP2
RC2/PSMC1C/CCP1
Description
AN13
ICSPDAT
RC0/T1OSO/T1CKI/PSMC1A
Output
Type
C4IN2-
SDO
RB6/C4IN1+/TX(1)/CK(1)/SDI(1)/
SDA(1)/ICSPCLK
Input
Type
SCK
ST
SCL
I2C
RC4
PSMC1E
OD
I2C clock.
SDI
ST
SDA
I2C
OD
DS40001637C-page 18
PIC16(L)F1784/6/7
TABLE 1-2:
Name
RC5/PSMC1F/SDO(1)
RC6/PSMC2A/TX(1)/CK(1)
Function
RC5
RD2(3)/OPA3IN-
RC6
TX
CK
ST
RC7
PSMC2B
RX
ST
DT
ST
RD0
OPA3IN+
RD1(3)/AN21/C1IN4-/C2IN4-/
C3IN4-/C4IN4-/OPA3OUT
Description
SDO
C4OUT
RD0(3)/OPA3IN+
Output
Type
PSMC1F
PSMC2A
RC7/PSMC2B/RX(1)/DT(1)/
C4OUT(4)
Input
Type
RD1
AN21
AN
C1IN4-
AN
C2IN4-
AN
C3IN4-
AN
C4IN4-
AN
OPA3OUT
AN
RD2
OPA3IN-
RD3(3)
RD3
RD4(3)/PSMC3F
RD4
PSMC3F
RD5(3)/PSMC3E
RD5
PSMC3E
RD6(3)/C3OUT/PSMC3D
RD7(3)/C4OUT/PSMC3C
RD6
RE1
(3)
/AN6/PSMC3B
C3OUT
PSMC3D
RD6
PSMC3C
RE0
TTL/ST
AN5
AN
CCP3
ST
C4OUT
RE0(3)/AN5/CCP3(1)
RE1
CMOS Capture/Compare/PWM3.
AN6
AN
PSMC3B
DS40001637C-page 19
PIC16(L)F1784/6/7
TABLE 1-2:
Name
RE2(3)/AN7/PSMC3A
RE3/MCLR/VPP
Function
RE2
Input
Type
Output
Type
Description
AN7
AN
PSMC3A
RE3
TTL/ST
MCLR
ST
VPP
HV
Programming voltage.
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
DS40001637C-page 20
PIC16(L)F1784/6/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
OSC1/CLKIN
OSC2/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
DS40001637C-page 21
PIC16(L)F1784/6/7
2.1
2.2
2.3
2.4
Instruction Set
DS40001637C-page 22
PIC16(L)F1784/6/7
3.0
MEMORY ORGANIZATION
3.1
TABLE 3-1:
PIC16(L)F1784
Device
4,096
0FFFh
PIC16(L)F1786/7
8,192
1FFFh
DS40001637C-page 23
PIC16(L)F1784/6/7
FIGURE 3-1:
FIGURE 3-2:
PC<14:0>
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
15
15
Stack Level 0
Stack Level 1
Stack Level 0
Stack Level 1
Stack Level 15
Stack Level 15
Reset Vector
0000h
Reset Vector
0000h
Interrupt Vector
0004h
0005h
Interrupt Vector
0004h
0005h
Page 0
07FFh
0800h
Page 1
On-chip
Program
Memory
0FFFh
1000h
On-chip
Program
Memory
Page 0
07FFh
0800h
Page 1
Rollover to Page 0
Page 2
0FFFh
1000h
17FFh
1800h
Page 3
Rollover to Page 0
Rollover to Page 3
DS40001637C-page 24
1FFFh
2000h
7FFFh
Rollover to Page 1
7FFFh
PIC16(L)F1784/6/7
3.1.1
3.1.1.1
RETLW Instruction
EXAMPLE 3-1:
constants
BRW
RETLW
RETLW
RETLW
RETLW
DATA0
DATA1
DATA2
DATA3
RETLW INSTRUCTION
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
;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.1.1.2
DS40001637C-page 25
PIC16(L)F1784/6/7
3.2
12 core registers
20 Special Function Registers (SFR)
Up to 80 bytes of General Purpose RAM (GPR)
16 bytes of common RAM
DS40001637C-page 26
3.2.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)F1784/6/7
3.2.1.1
STATUS Register
3.3
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.
DS40001637C-page 27
PIC16(L)F1784/6/7
3.3.1
3.3.2
3.3.2.1
FIGURE 3-3:
Memory Region
00h
0Bh
0Ch
Core Registers
(12 bytes)
3.3.3
BANKED MEMORY
PARTITIONING
COMMON RAM
DS40001637C-page 28
The memory maps for Bank 0 through Bank 31 are shown in the tables in this section.
TABLE 3-3:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
BANK 2
100h
Core Registers
(Table 3-2)
BANK 3
180h
Core Registers
(Table 3-2)
BANK 4
200h
Core Registers
(Table 3-2)
BANK 5
280h
Core Registers
(Table 3-2)
BANK 6
300h
Core Registers
(Table 3-2)
BANK 7
380h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
PORTA
PORTB
PORTC
08Bh
08Ch
08Dh
08Eh
TRISA
TRISB
TRISC
10Bh
10Ch
10Dh
10Eh
LATA
LATB
LATC
18Bh
18Ch
18Dh
18Eh
ANSELA
ANSELB
20Bh
20Ch
20Dh
20Eh
WPUA
WPUB
WPUC
28Bh
28Ch
28Dh
28Eh
ODCONA
ODCONB
ODCONC
30Bh
30Ch
30Dh
30Eh
SLRCONA
SLRCONB
SLRCONC
38Bh
38Ch
38Dh
38Eh
INLVLA
INLVLB
INLVLC
00Fh
PORTD
08Fh
TRISD
10Fh
LATD
18Fh
ANSELD
20Fh
WPUD
28Fh
ODCOND
30Fh
SLRCOND
38Fh
INLVLD
010h
011h
012h
013h
014h
015h
016h
PORTE
PIR1
PIR2
PIR4
TMR0
TMR1L
090h
091h
092h
093h
094h
095h
096h
TRISE
PIE1
PIE2
PIE4
OPTION_REG
PCON
110h
111h
112h
113h
114h
115h
116h
LATE
CM1CON0
CM1CON1
CM2CON0
CM2CON1
CMOUT
BORCON
190h
191h
192h
193h
194h
195h
196h
ANSELE
EEADRL
EEADRH
EEDATL
EEDATH
EECON1
EECON2
210h
211h
212h
213h
214h
215h
216h
WPUE
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
290h
291h
292h
293h
294h
295h
296h
ODCONE
CCPR1L
CCPR1H
CCP1CON
310h
311h
312h
313h
314h
315h
316h
SLRCONE
390h
391h
392h
393h
394h
395h
396h
INLVLE
IOCAP
IOCAN
IOCAF
IOCBP
IOCBN
IOCBF
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
ADCON0
ADCON1
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
FVRCON
DAC1CON0
DAC1CON1
CM4CON0
CM4CON1
APFCON2
APFCON1
CM3CON0
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
VREGCON(1)
RCREG
TXREG
SPBRGL
SPBRGH
RCSTA
TXSTA
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
SSP1CON3
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
CCPR2L
CCPR2H
CCP2CON
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
IOCCP
IOCCN
IOCCF
IOCEP
IOCEN
01Fh
020h
09Fh
0A0h
ADCON2
11Fh
120h
CM3CON1
19Fh
1A0h
BAUDCON
21Fh
220h
29Fh
2A0h
39Fh
3A0h
IOCEF
General
Purpose
Register
80 Bytes
06Fh
070h
General
Purpose
Register
80 Bytes
0EFh
0F0h
Common RAM
70h 7Fh
07Fh
Note
1:
General
Purpose
Register
80 Bytes
16Fh
170h
Accesses
70h 7Fh
0FFh
Legend:
13Fh
140h
1EFh
1F0h
Accesses
70h 7Fh
17Fh
General
Purpose
Register
80 Bytes
General
Purpose
Register
80 Bytes
26Fh
270h
Accesses
70h 7Fh
1FFh
General
Purpose
Register
80 Bytes
2EFh
2F0h
Accesses
70h 7Fh
27Fh
Accesses
70h 7Fh
2FFh
31Fh
Unimplemented
Read as 0
3EFh
3F0h
Accesses
70h 7Fh
3FFh
PIC16(L)F1784/6/7
DS40001637C-page 29
3.3.4
TABLE 3-4:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
BANK 2
100h
Core Registers
(Table 3-2)
BANK 3
180h
Core Registers
(Table 3-2)
BANK 4
200h
Core Registers
(Table 3-2)
BANK 5
280h
Core Registers
(Table 3-2)
BANK 6
300h
Core Registers
(Table 3-2)
BANK 7
380h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
PORTA
PORTB
PORTC
PORTE
PIR1
PIR2
PIR4
TMR0
TMR1L
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
TRISA
TRISB
TRISC
TRISE
PIE1
PIE2
PIE4
OPTION_REG
PCON
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
LATA
LATB
LATC
CM1CON0
CM1CON1
CM2CON0
CM2CON1
CMOUT
BORCON
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
ANSELA
ANSELB
EEADRL
EEADRH
EEDATL
EEDATH
EECON1
EECON2
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
WPUA
WPUB
WPUC
WPUE
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
ODCONA
ODCONB
ODCONC
CCPR1L
CCPR1H
CCP1CON
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
SLRCONA
SLRCONB
SLRCONC
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
INLVLA
INLVLB
INLVLC
INLVLE
IOCAP
IOCAN
IOCAF
IOCBP
IOCBN
IOCBF
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
ADCON0
ADCON1
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
FVRCON
DAC1CON0
DAC1CON1
CM4CON0
CM4CON1
APFCON2
APFCON1
CM3CON0
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
VREGCON(1)
RCREG
TXREG
SPBRGL
SPBRGH
RCSTA
TXSTA
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
SSP1CON3
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
CCPR2L
CCPR2H
CCP2CON
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
IOCCP
IOCCN
IOCCF
IOCEP
IOCEN
01Fh
020h
09Fh
0A0h
ADCON2
11Fh
120h
CM3CON1
19Fh
1A0h
BAUDCON
21Fh
220h
29Fh
2A0h
31Fh
320h
39Fh
3A0h
IOCEF
06Fh
070h
General
Purpose
Register
80 Bytes
0EFh
0F0h
Common RAM
70h 7Fh
07Fh
DS40001637C-page 30
Note
1:
General
Purpose
Register
80 Bytes
16Fh
170h
Accesses
70h 7Fh
0FFh
Legend:
13Fh
140h
1EFh
1F0h
Accesses
70h 7Fh
17Fh
General
Purpose
Register
80 Bytes
General
Purpose
Register
80 Bytes
26Fh
270h
Accesses
70h 7Fh
1FFh
General
Purpose
Register
80 Bytes
27Fh
36Fh
370h
2EFh
2F0h
Accesses
70h 7Fh
General
Purpose
Register
80 Bytes
Accesses
70h 7Fh
2FFh
General
Purpose
Register
80 Bytes
3EFh
3F0h
Accesses
70h 7Fh
37Fh
Accesses
70h 7Fh
3FFh
PIC16(L)F1784/6/7
General
Purpose
Register
80 Bytes
TABLE 3-5:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
BANK 2
100h
Core Registers
(Table 3-2)
BANK 3
180h
Core Registers
(Table 3-2)
BANK 4
200h
Core Registers
(Table 3-2)
BANK 5
280h
Core Registers
(Table 3-2)
BANK 6
300h
Core Registers
(Table 3-2)
BANK 7
380h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
PORTA
PORTB
PORTC
08Bh
08Ch
08Dh
08Eh
TRISA
TRISB
TRISC
10Bh
10Ch
10Dh
10Eh
LATA
LATB
LATC
18Bh
18Ch
18Dh
18Eh
ANSELA
ANSELB
20Bh
20Ch
20Dh
20Eh
WPUA
WPUB
WPUC
28Bh
28Ch
28Dh
28Eh
ODCONA
ODCONB
ODCONC
30Bh
30Ch
30Dh
30Eh
SLRCONA
SLRCONB
SLRCONC
38Bh
38Ch
38Dh
38Eh
INLVLA
INLVLB
INLVLC
00Fh
PORTD
08Fh
TRISD
10Fh
LATD
18Fh
ANSELD
20Fh
WPUD
28Fh
ODCOND
30Fh
SLRCOND
38Fh
INLVLD
010h
011h
012h
013h
014h
015h
016h
PORTE
PIR1
PIR2
PIR4
TMR0
TMR1L
090h
091h
092h
093h
094h
095h
096h
TRISE
PIE1
PIE2
PIE4
OPTION_REG
PCON
110h
111h
112h
113h
114h
115h
116h
LATE
CM1CON0
CM1CON1
CM2CON0
CM2CON1
CMOUT
BORCON
190h
191h
192h
193h
194h
195h
196h
ANSELE
EEADRL
EEADRH
EEDATL
EEDATH
EECON1
EECON2
210h
211h
212h
213h
214h
215h
216h
WPUE
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
290h
291h
292h
293h
294h
295h
296h
ODCONE
CCPR1L
CCPR1H
CCP1CON
310h
311h
312h
313h
314h
315h
316h
SLRCONE
390h
391h
392h
393h
394h
395h
396h
INLVLE
IOCAP
IOCAN
IOCAF
IOCBP
IOCBN
IOCBF
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
ADCON0
ADCON1
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
FVRCON
DAC1CON0
DAC1CON1
CM4CON0
CM4CON1
APFCON2
APFCON1
CM3CON0
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
VREGCON(1)
RCREG
TXREG
SPBRGL
SPBRGH
RCSTA
TXSTA
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
SSP1CON3
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
CCPR2L
CCPR2H
CCP2CON
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
IOCCP
IOCCN
IOCCF
IOCEP
IOCEN
01Fh
020h
09Fh
0A0h
ADCON2
11Fh
120h
CM3CON1
19Fh
1A0h
BAUDCON
21Fh
220h
29Fh
2A0h
31Fh
320h
39Fh
3A0h
IOCEF
06Fh
070h
General
Purpose
Register
80 Bytes
0EFh
0F0h
Common RAM
70h 7Fh
07Fh
DS40001637C-page 31
1:
General
Purpose
Register
80 Bytes
16Fh
170h
Accesses
70h 7Fh
0FFh
Legend:
Note
13Fh
140h
1EFh
1F0h
Accesses
70h 7Fh
17Fh
General
Purpose
Register
80 Bytes
General
Purpose
Register
80 Bytes
26Fh
270h
Accesses
70h 7Fh
1FFh
General
Purpose
Register
80 Bytes
27Fh
36Fh
370h
2EFh
2F0h
Accesses
70h 7Fh
General
Purpose
Register
80 Bytes
Accesses
70h 7Fh
2FFh
General
Purpose
Register
80 Bytes
3EFh
3F0h
Accesses
70h 7Fh
37Fh
Accesses
70h 7Fh
3FFh
PIC16(L)F1784/6/7
General
Purpose
Register
80 Bytes
BANK 8
400h
40Bh
40Ch
Core Registers
(Table 3-2)
BANK 9
480h
48Bh
48Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
Unimplemented
Read as 0
BANK 10
500h
50Bh
50Ch
510h
511h
512h
513h
514h
519h
51Ah
51Bh
46Fh
470h
47Fh
Common RAM
(Accesses
70h 7Fh)
4EFh
4F0h
4FFh
BANK 16
800h
80Bh
80Ch
Core Registers
(Table 3-2)
87Fh
Common RAM
(Accesses
70h 7Fh)
880h
88Bh
88Ch
C0Bh
C0Ch
Core Registers
(Table 3-2)
8EFh
8F0h
8FFh
C7Fh
Legend:
Common RAM
(Accesses
70h 7Fh)
900h
90Bh
90Ch
Common RAM
(Accesses
70h 7Fh)
C80h
C8Bh
C8Ch
Core Registers
(Table 3-2)
96Fh
970h
97Fh
CFFh
Common RAM
(Accesses
70h 7Fh)
OPA1CON
OPA2CON
D00h
D0Bh
D0Ch
D7Fh
600h
60Bh
60Ch
Core Registers
(Table 3-2)
BANK 13
680h
68Bh
68Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
BANK 14
700h
70Bh
70Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
BANK 15
780h
78Bh
78Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
Unimplemented
Read as 0
CLKRCON
Unimplemented
Read as 0
Common RAM
(Accesses
70h 7Fh)
5EFh
5F0h
5FFh
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
Common RAM
(Accesses
70h 7Fh)
66Fh
670h
67Fh
BANK 19
980h
98Bh
98Ch
Core Registers
(Table 3-2)
9EFh
9F0h
9FFh
Common RAM
(Accesses
70h 7Fh)
A00h
A0Bh
A0Ch
D8Bh
D8Ch
Core Registers
(Table 3-2)
A6Fh
A70h
A7Fh
DFFh
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
E00h
E0Bh
E0Ch
Core Registers
(Table 3-2)
A80h
A8Bh
A8Ch
E7Fh
Common RAM
(Accesses
70h 7Fh)
77Fh
Core Registers
(Table 3-2)
AEFh
AF0h
AFFh
Common RAM
(Accesses
70h 7Fh)
B00h
B0Bh
B0Ch
E8Bh
E8Ch
Core Registers
(Table 3-2)
B6Fh
B70h
B7Fh
EFFh
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
F00h
F0Bh
F0Ch
Core Registers
(Table 3-2)
B80h
B8Bh
B8Ch
F7Fh
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Unimplemented
Read as 0
BEFh
BF0h
BFFh
Common RAM
(Accesses
70h 7Fh)
BANK 31
F80h
F8Bh
F8Ch
Unimplemented
Read as 0
F6Fh
F70h
Common RAM
(Accesses
70h 7Fh)
BANK 23
BANK 30
Unimplemented
Read as 0
EEFh
EF0h
7FFh
Unimplemented
Read as 0
BANK 29
E80h
Common RAM
(Accesses
70h 7Fh)
7EFh
7F0h
BANK 22
Unimplemented
Read as 0
Unimplemented
Read as 0
E6Fh
E70h
Common RAM
(Accesses
70h 7Fh)
76Fh
770h
BANK 21
BANK 28
Unimplemented
Read as 0
DEFh
DF0h
6FFh
Unimplemented
Read as 0
BANK 27
D80h
Common RAM
(Accesses
70h 7Fh)
6EFh
6F0h
BANK 20
Unimplemented
Read as 0
Unimplemented
Read as 0
D6Fh
D70h
Core Registers
(Table 3-2)
BANK 12
Unimplemented
Read as 0
Unimplemented
Read as 0
BANK 26
Unimplemented
Read as 0
CEFh
CF0h
58Bh
58Ch
Unimplemented
Read as 0
BANK 25
Unimplemented
Read as 0
C6Fh
C70h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
580h
BANK 18
Unimplemented
Read as 0
BANK 24
C00h
57Fh
BANK 17
Common RAM
(Accesses
70h 7Fh)
56Fh
570h
Core Registers
(Table 3-2)
BANK 11
Core Registers
(Table 3-2)
FFFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1784/6/7
DS40001637C-page 32
TABLE 3-6:
TABLE 3-7:
BANK 8
400h
40Bh
40Ch
Core Registers
(Table 3-2)
BANK 9
480h
48Bh
48Ch
Unimplemented
Read as 0
41F
420
Core Registers
(Table 3-2)
BANK 10
500h
50Bh
50Ch
Core Registers
(Table 3-2)
BANK 11
580h
58Bh
58Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
BANK 12
600h
60Bh
60Ch
Unimplemented
Read as 0
49F
4A0
59F
5A0
46Fh
470h
47Fh
Common RAM
(Accesses
70h 7Fh)
General
Purpose
Register
80 Bytes
61F
620
4EFh
4F0h
4FFh
BANK 16
800h
80Bh
80Ch
Core Registers
(Table 3-2)
880h
88Bh
88Ch
DS40001637C-page 33
C0Bh
C0Ch
Core Registers
(Table 3-2)
8EFh
8F0h
8FFh
C7Fh
Common RAM
(Accesses
70h 7Fh)
900h
90Bh
90Ch
Common RAM
(Accesses
70h 7Fh)
C8Bh
C8Ch
Core Registers
(Table 3-2)
96Fh
970h
97Fh
CFFh
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
D0Bh
D0Ch
Core Registers
(Table 3-2)
980h
98Bh
98Ch
D7Fh
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
9EFh
9F0h
9FFh
Common RAM
(Accesses
70h 7Fh)
66Fh
670h
67Fh
D8Bh
D8Ch
Core Registers
(Table 3-2)
A00h
A0Bh
A0Ch
DFFh
Common RAM
(Accesses
70h 7Fh)
70Bh
70Ch
Unimplemented
Read as 0
Common RAM
(Accesses
70h 7Fh)
6EFh
6F0h
6FFh
Core Registers
(Table 3-2)
780h
78Bh
78Ch
Unimplemented
Read as 0
Core Registers
(Table 3-2)
A6Fh
A70h
A7Fh
Common RAM
(Accesses
70h 7Fh)
A80h
A8Bh
A8Ch
E0Bh
E0Ch
Core Registers
(Table 3-2)
AEFh
AF0h
AFFh
E7Fh
Common RAM
(Accesses
70h 7Fh)
77Fh
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Core Registers
(Table 3-2)
Common RAM
(Accesses
70h 7Fh)
E8Bh
E8Ch
Core Registers
(Table 3-2)
B00h
B0Bh
B0Ch
EFFh
Common RAM
(Accesses
70h 7Fh)
7EFh
7F0h
7FFh
Core Registers
(Table 3-2)
B6Fh
B70h
B7Fh
Common RAM
(Accesses
70h 7Fh)
B80h
B8Bh
B8Ch
F0Bh
F0Ch
Core Registers
(Table 3-2)
BEFh
BF0h
BFFh
F7Fh
Common RAM
(Accesses
70h 7Fh)
Common RAM
(Accesses
70h 7Fh)
BANK 31
F80h
F8Bh
F8Ch
Unimplemented
Read as 0
F6Fh
F70h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
BANK 30
F00h
Common RAM
(Accesses
70h 7Fh)
BANK 23
Unimplemented
Read as 0
Unimplemented
Read as 0
EEFh
EF0h
Common RAM
(Accesses
70h 7Fh)
BANK 22
BANK 29
E80h
Unimplemented
Read as 0
E6Fh
E70h
76Fh
770h
Unimplemented
Read as 0
BANK 28
E00h
Common RAM
(Accesses
70h 7Fh)
BANK 21
Unimplemented
Read as 0
Unimplemented
Read as 0
DEFh
DF0h
General
Purpose
Register
48 Bytes
BANK 20
BANK 27
D80h
700h
Unimplemented
Read as 0
Unimplemented
Read as 0
Unimplemented
Read as 0
D6Fh
D70h
Common RAM
(Accesses
70h 7Fh)
64F
650
BANK 19
BANK 26
D00h
Unimplemented
Read as 0
CEFh
CF0h
5FFh
Unimplemented
Read as 0
BANK 25
C80h
Unimplemented
Read as 0
C6Fh
C70h
Core Registers
(Table 3-2)
5EFh
5F0h
BANK 18
Unimplemented
Read as 0
BANK 24
C00h
57Fh
Common RAM
(Accesses
70h 7Fh)
68Bh
68Ch
Core Registers
(Table 3-2)
BANK 15
Core Registers
(Table 3-2)
FFFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1784/6/7
87Fh
Common RAM
(Accesses
70h 7Fh)
56Fh
570h
BANK 17
Common RAM
(Accesses
70h 7Fh)
General
Purpose
Register
80 Bytes
680h
BANK 14
Unimplemented
Read as 0
Core Registers
(Table 3-2)
BANK 13
PIC16(L)F1784/6/7
TABLE 3-8:
PIC16(L)F1786/7 MEMORY
MAP (BANK 10 DETAILS)
TABLE 3-9:
BANK 31
BANK 10
500h
50Bh
50Ch
510h
511h
512h
513h
514h
519h
51Ah
51Bh
51Fh
520h
56Fh
570h
57Fh
Legend:
Core Registers
(Table 3-2)
Unimplemented
Read as 0
OPA1CON
OPA2CON
Unimplemented
Read as 0
CLKRCON
Unimplemented
Read as 0
General
Purpose
Register
80 Bytes
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1784/6/7 MEMORY
MAP (BANK 31 DETAILS)
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.
DS40001637C-page 34
PIC16(L)F1784/6/7
TABLE 3-10:
811h
812h
813h
814h
815h
816h
817h
818h
819h
81Ah
81Bh
81Ch
81Dh
81Eh
81Fh
820h
821h
822h
823h
824h
825h
826h
827h
828h
829h
82Ah
82Bh
82Ch
82Dh
82Eh
82Fh
830h
Legend:
PSMC1CON
PSMC1MDL
PSMC1SYNC
PSMC1CLK
PSMC1OEN
PSMC1POL
PSMC1BLNK
PSMC1REBS
PSMC1FEBS
PSMC1PHS
PSMC1DCS
PSMC1PRS
PSMC1ASDC
PSMC1ASDD
PSMC1ASDS
PSMC1INT
PSMC1PHL
PSMC1PHH
PSMC1DCL
PSMC1DCH
PSMC1PRL
PSMC1PRH
PSMC1TMRL
PSMC1TMRH
PSMC1DBR
PSMC1DBF
PSMC1BLKR
PSMC1BLKF
PSMC1FFA
PSMC1STR0
PSMC1STR1
BANK 16
831h
832h
833h
834h
835h
836h
837h
838h
839h
83Ah
83Bh
83Ch
83Dh
83Eh
83Fh
840h
841h
842h
843h
844h
845h
846h
847h
848h
849h
84Ah
84Bh
84Ch
84Dh
84Eh
84Fh
850h
PSMC2CON
PSMC2MDL
PSMC2SYNC
PSMC2CLK
PSMC2OEN
PSMC2POL
PSMC2BLNK
PSMC2REBS
PSMC2FEBS
PSMC2PHS
PSMC2DCS
PSMC2PRS
PSMC2ASDC
PSMC2ASDD
PSMC2ASDS
PSMC2INT
PSMC2PHL
PSMC2PHH
PSMC2DCL
PSMC2DCH
PSMC2PRL
PSMC2PRH
PSMC2TMRL
PSMC2TMRH
PSMC2DBR
PSMC2DBF
PSMC2BLKR
PSMC2BLKF
PSMC2FFA
PSMC2STR0
PSMC2STR1
BANK 16
851h
852h
853h
854h
855h
856h
857h
858h
859h
85Ah
85Bh
85Ch
85Dh
85Eh
85Fh
860h
861h
862h
863h
864h
865h
866h
867h
868h
869h
86Ah
86Bh
86Ch
86Dh
86Eh
86Fh
870h
PSMC3CON
PSMC3MDL
PSMC3SYNC
PSMC3CLK
PSMC3OEN
PSMC3POL
PSMC3BLNK
PSMC3REBS
PSMC3FEBS
PSMC3PHS
PSMC3DCS
PSMC3PRS
PSMC3ASDC
PSMC3ASDD
PSMC3ASDS
PSMC3INT
PSMC3PHL
PSMC3PHH
PSMC3DCL
PSMC3DCH
PSMC3PRL
PSMC3PRH
PSMC3TMRL
PSMC3TMRH
PSMC3DBR
PSMC3DBF
PSMC3BLKR
PSMC3BLKF
PSMC3FFA
PSMC3STR0
PSMC3STR1
DS40001637C-page 35
PIC16(L)F1784/6/7
3.3.5
TABLE 3-11:
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 0000
0000 0000
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
DS40001637C-page 36
PIC16(L)F1784/6/7
TABLE 3-12:
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
00Ch PORTA
00Dh PORTB
00Eh PORTC
00Fh PORTD(3)
RE3
RE2(3)
RE1(3)
RE0(3)
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
PIR3
CCP3IF
014h PIR4
PSMC3TIF
PSMC2TIF
PSMC1TIF
PSMC3SIF
PSMC2SIF
010h PORTE
011h
PIR1
012h PIR2
13h
015h TMR0
016h TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
017h TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
018h T1CON
TMR1CS1
TMR1CS0
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
019h T1GCON
TMR1GE
T1GPOL
T1GTM
T1GSPM
T1GGO/
DONE
T1GVAL
016h TMR2
Holding Register for the Least Significant Byte of the 16-bit TMR2 Register
017h PR2
Holding Register for the Most Significant Byte of the 16-bit TMR2 Register
018h T2CON
01Dh
to
01Fh
T2OUTPS<3:0>
TMR1ON
T1GSS<1:0>
TMR2ON
T2CKPS<1:0>
Unimplemented
Bank 1
08Ch TRISA
08Dh TRISB
08Eh TRISC
08Fh TRISD(3)
090h TRISE
(2)
TRISE2(3)
TRISE1(3)
TRISE0(3)
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
CCP3IE
PSMC3TIE
PSMC2TIE
PSMC1TIE
PSMC3SIE
PSMC2SIE
091h PIE1
TMR1GIE
ADIE
092h PIE2
OSFIE
C2IE
093h PIE3
094h PIE4
095h OPTION_REG
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
096h PCON
STKOVF
STKUNF
RWDT
RMCLR
097h WDTCON
098h OSCTUNE
099h OSCCON
SPLLEN
09Ah OSCSTAT
T1OSCR
09Bh ADRESL
09Ch ADRESH
09Dh ADCON0
ADRMD
09Eh ADCON1
ADFM
09Fh ADCON2
Legend:
Note
1:
2:
3:
4:
PS<2:0>
RI
POR
WDTPS<4:0>
SWDTEN
TUN<5:0>
IRCF<3:0>
PLLR
OSTS
HFIOFR
HFIOFL
MFIOFR
SCS<1:0>
LFIOFR
HFIOFS
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
GO/DONE
ADNREF
ADON
ADPREF<1:0>
CHSN<3:0>
DS40001637C-page 37
PIC16(L)F1784/6/7
TABLE 3-12:
Addr
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
10Eh LATC
10Fh LATD(3)
110h
LATE(3)
LATE2
LATE1
LATE0
111h
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1ZLF
C1SP
C1HYS
C1SYNC
112h
CM1CON1
C1INTP
C1INTN
113h
CM2CON0
C2ON
C2OUT
C2ZLF
C2SP
114h
CM2CON1
C2INTP
C2INTN
115h
CMOUT
MC4OUT(3)
MC3OUT
MC2OUT
MC1OUT
116h
BORCON
SBOREN
BORFS
BORRDY
117h
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
118h
DAC1CON0
DAC1EN
---
DAC1OE1
DAC1OE2
DAC1PSS<1:0>
119h
DAC1CON1
C1PCH<2:0>
C2OE
C2POL
C1NCH<2:0>
C2PCH<2:0>
C2HYS
C2NCH<2:0>
ADFVR<1:0>
---
DAC1NSS
C4HYS
C4SYNC
DAC1R<7:0>
11Ah CM4CON0
C4ON
C4OUT
11Bh CM4CON1
C4INTP
C4INTN
C4OE
C4POL
C4ZLF
C4SP
C4PCH<1:0>
C4NCH<1:0>
11Ch APFCON2
CCP3SEL
11Dh APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
11Eh CM3CON0
C3ON
C3OUT
C3OE
C3POL
C3ZLF
C3SP
C3HYS
C3SYNC
C3INTP
C3INTN
11Fh
CM3CON1
C3PCH<2:0>
C3NCH<2:0>
Bank 3
18Ch ANSELA
ANSA7
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
18Dh ANSELB
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
18Eh Unimplemented
18Fh ANSELD(3)
190h ANSELE(3)
191h EEADRL
193h EEDATL
195h EECON1
196h EECON2
ANSD2
ANSD1
ANSD0
ANSE2
ANSE1
ANSE0
(2)
194h EEDATH
EEPGD
CFGS
FREE
WRERR
WREN
WR
RD
VREGPM
Reserved
197h VREGCON(4)
192h EEADRH
198h
Unimplemented
199h RCREG
19Ah TXREG
19Bh SPBRG
BRG<7:0>
19Ch SPBRGH
BRG<15:8>
19Dh RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
19Eh TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
19Fh BAUDCON
Legend:
Note
1:
2:
3:
4:
DS40001637C-page 38
PIC16(L)F1784/6/7
TABLE 3-12:
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 4
20Ch WPUA
WPUA7
WPUA6
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
20Dh WPUB
WPUB7
WPUB6
WPUB5
WPUB4
WPUB3
WPUB2
WPUB1
WPUB0
20Eh WPUC
WPUC7
WPUC6
WPUC5
WPUC4
WPUC3
WPUC2
WPUC1
WPUC0
20Fh WPUD(3)
WPUD7
WPUD6
WPUD5
WPUD4
WPUD3
WPUD2
WPUD1
WPUD0
WPUE3
WPUE2(3)
WPUE1(3)
WPUE0(3)
210h WPUE
211h
SSP1BUF
212h SSP1ADD
ADD<7:0>
213h SSP1MSK
MSK<7:0>
214h SSP1STAT
SMP
CKE
D/A
215h SSP1CON1
WCOL
SSPOV
SSPEN
CKP
216h SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
217h SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
218h
21Fh
R/W
UA
BF
SSPM<3:0>
Unimplemented
Bank 5
28Ch ODCONA
28Dh ODCONB
28Eh ODCONC
28Fh ODCOND(3)
290h ODCONE(3)
291h CCPR1L
292h CCPR1H
293h CCP1CON
294h
297h
ODE2
ODE1
ODE0
DC1B<1:0>
CCP1M<3:0>
Unimplemented
298h CCPR2L
299h CCPR2H
29Ah CCP2CON
29Bh
29Fh
DC2B<1:0>
CCP2M<3:0>
Unimplemented
Bank 6
30Ch SLRCONA
30Dh SLRCONB
30Eh SLRCONC
30Fh SLRCOND(3)
310h SLRCONE(3)
311h
CCPR3L
312h CCPR3H
313h CCP3CON
314h
31Fh
Legend:
Note
1:
2:
3:
4:
DC3B<1:0>
SLRE2
SLRE1
SLRE0
CCP3M<3:0>
Unimplemented
DS40001637C-page 39
PIC16(L)F1784/6/7
TABLE 3-12:
Addr
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 7
38Ch INLVLA
38Dh INLVLB
38Eh INLVLC
38Fh INLVLD(3)
390h INLVLE
INLVLE3
INLVLE2(3)
INLVLE1(3)
391h IOCAP
IOCAP<7:0>
392h IOCAN
IOCAN<7:0>
393h IOCAF
IOCAF<7:0>
394h IOCBP
IOCBP<7:0>
395h IOCBN
IOCBN<7:0>
396h IOCBF
IOCBF<7:0>
397h IOCCP
IOCCP<7:0>
398h IOCCN
IOCCN<7:0>
399h IOCCF
IOCCF<7:0>
39Ah
39Ch
Unimplemented
39Dh IOCEP
IOCEP3
39Eh IOCEN
IOCEN3
39Fh IOCEF
IOCEF3
Bank 8-9
40Ch
or
41Fh
and
48Ch
or
49Fh
Unimplemented
Unimplemented
Bank 10
50Ch
510h
511h
OPA1CON
512h
OPA1EN
OPA1SP
OPA1PCH<1:0>
OPA2SP
OPA2PCH<1:0>
OPA3PCH<1:0>
Unimplemented
513h OPA2CON
514h
OPA2EN
Unimplemented
515h OPA3CON(3)
OPA3EN
OPA3SP
51Ah CLKRCON
CLKREN
CLKROE
CLKRSLR
51Bh
51Fh
Legend:
Note
1:
2:
3:
4:
CLKRDC<1:0>
CLKRDIV<2:0>
Unimplemented
DS40001637C-page 40
PIC16(L)F1784/6/7
TABLE 3-12:
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 11-15
x0Ch
or
x8Ch
to
x6Fh
or
xEFh
Legend:
Note
1:
2:
3:
4:
Unimplemented
DS40001637C-page 41
PIC16(L)F1784/6/7
TABLE 3-12:
Addr
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 16
80Ch
810h
811h
Unimplemented
PSMC1CON
PSMC1EN
812h PSMC1MDL
P1MDLEN
P1MDLPOL
P1MDLBIT
813h PSMC1SYNC
P1DCPOL
P1POFST
P1PRPOL
814h PSMC1CLK
815h PSMC1OEN
P1OEF
816h PSMC1POL
P1INPOL
P1POLF
817h PSMC1BLNK
818h PSMC1REBS
P1REBIN
819h PSMC1FEBS
P1FEBIN
81Ah PSMC1PHS
P1PHSIN
81Bh PSMC1DCS
P1DCSIN
81Ch PSMC1PRS
P1PRSIN
P1MODE<3:0>
P1MSRC<3:0>
P1SYNC<1:0>
P1CSRC<1:0>
P1OEE
P1OED
P1OEC
P1OEB
P1OEA
P1POLE
P1POLD
P1POLC
P1POLB
P1POLA
P1REBSC4
P1REBSC3
P1REBSC2
P1REBSC1
P1FEBSC4
P1FEBSC3
P1FEBSC2
P1FEBSC1
P1PHSC4
P1PHSC3
P1PHSC2
P1PHSC1
P1PHST
P1DCSC4
P1DCSC3
P1DCSC2
P1DCSC1
P1DCST
P1PRSC4
P1PRSC3
P1PRSC2
P1PRSC1
P1PRST
P1ASE
P1ASDEN
P1ARSEN
P1ASDOV
81Eh PSMC1ASDL
P1ASDLF
P1ASDLE
P1ASDLD
P1ASDLC
P1ASDLB
P1ASDLA
81Fh PSMC1ASDS
P1ASDSIN
P1ASDSC4
P1ASDSC3
P1ASDSC2
P1ASDSC1
P1TOVIE
P1TPHIE
P1TDCIE
P1TPRIE
P1TOVIF
P1TPHIF
P1TDCIF
P1TPRIF
81Dh PSMC1ASDC
820h PSMC1INT
P1CPRE<1:0>
P1FEBM<1:0>
P1REBM<1:0>
821h PSMC1PHL
822h PSMC1PHH
823h PSMC1DCL
824h PSMC1DCH
825h PSMC1PRL
826h PSMC1PRH
829h PSMC1DBR
82Ah PSMC1DBF
82Bh PSMC1BLKR
82Ch PSMC1BLKF
82Dh PSMC1FFA
82Eh PSMC1STR0
P1STRF
P1STRE
P1STRD
P1STRC
P1STRB
P1STRA
82Fh PSMC1STR1
P1SYNC
P1LSMEN
P1HSMEN
830h
Legend:
Note
1:
2:
3:
4:
Unimplemented
DS40001637C-page 42
PIC16(L)F1784/6/7
TABLE 3-12:
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 16 (Continued)
831h PSMC2CON
PSMC2EN
P2MODE<3:0>
832h PSMC2MDL
P2MDLEN
P2MDLPOL
P2MDLBIT
P2MSRC<3:0>
833h PSMC2SYNC
P2DCPOL
P2POFST
P2PRPOL
834h PSMC2CLK
835h PSMC2OEN
836h PSMC2POL
P2INPOL
837h PSMC2BLNK
838h PSMC2REBS
P2REBIN
839h PSMC2FEBS
P2FEBIN
83Ah PSMC2PHS
P2PHSIN
83Bh PSMC2DCS
83Ch PSMC2PRS
P2SYNC<1:0>
P2CSRC<1:0>
P2OEB
P2OEA
P2POLB
P2POLA
P2REBSC4
P2REBSC3
P2REBSC2
P2REBSC1
P2FEBSC4
P2FEBSC3
P2FEBSC2
P2FEBSC1
P2PHSC4
P2PHSC3
P2PHSC2
P2PHSC1
P2PHST
P2DCSIN
P2DCSC4
P2DCSC3
P2DCSC2
P2DCSC1
P2DCST
P2PRSIN
P2PRSC4
P2PRSC3
P2PRSC2
P2PRSC1
P2PRST
P2ASE
P2ASDEN
P2ARSEN
P2ASDOV
83Eh PSMC2ASDL
P2ASDLF
P2ASDLE
P2ASDLD
P2ASDLC
P2ASDLB
P2ASDLA
83Fh PSMC2ASDS
P2ASDSIN
P2ASDSC4
P2ASDSC3
P2ASDSC2
P2ASDSC1
P2TOVIE
P2TPHIE
P2TDCIE
P2TPRIE
P2TOVIF
P2TPHIF
P2TDCIF
P2TPRIF
83Dh PSMC2ASDC
840h PSMC2INT
P2CPRE<1:0>
P2FEBM<1:0>
P2REBM<1:0>
841h PSMC2PHL
842h PSMC2PHH
843h PSMC2DCL
844h PSMC2DCH
845h PSMC2PRL
846h PSMC2PRH
849h PSMC2DBR
84Ah PSMC2DBF
84Bh PSMC2BLKR
84Ch PSMC2BLKF
84Dh PSMC2FFA
84Eh PSMC2STR0
P2STRB
P2STRA
84Fh PSMC2STR1
P2SYNC
P2LSMEN
P2HSMEN
850h
Legend:
Note
1:
2:
3:
4:
Unimplemented
DS40001637C-page 43
PIC16(L)F1784/6/7
TABLE 3-12:
Addr
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 16 (Continued)
851h PSMC3CON
PSMC3EN
PSMC3LD
P3DBFE
P3DBRE
P3MODE<3:0>
852h PSMC3MDL
P3MDLEN
P3MDLPOL
P3MDLBIT
P3MSRC<3:0>
853h PSMC3SYNC
P3DCPOL
P3POFST
P3PRPOL
854h PSMC3CLK
855h PSMC3OEN
856h PSMC3POL
P3INPOL
857h PSMC3BLNK
858h PSMC3REBS
P3REBSIN
859h PSMC3FEBS
P3FEBSIN
85Ah PSMC3PHS
P3PHSIN
85Bh PSMC3DCS
85Ch PSMC3PRS
P3SYNC<1:0>
P3CSRC<1:0>
P3OEB
P3OEA
P3POLB
P3POLA
P3REBSC4
P3REBSC3
P3REBSC2
P3REBSC1
P3FEBSC4
P3FEBSC3
P3FEBSC2
P3FEBSC1
P3PHSC4
P3PHSC3
P3PHSC2
P3PHSC1
P3PHST
P3DCSIN
P3DCSC4
P3DCSC3
P3DCSC2
P3DCSC1
P3DCST
P3PRSIN
P3PRSC4
P3PRSC3
P3PRSC2
P3PRSC1
P3PRST
P3ASE
P3ASDEN
P3ARSEN
P3ASDOV
85Eh PSMC3ASDL
P3ASDLB
P3ASDLA
85Fh PSMC3ASDS
P3ASDSIN
P3ASDSC4
P3ASDSC3
P3ASDSC2
P3ASDSC1
P3TOVIE
P3TPHIE
P3TDCIE
P3TPRIE
P3TOVIF
P3TPHIF
P3TDCIF
P3TPRIF
85Dh PSMC3ASDC
860h PSMC3INT
P3CPRE<1:0>
P3FEBM<1:0>
P3REBM<1:0>
861h PSMC3PHL
862h PSMC3PHH
863h PSMC3DCL
864h PSMC3DCH
865h PSMC3PRL
866h PSMC3PRH
869h PSMC3DBR
86Ah PSMC3DBF
86Bh PSMC3BLKR
86Ch PSMC3BLKF
86Dh PSMC3FFA
86Eh PSMC3STR0
P3STRB
P3STRA
86Fh PSMC3STR1
P3SSYNC
P3LSMEN
P3HSMEN
Bank 17-30
x0Ch
or
x8Ch
to
x1Fh
or
x9Fh
Legend:
Note
1:
2:
3:
4:
Unimplemented
DS40001637C-page 44
PIC16(L)F1784/6/7
TABLE 3-12:
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 31
F8Ch
to
FE3h
Unimplemented
FE4h STATUS_
SHAD
DC
FE7h PCLATH_
SHAD
FE9h FSR0H_
SHAD
FEBh FSR1H_
SHAD
FECh
Unimplemented
FEDh STKPTR
FEEh TOSL
FEFh TOSH
Legend:
Note
1:
2:
3:
4:
DS40001637C-page 45
PIC16(L)F1784/6/7
3.4
3.4.3
FIGURE 3-4:
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.4.4
BRANCHING
15
PC
PCL
0
BRA
15
PC + OPCODE <8:0>
3.4.1
MODIFYING PCL
3.4.2
COMPUTED GOTO
DS40001637C-page 46
PIC16(L)F1784/6/7
3.5
3.5.1
Stack
Note:
FIGURE 3-5:
TOSH:TOSL
0x0F
STKPTR = 0x1F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
0x00
TOSH:TOSL
0x1F
0x0000
STKPTR = 0x1F
DS40001637C-page 47
PIC16(L)F1784/6/7
FIGURE 3-6:
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
TOSH:TOSL
FIGURE 3-7:
0x00
Return Address
STKPTR = 0x00
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
TOSH:TOSL
DS40001637C-page 48
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x06
PIC16(L)F1784/6/7
FIGURE 3-8:
TOSH:TOSL
3.5.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.6
Indirect Addressing
DS40001637C-page 49
PIC16(L)F1784/6/7
FIGURE 3-9:
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.
DS40001637C-page 50
PIC16(L)F1784/6/7
3.6.1
FIGURE 3-10:
Direct Addressing
4
BSR
Indirect Addressing
From Opcode
7
0
Bank Select
Location Select
FSRxH
0
FSRxL
0
Bank Select
11111
Bank 31
Location Select
0x00
0x7F
DS40001637C-page 51
PIC16(L)F1784/6/7
3.6.2
3.6.3
FIGURE 3-11:
7
FSRnH
0 0 1
FSRnL
FIGURE 3-12:
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
DS40001637C-page 52
0xF6F
0xFFFF
0x7FFF
PIC16(L)F1784/6/7
4.0
DEVICE CONFIGURATION
4.1
Configuration Words
DS40001637C-page 53
PIC16(L)F1784/6/7
4.2
REGISTER 4-1:
R/P-1
R/P-1
FCMEN
IESO
CLKOUTEN
R/P-1
R/P-1
R/P-1
BOREN<1:0>
CPD
bit 13
R/P-1
R/P-1
R/P-1
CP
MCLRE
PWRTE
bit 8
R/P-1
R/P-1
R/P-1
WDTE<1:0>
R/P-1
R/P-1
FOSC<2:0>
bit 7
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-9
bit 8
bit 7
bit 6
bit 5
bit 4-3
DS40001637C-page 54
PIC16(L)F1784/6/7
REGISTER 4-1:
bit 2-0
Note 1:
DS40001637C-page 55
PIC16(L)F1784/6/7
REGISTER 4-2:
R/P-1
R/P-1
R/P-1
R/P-1
R/P-1
LVP
DEBUG
LPBOR
BORV
STVREN
PLLEN
bit 13
bit 8
U-1
U-1
R/P-1
U-1
U-1
U-1
VCAPEN
R/P-1
R/P-1
WRT<1:0>
bit 7
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-6
Unimplemented: Read as 1
bit 5
bit 4-2
Unimplemented: Read as 1
bit 1-0
Note 1:
2:
3:
4:
The LVP bit cannot be programmed to 0 when Programming mode is entered via LVP.
Not implemented on LF devices.
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.
DS40001637C-page 56
PIC16(L)F1784/6/7
4.3
Code Protection
4.3.1
4.3.2
4.4
Write Protection
4.5
User ID
DS40001637C-page 57
PIC16(L)F1784/6/7
4.6
4.7
REGISTER 4-3:
DEV<8:3>
bit 13
R
bit 8
R
DEV<2:0>
REV<4:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-5
0 = Bit is cleared
DEV<8:0>: Device ID bits
DEVICEID<13:0> Values
Device
bit 4-0
DEV<8:0>
REV<4:0>
PIC16F1784
10 1010 010
x xxxx
PIC16LF1784
10 1010 111
x xxxx
PIC16F1786
10 1010 011
x xxxx
PIC16LF1786
10 1011 000
x xxxx
PIC16F1787
10 1010 100
x xxxx
PIC16LF1787
10 1011 001
x xxxx
DS40001637C-page 58
PIC16(L)F1784/6/7
5.0
RESETS
FIGURE 5-1:
MCLRE
Sleep
WDT
Time-out
Device
Reset
Power-on
Reset
VDD
Brown-out
Reset
PWRT
Done
LPBOR
Reset
PWRTE
LFINTOSC
BOR
Active(1)
Note 1:
DS40001637C-page 59
PIC16(L)F1784/6/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
DS40001637C-page 60
PIC16(L)F1784/6/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
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:
DS40001637C-page 61
PIC16(L)F1784/6/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
DS40001637C-page 62
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 immediately (see
Figure 5-3). This is useful for testing purposes or to
synchronize more than one device operating in parallel.
PIC16(L)F1784/6/7
FIGURE 5-3:
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
TMCLR
Internal RESET
Oscillator Modes
External Crystal
TOST
Internal Oscillator
Oscillator
FOSC
FOSC
DS40001637C-page 63
PIC16(L)F1784/6/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
DS40001637C-page 64
PIC16(L)F1784/6/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
DS40001637C-page 65
PIC16(L)F1784/6/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
61
PCON
STKOVF
STKUNF
RWDT
RMCLR
RI
POR
BOR
65
STATUS
TO
PD
DC
27
WDTCON
SWDTEN
110
WDTPS<4:0>
Legend: = unimplemented location, read as 0. Shaded cells are not used by Resets.
DS40001637C-page 66
PIC16(L)F1784/6/7
6.0
6.1
Overview
DS40001637C-page 67
PIC16(L)F1784/6/7
SIMPLIFIED PIC MCU CLOCK SOURCE BLOCK DIAGRAM
FIGURE 6-1:
Oscillator Timer1
T1OSO
T1OSCEN
Enable
Oscillator
T1OSI
T1OSC
01
External
Oscillator
OSC2
Sleep
10
1
Sleep
PRIMUX
OSC1
PSMCMUX
0
2
4 x PLL
00
01
FOSC
To CPU and
Peripherals
00
1
IRCF<3:0>
HFPLL
500 kHz
Source
16 MHz
(HFINTOSC)
Postscaler
Internal
Oscillator
Block
500 kHz
(MFINTOSC)
31 kHz
Source
31 kHz
FOSC<2:0>
=100
=00
100
PSMC 64 MHz
0000
00
XXX
PLLEN or
SPLLEN
PRIMUX
PSMCMUX
PLLMUX
10
01
10
(1)
00
XX
1X
SCS<1:0>
31 kHz (LFINTOSC)
SCS
INTOSC
1111
MUX
16 MHz
8 MHz
4 MHz
2 MHz
1 MHz
500 kHz
250 kHz
125 kHz
62.5 kHz
31.25 kHz
PLLMUX
Note 1: This selection should not be made when the PSMC is using the 64 MHz clock option.
DS40001637C-page 68
PIC16(L)F1784/6/7
6.2
6.2.1
FIGURE 6-2:
OSC1/CLKIN
Clock from
Ext. System
PIC MCU
FOSC/4 or I/O(1)
Note 1:
OSC2/CLKOUT
6.2.1.1
EC Mode
6.2.1.2
DS40001637C-page 69
PIC16(L)F1784/6/7
FIGURE 6-3:
QUARTZ CRYSTAL
OPERATION (LP, XT OR
HS MODE)
FIGURE 6-4:
CERAMIC RESONATOR
OPERATION
(XT OR HS MODE)
PIC MCU
PIC MCU
OSC1/CLKIN
C1
To Internal
Logic
Quartz
Crystal
C2
Note 1:
2:
OSC1/CLKIN
RS(1)
RF(2)
C1
Sleep
OSC2/CLKOUT
RP(3)
C2 Ceramic
RS(1)
Resonator
Note 1:
Note 1: Quartz
crystal
characteristics
vary
according to type, package and
manufacturer. The user should consult the
manufacturer data sheets for specifications
and recommended application.
2: Always verify oscillator performance over
the VDD and temperature range that is
expected for the application.
3: For oscillator design assistance, reference
the following Microchip Applications Notes:
AN826, Crystal Oscillator Basics and
Crystal Selection for rfPIC and PIC
Devices (DS00826)
AN849, Basic PIC Oscillator Design
(DS00849)
AN943, Practical PIC Oscillator
Analysis and Design (DS00943)
AN949, Making Your Oscillator Work
(DS00949)
DS40001637C-page 70
To Internal
Logic
RF(2)
Sleep
OSC2/CLKOUT
6.2.1.3
PIC16(L)F1784/6/7
6.2.1.4
4x PLL
6.2.1.5
TIMER1 Oscillator
FIGURE 6-5:
Note 1: Quartz
crystal
characteristics
vary
according to type, package and
manufacturer. The user should consult the
manufacturer data sheets for specifications
and recommended application.
2: Always verify oscillator performance over
the VDD and temperature range that is
expected for the application.
3: For oscillator design assistance, reference
the following Microchip Applications Notes:
AN826, Crystal Oscillator Basics and
Crystal Selection for rfPIC and PIC
Devices (DS00826)
AN849, Basic PIC Oscillator Design
(DS00849)
AN943, Practical PIC Oscillator
Analysis and Design (DS00943)
AN949, Making Your Oscillator Work
(DS00949)
TB097, Interfacing a Micro Crystal
MS1V-T1K 32.768 kHz Tuning Fork
Crystal to a PIC16F690/SS (DS91097)
AN1288, Design Practices for
Low-Power External Oscillators
(DS01288)
QUARTZ CRYSTAL
OPERATION (TIMER1
OSCILLATOR)
PIC MCU
T1OSI
C1
To Internal
Logic
32.768 kHz
Quartz
Crystal
C2
T1OSO
DS40001637C-page 71
PIC16(L)F1784/6/7
6.2.1.6
External RC Mode
6.2.2
FIGURE 6-6:
EXTERNAL RC MODES
VDD
PIC MCU
REXT
OSC1/CLKIN
Internal
Clock
CEXT
VSS
FOSC/4 or I/O(1)
OSC2/CLKOUT
2.
3.
DS40001637C-page 72
PIC16(L)F1784/6/7
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<2:0> = 100, 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.
6.2.2.3
6.2.2.4
LFINTOSC
DS40001637C-page 73
PIC16(L)F1784/6/7
6.2.2.5
Note:
6.2.2.6
DS40001637C-page 74
PIC16(L)F1784/6/7
6.2.2.7
5.
6.
7.
DS40001637C-page 75
PIC16(L)F1784/6/7
FIGURE 6-7:
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
Start-up Time
2-cycle Sync
Running
LFINTOSC
0
IRCF <3:0>
System Clock
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
2-cycle Sync
Running
LFINTOSC
IRCF <3:0>
System Clock
LFINTOSC
HFINTOSC/MFINTOSC
LFINTOSC
Start-up Time
2-cycle Sync
Running
HFINTOSC/
MFINTOSC
IRCF <3:0>
=0
System Clock
DS40001637C-page 76
PIC16(L)F1784/6/7
6.3
Clock Switching
6.3.3
TIMER1 OSCILLATOR
6.3.1
6.3.4
6.3.2
DS40001637C-page 77
PIC16(L)F1784/6/7
6.4
6.4.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
Sleep/POR
EC, RC(1)
DC 32 MHz
2 cycles
LFINTOSC
EC,
RC(1)
DC 32 MHz
1 cycle of each
Sleep/POR
Timer1 Oscillator
LP, XT, HS(1)
32 kHz-20 MHz
MFINTOSC(1)
HFINTOSC(1)
2 s (approx.)
LFINTOSC(1)
31 kHz
1 cycle of each
Timer1 Oscillator
32 kHz
PLL inactive
PLL active
16-32 MHz
2 ms (approx.)
Note 1:
PLL inactive.
DS40001637C-page 78
PIC16(L)F1784/6/7
6.4.2
1.
2.
3.
4.
5.
6.
7.
TWO-SPEED START-UP
SEQUENCE
6.4.3
FIGURE 6-8:
TWO-SPEED START-UP
INTOSC
TOST
OSC1
1022 1023
OSC2
Program Counter
PC - N
PC
PC + 1
System Clock
DS40001637C-page 79
PIC16(L)F1784/6/7
6.5
6.5.3
FIGURE 6-9:
External
Clock
LFINTOSC
Oscillator
64
31 kHz
(~32 s)
488 Hz
(~2 ms)
Sample Clock
6.5.1
FAIL-SAFE DETECTION
6.5.2
6.5.4
Clock
Failure
Detected
FAIL-SAFE OPERATION
DS40001637C-page 80
PIC16(L)F1784/6/7
FIGURE 6-10:
Sample Clock
Oscillator
Failure
System
Clock
Output
Clock Monitor Output
(Q)
Failure
Detected
OSCFIF
Test
Note:
Test
Test
The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in
this example have been chosen for clarity.
DS40001637C-page 81
PIC16(L)F1784/6/7
6.6
REGISTER 6-1:
R/W-0/0
SPLLEN
R/W-1/1
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:
DS40001637C-page 82
PIC16(L)F1784/6/7
REGISTER 6-2:
R-1/q
R-0/q
R-q/q
R-0/q
R-0/q
R-q/q
R-0/0
R-0/q
T1OSCR
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
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001637C-page 83
PIC16(L)F1784/6/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 7
OSCCON
SPLLEN
OSCSTAT
T1OSCR
OSCTUNE
Bit 6
Bit 5
PLLR
OSTS
Bit 4
Bit 3
Bit 2
HFIOFR
HFIOFL
MFIOFR
IRCF<3:0>
Bit 1
Bit 0
SCS<1:0>
Register
on Page
82
LFIOFR
HFIOFS
83
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
PIR2
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
T1OSCEN
T1SYNC
TMR1ON
207
TMR1CS<1:0>
T1CON
Legend:
CONFIG1
Legend:
Note 1:
T1CKPS<1:0>
84
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
TABLE 6-3:
Name
TUN<5:0>
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
FCMEN
IESO
CLKOUTEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
Bit 9/1
BOREN<1:0>
WDTE<1:0>
FOSC<2:0>
Bit 8/0
CPD
Register
on Page
54
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
PIC16F1784/6/7 only.
DS40001637C-page 84
PIC16(L)F1784/6/7
7.0
7.1
7.3
7.3.1
OSCILLATOR MODES
7.3.2
CLKOUT FUNCTION
7.4
Slew Rate
7.2
Effects of a Reset
DS40001637C-page 85
PIC16(L)F1784/6/7
7.5
REGISTER 7-1:
R/W-0/0
R/W-0/0
R/W-1/1
CLKREN
CLKROE
CLKRSLR
R/W-1/1
R/W-0/0
R/W-0/0
CLKRDC<1:0>
R/W-0/0
R/W-0/0
CLKRDIV<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-3
bit 2-0
Note 1: In this mode, the 25% and 75% duty cycle accuracy will be dependent on the source clock duty cycle.
2: In this mode, the duty cycle will always be equal to the source clock duty cycle, unless a duty cycle of 0%
is selected.
3: To route CLKR to pin, CLKOUTEN of Configuration Words = 1 is required. CLKOUTEN of Configuration
Words = 0 will result in FOSC/4. See Section 7.3 Conflicts with the CLKR Pin for details.
DS40001637C-page 86
PIC16(L)F1784/6/7
TABLE 7-1:
Name
CLKRCON
Legend:
Bit 7
Bit 6
Bit 5
CLKREN
CLKROE
CLKRSLR
CONFIG1
Legend:
Bit 3
CLKRDC<1:0>
Bit 2
Bit 1
Bit 0
CLKRDIV<2:0>
Register
on Page
86
= unimplemented locations read as 0. Shaded cells are not used by reference clock sources.
TABLE 7-2:
Name
Bit 4
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
WDTE1<:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
CPD
Register
on Page
54
= unimplemented locations read as 0. Shaded cells are not used by reference clock sources.
DS40001637C-page 87
PIC16(L)F1784/6/7
8.0
INTERRUPTS
Operation
Interrupt Latency
Interrupts During Sleep
INT Pin
Automatic Context Saving
FIGURE 8-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>
DS40001637C-page 88
GIE
PIC16(L)F1784/6/7
8.1
Operation
8.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 8.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.
DS40001637C-page 89
PIC16(L)F1784/6/7
FIGURE 8-2:
INTERRUPT LATENCY
OSC1
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
DS40001637C-page 90
PC+2
NOP
NOP
PIC16(L)F1784/6/7
FIGURE 8-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
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 30.0 Electrical Specifications.
5:
DS40001637C-page 91
PIC16(L)F1784/6/7
8.3
8.4
INT Pin
8.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.
DS40001637C-page 92
PIC16(L)F1784/6/7
8.6
REGISTER 8-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 IOCBF register
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.
DS40001637C-page 93
PIC16(L)F1784/6/7
REGISTER 8-2:
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
TMR1GIE
ADIE
RCIE
TXIE
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
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
DS40001637C-page 94
PIC16(L)F1784/6/7
REGISTER 8-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
R/W-0/0
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
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
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
DS40001637C-page 95
PIC16(L)F1784/6/7
REGISTER 8-4:
U-0
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
CCP3IE
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
DS40001637C-page 96
PIC16(L)F1784/6/7
REGISTER 8-5:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
PSMC3TIE
PSMC2TIE
PSMC1TIE
PSMC3SIE
PSMC2SIE
PSMC1SIE
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
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Note:
DS40001637C-page 97
PIC16(L)F1784/6/7
REGISTER 8-6:
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TMR1GIF
ADIF
RCIF
TXIF
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
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
DS40001637C-page 98
PIC16(L)F1784/6/7
REGISTER 8-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
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
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
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
DS40001637C-page 99
PIC16(L)F1784/6/7
REGISTER 8-8:
U-0
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
CCP3IF
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
DS40001637C-page 100
PIC16(L)F1784/6/7
REGISTER 8-9:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
PSMC3TIF
PSMC2TIF
PSMC1TIF
PSMC3SIF
PSMC2SIF
PSMC1SIF
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
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Note:
DS40001637C-page 101
PIC16(L)F1784/6/7
TABLE 8-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
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
PIE3
CCP3IE
96
OPTION_REG
PIE4
PIR1
TMR1GIF
ADIF
RCIF
PIR2
OSFIF
C2IF
PIR3
PIR4
Legend:
PS<2:0>
93
198
94
97
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
CCP3IF
100
98
101
DS40001637C-page 102
PIC16(L)F1784/6/7
9.0
9.1
1.
2.
3.
4.
5.
6.
1.
2.
3.
4.
5.
6.
7.
8.
9.
DS40001637C-page 103
PIC16(L)F1784/6/7
9.1.1
FIGURE 9-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)
T1OSC(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)
DS40001637C-page 104
PIC16(L)F1784/6/7
9.2
9.2.1
9.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.
DS40001637C-page 105
PIC16(L)F1784/6/7
9.3
REGISTER 9-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:
F devices only.
See Section 30.0 Electrical Specifications.
TABLE 9-1:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
RAIF
93
IOCBF
IOCBF7
IOCBF6
IOCBF5
IOCBF4
IOCBF3
IOCBF2
IOCBF1
IOCBF0
159
IOCBN
IOCBN7
IOCBN6
IOCBN5
IOCBN4
IOCBN3
IOCBN2
IOCBN1
IOCBN0
158
IOCBP
IOCBP7
IOCBP6
IOCBP5
IOCBP4
IOCBP3
IOCBP2
IOCBP1
IOCBP0
158
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
CCP3IE
96
PIE3
PIE4
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
94
PIR2
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
100
PIR3
PIR4
STATUS
VREGCON
WDTCON
Legend:
CCP3IF
PSMC1TIF
TO
PD
DC
VREGPM
PSMC3TIF PSMC2TIF
WDTPS<4:0>
97
101
27
Reserved
106
SWDTEN
110
= unimplemented location, read as 0. Shaded cells are not used in Power-Down mode.
DS40001637C-page 106
PIC16(L)F1784/6/7
10.0
TABLE 10-1:
VCAPEN
Pin
No VCAP
RA6
TABLE 10-2:
Name
CONFIG2
Legend:
Note 1:
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
Bit 10/2
Bit 9/1
Bit 8/0
13:8
7:0
LVP
DEBUG
LPBOR
BORV
STVREN
PLLEN
VCAPEN(1)
WRT<1:0>
Register
on Page
56
DS40001637C-page 107
PIC16(L)F1784/6/7
11.0
FIGURE 11-1:
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 11
LFINTOSC
23-bit Programmable
Prescaler WDT
WDT Time-out
WDTE<1:0> = 10
Sleep
DS40001637C-page 108
WDTPS<4:0>
PIC16(L)F1784/6/7
11.1
11.3
11.4
11.2
11.2.1
WDT IS ALWAYS ON
11.2.2
TABLE 11-1:
by
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
11.2.3
Time-Out Period
Sleep.
See
WDTE<1:0>
SWDTEN
Device
Mode
11
10
WDT
Mode
Active
11.5
Awake Active
Sleep
01
0
00
TABLE 11-2:
Disabled
Active
Disabled
Disabled
WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
CLRWDT Command
Cleared
DS40001637C-page 109
PIC16(L)F1784/6/7
11.6
REGISTER 11-1:
U-0
U-0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-1/1
R/W-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:
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
DS40001637C-page 110
PIC16(L)F1784/6/7
TABLE 11-3:
Name
Bit 6
OSCCON
SPLLEN
STATUS
WDTCON
Bit 5
Bit 4
Bit 3
IRCF<3:0>
Bit 2
Bit 1
TO
PD
Bit 0
SCS<1:0>
DC
WDTPS<4:0>
Register
on Page
82
27
SWDTEN
110
Legend: x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by
Watchdog Timer.
TABLE 11-4:
Name
CONFIG1
Legend:
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
FCMEN
IESO
CLKOUTEN
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
CPD
Register
on Page
54
= unimplemented location, read as 0. Shaded cells are not used by Watchdog Timer.
DS40001637C-page 111
PIC16(L)F1784/6/7
12.0
EECON1
EECON2
EEDATL
EEDATH
EEADRL
EEADRH
12.1
12.1.1
DS40001637C-page 112
PIC16(L)F1784/6/7
12.2
The data EEPROM is a high-endurance, byte addressable array that has been optimized for the storage of
frequently changing information (e.g., program
variables or other data that are updated often). When
variables in one section change frequently, while
variables in another section do not change, it is
possible to exceed the total number of write cycles to
the EEPROM without exceeding the total number of
write cycles to a single byte. Refer to Section 30.0
Electrical Specifications. If this is the case, then a
refresh of the array must be performed. For this reason,
variables that change infrequently (such as constants,
IDs, calibration, etc.) should be stored in Flash program
memory.
12.2.1
EXAMPLE 12-1:
BANKSEL EEADRL
;
MOVLW
DATA_EE_ADDR ;
MOVWF
EEADRL
;Data Memory
;Address to read
BCF
EECON1, CFGS ;Deselect Config space
BCF
EECON1, EEPGD;Point to DATA memory
BSF
EECON1, RD
;EE Read
MOVF
EEDATL, W
;W = EEDATL
Note:
12.2.2
12.2.3
12.2.4
DS40001637C-page 113
PIC16(L)F1784/6/7
Required
Sequence
EXAMPLE 12-2:
BANKSEL
MOVLW
MOVWF
MOVLW
MOVWF
BCF
BCF
BSF
EEADRL
DATA_EE_ADDR
EEADRL
DATA_EE_DATA
EEDATL
EECON1, CFGS
EECON1, EEPGD
EECON1, WREN
;
;
;Data Memory Address to write
;
;Data Memory Value to write
;Deselect Configuration space
;Point to DATA memory
;Enable writes
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
BSF
BCF
BTFSC
GOTO
INTCON,
55h
EECON2
0AAh
EECON2
EECON1,
INTCON,
EECON1,
EECON1,
$-2
;Disable INTs.
;
;Write 55h
;
;Write AAh
;Set WR bit to begin write
;Enable Interrupts
;Disable writes
;Wait for write to complete
;Done
FIGURE 12-1:
GIE
WR
GIE
WREN
WR
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Flash ADDR
PC
Flash Data
PC + 1
INSTR (PC)
INSTR(PC - 1)
executed here
EEADRH,EEADRL
INSTR (PC + 1)
BSF PMCON1,RD
executed here
PC
+3
PC+3
EEDATH,EEDATL
INSTR(PC + 1)
executed here
PC + 5
PC + 4
INSTR (PC + 3)
Forced NOP
executed here
INSTR (PC + 4)
INSTR(PC + 3)
executed here
INSTR(PC + 4)
executed here
RD bit
EEDATH
EEDATL
Register
DS40001637C-page 114
PIC16(L)F1784/6/7
12.3
12.3.1
2.
3.
4.
TABLE 12-1:
Device
PIC16(L)F1784/6/7
DS40001637C-page 115
PIC16(L)F1784/6/7
EXAMPLE 12-3:
EEADRL
PROG_ADDR_LO
EEADRL
PROG_ADDR_HI
EEADRH
BCF
BSF
BCF
BSF
NOP
NOP
BSF
EECON1,CFGS
EECON1,EEPGD
INTCON,GIE
EECON1,RD
INTCON,GIE
;
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
EEDATL,W
PROG_DATA_LO
EEDATH,W
PROG_DATA_HI
;
;
;
;
DS40001637C-page 116
PIC16(L)F1784/6/7
12.3.2
12.3.3
DS40001637C-page 117
PIC16(L)F1784/6/7
FIGURE 12-2:
0 7
EEDATH
EEDATA
14
EEADRL<4:0> = 00000
14
EEADRL<4:0> = 00001
14
EEADRL<4:0> = 00010
Buffer Register
Buffer Register
14
EEADRL<4:0> = 11111
Buffer Register
Buffer Register
Program Memory
EXAMPLE 12-4:
Required
Sequence
BCF
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
BSF
BCF
BSF
BSF
INTCON,GIE
EEADRL
ADDRL,W
EEADRL
ADDRH,W
EEADRH
EECON1,EEPGD
EECON1,CFGS
EECON1,FREE
EECON1,WREN
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
55h
EECON2
0AAh
EECON2
EECON1,WR
NOP
;
;
;
;
;
;
;
;
DS40001637C-page 118
EECON1,WREN
INTCON,GIE
; Disable writes
; Enable interrupts
PIC16(L)F1784/6/7
EXAMPLE 12-5:
;
;
;
;
;
;
;
INTCON,GIE
EEADRH
ADDRH,W
EEADRH
ADDRL,W
EEADRL
LOW DATA_ADDR
FSR0L
HIGH DATA_ADDR
FSR0H
EECON1,EEPGD
EECON1,CFGS
EECON1,WREN
EECON1,LWLO
;
;
;
;
;
;
;
;
;
;
;
;
;
;
MOVIW
MOVWF
MOVIW
MOVWF
FSR0++
EEDATL
FSR0++
EEDATH
MOVF
XORLW
ANDLW
BTFSC
GOTO
EEADRL,W
0x0F
0x0F
STATUS,Z
START_WRITE
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
55h
EECON2
0AAh
EECON2
EECON1,WR
;
;
;
;
;
;
;
;
Required
Sequence
LOOP
NOP
Required
Sequence
START_WRITE
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
EEADRL,F
LOOP
EECON1,LWLO
55h
EECON2
0AAh
EECON2
EECON1,WR
;
;
;
;
;
;
;
;
NOP
BCF
BSF
EECON1,WREN
INTCON,GIE
DS40001637C-page 119
PIC16(L)F1784/6/7
12.4
TABLE 12-2:
12.5
Address
Function
Read Access
Write Access
8000h-8003h
8006h
8007h-8008h
User IDs
Device ID/Revision ID
Configuration Words 1 and 2
Yes
Yes
Yes
Yes
No
No
EXAMPLE 12-6:
* 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
EEADRL
PROG_ADDR_LO
EEADRL
EEADRH
BSF
BCF
BSF
NOP
NOP
BSF
EECON1,CFGS
INTCON,GIE
EECON1,RD
INTCON,GIE
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
EEDATL,W
PROG_DATA_LO
EEDATH,W
PROG_DATA_HI
;
;
;
;
DS40001637C-page 120
PIC16(L)F1784/6/7
12.6
Write Verify
EXAMPLE 12-7:
BANKSEL EEDATL
MOVF
EEDATL, W
BSF
XORWF
BTFSS
GOTO
:
;
;EEDATL not changed
;from previous write
EECON1, RD ;YES, Read the
;value written
EEDATL, W ;
STATUS, Z ;Is data the same
WRITE_ERR ;No, handle error
;Yes, continue
DS40001637C-page 121
PIC16(L)F1784/6/7
12.7
REGISTER 12-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
EEDAT<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
EEDAT<7:0>: Read/write value for EEPROM data byte or Least Significant bits of program memory
REGISTER 12-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
EEDAT<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 12-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
EEADR<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
EEADR<7:0>: Specifies the Least Significant bits for program memory address or EEPROM address
REGISTER 12-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
EEADR<14: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
Unimplemented: Read as 1
bit 6-0
Note
EEADR<14:8>: Specifies the Most Significant bits for program memory address or EEPROM address
1:
Unimplemented, read as 1.
DS40001637C-page 122
PIC16(L)F1784/6/7
REGISTER 12-5:
R/W-0/0
R/W-0/0
R/W-0/0
R/W/HC-0/0
R/W-x/q
R/W-0/0
R/S/HC-0/0
R/S/HC-0/0
EEPGD
CFGS
LWLO
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
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001637C-page 123
PIC16(L)F1784/6/7
REGISTER 12-6:
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
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 12-3:
Name
EECON1
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
EEPGD
CFGS
LWLO
FREE
WRERR
WREN
WR
RD
123
EECON2
124*
EEADRL
EEADRL<7:0>
122
EEADRH
(1)
EEADRH<6:0>
EEDATL
122
EEDATL<7:0>
122
EEDATH
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
PIR2
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
Legend:
*
2:
EEDATH<5:0>
122
93
= unimplemented location, read as 0. Shaded cells are not used by data EEPROM module.
Page provides register information.
Unimplemented, read as 1.
DS40001637C-page 124
PIC16(L)F1784/6/7
13.0
I/O PORTS
FIGURE 13-1:
Read LATx
D
CK
VDD
Data Register
PORTC
PIC16(L)F1784/7
I/O pin
Read PORTx
To digital peripherals
ANSELx
VSS
PORTE
PORTB
PIC16(L)F1786
PORTD
Device
Data Bus
To analog peripherals
TABLE 13-1:
Write LATx
Write PORTx
TRISx
DS40001637C-page 125
PIC16(L)F1784/6/7
13.1
C2OUT output
CCP1 output
SDO output
SCL/SCK output
SDA/SDI output
TX/RX output
CCP2 output
CCP3 output
DS40001637C-page 126
PIC16(L)F1784/6/7
13.2
REGISTER 13-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/W-0/0
C2OUTSEL
CCP1SEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
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
DS40001637C-page 127
PIC16(L)F1784/6/7
REGISTER 13-2:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
CCP3SEL
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
DS40001637C-page 128
PIC16(L)F1784/6/7
13.3
13.3.1
PORTA Registers
DATA REGISTER
13.3.5
13.3.2
DIRECTION CONTROL
13.3.3
13.3.4
13.3.6
ANALOG CONTROL
EXAMPLE 13-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
DS40001637C-page 129
PIC16(L)F1784/6/7
13.3.7
TABLE 13-2:
Pin Name
Function Priority(1)
RA0
RA0
RA1
OPA1OUT
RA1
RA2
DAC1OUT1
RA2
RA3
RA3
RA4
C1OUT
RA4
RA5
C2OUT
RA5
RA6
CLKOUT
C2OUT
RA6
RA7
Note 1:
RA7
Priority listed from highest to lowest.
DS40001637C-page 130
PIC16(L)F1784/6/7
13.4
REGISTER 13-3:
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
RA7
RA6
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
RA<7:0>: PORTA I/O Value bits(1)
1 = Port pin is > VIH
0 = Port pin is < VIL
bit 7-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 13-4:
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
TRISA7
TRISA6
TRISA5
TRISA4
TRISA3
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-0
REGISTER 13-5:
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
LATA7
LATA6
LATA5
LATA4
LATA3
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-4
Note 1:
DS40001637C-page 131
PIC16(L)F1784/6/7
REGISTER 13-6:
R/W-1/1
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
ANSA7
ANSA5
ANSA4
ANSA3
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 5
ANSA7: Analog Select between Analog or Digital Function on pins RA7, 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 6
Unimplemented: Read as 0
bit 5-0
ANSA<5:0>: Analog Select between Analog or Digital Function on pins RA<5:0>, 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.
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.
REGISTER 13-7:
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
WPUA7
WPUA6
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-0
Note 1:
2:
DS40001637C-page 132
PIC16(L)F1784/6/7
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
ODA7
ODA6
ODA5
ODA4
ODA3
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-0
REGISTER 13-9:
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
SLRA7
SLRA6
SLRA5
SLRA4
SLRA3
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-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
INLVLA7
INLVLA6
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-0
DS40001637C-page 133
PIC16(L)F1784/6/7
TABLE 13-3:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA7
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
132
INLVLA
INLVLA7
INLVLA6
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
133
LATA7
LATA6
LATA5
LATA4
LATA3
LATA2
LATA1
LATA0
131
ODA2
ODA1
ODA0
Name
LATA
ODCONA
OPTION_REG
PORTA
SLRCONA
ODA7
ODA6
ODA5
ODA4
ODA3
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
133
PS<2:0>
198
RA7
RA6
RA5
RA4
RA3
RA2
RA1
RA0
131
SLRA7
SLRA6
SLRA5
SLRA4
SLRA3
SLRA2
SLRA1
SLRA0
133
TRISA
TRISA7
TRISA6
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
WPUA
WPUA7
WPUA6
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
132
Legend:
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTA.
TABLE 13-4:
Name
CONFIG1
Legend:
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
WDTE<1:0>
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
CPD
Register
on Page
54
DS40001637C-page 134
PIC16(L)F1784/6/7
13.5
13.5.1
PORTB Registers
DATA REGISTER
13.5.5
13.5.2
DIRECTION CONTROL
13.5.3
13.5.4
13.5.6
ANALOG CONTROL
DS40001637C-page 135
PIC16(L)F1784/6/7
13.5.7
TABLE 13-5:
Pin Name
Function Priority(1)
RB0
CCP1
RB0
RB1
OPA2OUT
RB1
RB2
CLKR
RB2
RB3
CCP2
RB3
RB4
RB4
RB5
SDO
C3OUT
CCP3
RB5
RB6
ICSPCLK
SDA
TX/CK
RB6
RB7
ICSPDAT
DAC1OUT2
SCL/SCK
DT
RB7
Note 1:
DS40001637C-page 136
PIC16(L)F1784/6/7
13.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
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
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
RB<7:0>: PORTB General Purpose I/O Pin bits(1)
1 = Port pin is > VIH
0 = Port pin is < VIL
bit 7-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
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
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
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
LATB7
LATB6
LATB5
LATB4
LATB3
LATB2
LATB1
LATB0
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:
DS40001637C-page 137
PIC16(L)F1784/6/7
REGISTER 13-14: ANSELB: PORTB ANALOG SELECT REGISTER
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
R/W-1/1
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
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-0
ANSB<6:0>: Analog Select between Analog or Digital Function on pins RB<6:0>, 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.
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
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUB7
WPUB6
WPUB5
WPUB4
WPUB3
WPUB2
WPUB1
WPUB0
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:
DS40001637C-page 138
PIC16(L)F1784/6/7
REGISTER 13-16: ODCONB: PORTB 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
ODB7
ODB6
ODB5
ODB4
ODB3
ODB2
ODB1
ODB0
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
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
SLRB7
SLRB6
SLRB5
SLRB4
SLRB3
SLRB2
SLRB1
SLRB0
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
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
INLVLB7
INLVLB6
INLVLB5
INLVLB4
INLVLB3
INLVLB2
INLVLB1
INLVLB0
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
DS40001637C-page 139
PIC16(L)F1784/6/7
TABLE 13-6:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
138
INLVLB7
INLVLB6
INLVLB5
INLVLB4
INLVLB3
INLVLB2
INLVLB1
INLVLB0
139
LATB
LATB7
LATB6
LATB5
LATB4
LATB3
LATB2
LATB1
LATB0
137
ODCONB
ODB7
ODB6
ODB5
ODB4
ODB3
ODB2
ODB1
ODB0
139
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
137
SLRB7
SLRB6
SLRB5
SLRB4
SLRB3
SLRB2
SLRB1
SLRB0
139
Name
ANSELB
INLVLB
PORTB
SLRCONB
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
137
WPUB
WPUB7
WPUB6
WPUB5
WPUB4
WPUB3
WPUB2
WPUB1
WPUB0
138
Legend:
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by
PORTB.
DS40001637C-page 140
PIC16(L)F1784/6/7
13.7
13.7.1
PORTC Registers
DATA REGISTER
13.7.2
DIRECTION CONTROL
13.7.3
13.7.4
Note:
13.7.6
TABLE 13-7:
Pin Name
Function Priority(1)
RC0
T1OSO
PSMC1A
RC0
RC1
PSMC1B
CCP2
RC1
RC2
PSMC1C
CCP1
RC2
RC3
PSMC1D
SCL
SCK
RC3
RC4
PSMC1E
SDA
RC4
RC5
PSMC1F
SDO
RC5
RC6
PSMC2A
TX/CK
CCP3
RC6
RC7
PSMC2B
DT
RC7
Note 1:
13.7.5
DS40001637C-page 141
PIC16(L)F1784/6/7
13.8
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
RC7
RC6
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)
1 = Port pin is > VIH
0 = Port pin is < VIL
bit 7-0
Note 1:
Writes to PORTC are actually written to corresponding LATC register. Reads from PORTC register is
return of actual I/O pin values.
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
TRISC6
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
bit 7-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
R/W-x/u
LATC7
LATC6
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:
DS40001637C-page 142
PIC16(L)F1784/6/7
REGISTER 13-22: WPUC: WEAK PULL-UP PORTC 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
WPUC7
WPUC6
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:
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
ODC6
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
bit 7-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
R/W-1/1
SLRC7
SLRC6
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
bit 7-0
DS40001637C-page 143
PIC16(L)F1784/6/7
REGISTER 13-25: INLVLC: PORTC INPUT LEVEL CONTROL 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
INLVLC7
INLVLC6
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
TABLE 13-8:
Name
LATC
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
LATC7
LATC6
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
142
PORTC
RC7
RC6
RC5
RC4
RC3
RC2
RC1
RC0
142
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
WPUC
WPUC7
WPUC6
WPUC5
WPUC4
WPUC3
WPUC2
WPUC1
WPUC0
143
INLVLC
INLVLC7
INLVLC6
INLVLC5
INLVLC4
INLVLC3
INLVLC2
INLVLC1 INLVLC0
144
LATC
LATC7
LATC6
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
142
ODCONC
ODC7
ODC6
ODC5
ODC4
ODC3
ODC2
ODC1
ODC0
143
RC7
RC6
RC5
RC4
RC3
RC2
RC1
RC0
142
SLRC7
SLRC6
SLRC5
SLRC4
SLRC3
SLRC2
SLRC1
SLRC0
143
PORTC
SLRCONC
Legend:
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by
PORTC.
DS40001637C-page 144
PIC16(L)F1784/6/7
13.9
13.9.1
PORTD Registers
(PIC16(L)F1784/7 only)
DATA REGISTER
13.9.2
DIRECTION CONTROL
13.9.3
13.9.4
13.9.5
13.9.6
TABLE 13-9:
Pin Name
Function Priority(1)
RD0
RD0
RD1
OPA3OUT
RD1
RD2
RD2
RD3
RD3
RD4
PSMC3F
RD4
RD5
PSMC3E
RD5
RD6
PSMC3D
C3OUT
RD6
RD7
PSMC3C
C4OUT
RD7
Note 1:
DS40001637C-page 145
PIC16(L)F1784/6/7
13.10 Register Definitions: PORTD
REGISTER 13-26: PORTD: PORTD REGISTER
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
RD7
RD6
RD5
RD4
RD3
RD2
RD1
RD0
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
RD<7:0>: PORTD General Purpose I/O Pin bits(1)
1 = Port pin is > VIH
0 = Port pin is < VIL
bit 7-0
Note 1:
Writes to PORTD are actually written to corresponding LATD register. Reads from PORTD register is
return of actual I/O pin values.
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
TRISD7
TRISD6
TRISD5
TRISD4
TRISD3
TRISD2
TRISD1
TRISD0
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
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
LATD7
LATD6
LATD5
LATD4
LATD3
LATD2
LATD1
LATD0
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:
DS40001637C-page 146
PIC16(L)F1784/6/7
REGISTER 13-29: ANSELD: PORTD ANALOG SELECT REGISTER
U-0
U-0
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
ANSD2
ANSD1
ANSD0
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-3
Unimplemented: Read as 0
bit 2-0
ANSD<2:0>: Analog Select between Analog or Digital Function on pins RD<2:0>, 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.
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
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUD7
WPUD6
WPUD5
WPUD4
WPUD3
WPUD2
WPUD1
WPUD0
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:
DS40001637C-page 147
PIC16(L)F1784/6/7
REGISTER 13-31: ODCOND: PORTD 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
ODD7
ODD6
ODD5
ODD4
ODD3
ODD2
ODD1
ODD0
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
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
SLRD7
SLRD6
SLRD5
SLRD4
SLRD3
SLRD2
SLRD1
SLRD0
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
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
INLVLD7
INLVLD6
INLVLD5
INLVLD4
INLVLD3
INLVLD2
INLVLD1
INLVLD0
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
DS40001637C-page 148
PIC16(L)F1784/6/7
TABLE 13-10: SUMMARY OF REGISTERS ASSOCIATED WITH PORTD
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSD2
ANSD1
ANSD0
147
INLVLD7
INLVLD6
INLVLD5
INLVLD4
INLVLD3
INLVLD2
LATD
LATD7
LATD6
LATD5
LATD4
LATD3
LATD2
LATD1
LATD0
146
ODCOND
ODD7
ODD6
ODD5
ODD4
ODD3
ODD2
ODD1
ODD0
148
RD7
RD6
RD5
RD4
RD3
RD2
RD1
RD0
146
SLRD7
SLRD6
SLRD5
SLRD4
SLRD3
SLRD2
SLRD1
SLRD0
148
Name
ANSELD
INLVLD
PORTD
SLRCOND
INLVLD1 INLVLD0
148
TRISD
TRISD7
TRISD6
TRISD5
TRISD4
TRISD3
TRISD2
TRISD1
TRISD0
146
WPUD
WPUD7
WPUD6
WPUD5
WPUD4
WPUD3
WPUD2
WPUD1
WPUD0
147
Legend:
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by
PORTD.
DS40001637C-page 149
PIC16(L)F1784/6/7
13.11 PORTE Registers
RE3 is input only, and also functions as MCLR. The
MCLR feature can be disabled via a configuration fuse.
RE3 also supplies the programming voltage. The TRIS bit
for RE3 (TRISE3) always reads 1.
13.11.1
DIRECTION CONTROL
13.11.3
Note:
DATA REGISTER
13.11.2
13.11.6
13.11.4
13.11.5
DS40001637C-page 150
PIC16(L)F1784/6/7
13.11.7
Pin Name
RE0
CCP3
RE0
RE1
PSMC3B
RE1
RE2
PSMC3A
RE2
Note 1:
DS40001637C-page 151
PIC16(L)F1784/6/7
13.12 Register Definitions: PORTE
REGISTER 13-34: PORTE: PORTE REGISTER
U-0
U-0
U-0
U-0
R-x/u
R/W-x/u
RE3
RE2(1)
R/W-x/u
RE1
(1)
bit 7
R/W-x/u
RE0(1)
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-0
Note 1:
U-0
U-0
U-0
U-1(1)
R/W-1/1
R/W-1/1
R/W-1/1
TRISE2(2)
TRISE1(2)
TRISE0(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-4
Unimplemented: Read as 0
bit 3
Unimplemented: Read as 1
bit 2-0
Note 1:
2:
Unimplemented, read as 1.
TRISE<2:0> are available on PIC16(L)F1784/7 only.
DS40001637C-page 152
PIC16(L)F1784/6/7
REGISTER 13-36: LATE: PORTE DATA LATCH REGISTER(2)
U-0
U-0
U-0
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
LATE2
LATE1
LATE0
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-3
Unimplemented: Read as 0
bit 2-0
Note 1:
2:
Writes to PORTE are actually written to corresponding LATE register. Reads from PORTE register is
return of actual I/O pin values.
LATE<2:0> are available on PIC16(L)F1784/7 only.
U-0
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
ANSE2
ANSE1
ANSE0
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-3
Unimplemented: Read as 0
bit 2-0
ANSE<2:0>: Analog Select between Analog or Digital Function on pins RE<2:0>, 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.
Note 1:
2:
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.
ANSELE<2:0> are available on PIC16(L)F1784/7 only.
DS40001637C-page 153
PIC16(L)F1784/6/7
REGISTER 13-38: WPUE: WEAK PULL-UP PORTE REGISTER
U-0
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUE3
WPUE2(3)
WPUE1(3)
WPUE0(3)
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-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 in configured as an output.
WPUSE<2:0> are available on PIC16(L)F1784/7 only.
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
ODE2
ODE1
ODE0
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-3
Unimplemented: Read as 0
bit 2-0
Note 1:
DS40001637C-page 154
PIC16(L)F1784/6/7
REGISTER 13-40: SLRCONE: PORTE SLEW RATE CONTROL REGISTER(1)
U-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
SLRE2
SLRE1
SLRE0
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-3
Unimplemented: Read as 0
bit 2-0
Note 1:
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
INLVLE3
INLVLE2(1)
INLVLE1(1)
INLVLE0(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-4
Unimplemented: Read as 0
bit 3-0
Note 1:
Bit 7
ADCON0
ADRMD
ANSELE
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
ANSE2
CHS<4:0>
Register
on Page
GO/DONE
ADON
172
ANSE1
ANSE0
(2)
(2)
(2)
153
INLVLE
INLVLE3
INLVLE1
INLVLE0
155
LATE(2)
LATE2
LATE1
LATE0
153
ODCONE(2)
ODE2
ODE1
ODE0
154
PORTE
RE3
RE2(2)
RE1(2)
RE0(2)
152
SLRCONE(2)
SLRE2
SLRE1
SLRE0
155
TRISE
(1)
TRISE2(2)
TRISE1(2)
TRISE0(2)
152
WPUE
WPUE3
WPUE2(2)
WPUE1(2)
WPUE0(2)
154
Legend:
Note 1:
2:
INLVLE2
Bit 0
Bit 1
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTE.
Unimplemented, read as 1.
PIC16(L)F1784/7 only
DS40001637C-page 155
PIC16(L)F1784/6/7
14.0
INTERRUPT-ON-CHANGE
14.1
14.3
Interrupt Flags
14.4
14.2
EXAMPLE 14-1:
MOVLW
XORWF
ANDWF
14.5
CLEARING INTERRUPT
FLAGS
(PORTA EXAMPLE)
0xff
IOCAF, W
IOCAF, F
Operation in Sleep
DS40001637C-page 156
PIC16(L)F1784/6/7
FIGURE 14-1:
IOCBNx
Q4Q1
CK
edge
detect
RBx
IOCBPx
data bus =
0 or 1
write IOCBFx
CK
to data bus
IOCBFx
CK
IOCIE
R
Q2
from all other
IOCBFx individual
pin detectors
Q1
Q3
Q4
Q4Q1
Q1
Q1
Q2
Q2
Q2
Q3
Q4
Q4Q1
IOC interrupt
to CPU core
Q3
Q4
Q4
Q4Q1
Q4Q1
DS40001637C-page 157
PIC16(L)F1784/6/7
14.6
REGISTER 14-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/W-0/0
IOCxP7
IOCxP6
IOCxP5
IOCxP4
IOCxP3
IOCxP2
IOCxP1
IOCxP0
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
IOCxP<7:0>: Interrupt-on-Change Positive Edge Enable bits(1)
1 = Interrupt-on-Change enabled on the pin for a positive going edge. Associated Status bit and
interrupt flag will be set upon detecting an edge.
0 = Interrupt-on-Change disabled for the associated pin.
bit 7-0
Note 1:
For IOCEP register, bit 3 (IOCEP3) is the only implemented bit in the register.
REGISTER 14-2:
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
IOCxN7
IOCxN6
IOCxN5
IOCxN4
IOCxN3
IOCxN2
IOCxN1
IOCxN0
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:
For IOCEN register, bit 3 (IOCEN3) is the only implemented bit in the register.
DS40001637C-page 158
PIC16(L)F1784/6/7
REGISTER 14-3:
R/W/HS-0/0
R/W/HS-0/0
IOCxF7
IOCxF6
IOCxF4
IOCxF3
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
IOCxF2
IOCxF1
IOCxF0
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:
For IOCEF register, bit 3 (IOCEF3) is the only implemented bit in the register.
TABLE 14-1:
Name
Bit 6
ANSELB
INTCON
GIE
IOCAF
Bit 2
Bit 1
Bit 0
Register
on Page
ANSB3
ANSB2
ANSB1
ANSB0
138
IOCIE
TMR0IF
INTF
IOCIF
93
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
159
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
158
Bit 5
Bit 4
Bit 3
ANSB6
ANSB5
ANSB4
PEIE
TMR0IE
INTE
IOCAF7
IOCAF6
IOCAF5
IOCAN
IOCAN7
IOCAN6
IOCAP
IOCAP7
IOCAP6
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
158
IOCBF
IOCBF7
IOCBF6
IOCBF5
IOCBF4
IOCBF3
IOCBF2
IOCBF1
IOCBF0
159
IOCBN
IOCBN7
IOCBN6
IOCBN5
IOCBN4
IOCBN3
IOCBN2
IOCBN1
IOCBN0
158
IOCBP
IOCBP7
IOCBP6
IOCBP5
IOCBP4
IOCBP3
IOCBP2
IOCBP1
IOCBP0
158
159
IOCCF
IOCCF7
IOCCF6
IOCCF5
IOCCF4
IOCCF3
IOCCF2
IOCCF1
IOCCF0
IOCCN
IOCCN7
IOCCN6
IOCCN5
IOCCN4
IOCCN3
IOCCN2
IOCCN1
IOCCN0
158
IOCCP
IOCCP7
IOCCP6
IOCCP5
IOCCP4
IOCCP3
IOCCP2
IOCCP1
IOCCP0
158
IOCEF
IOCEF3
159
IOCEN
IOCEN3
158
IOCEP
IOCEP3
158
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
137
Legend: = unimplemented location, read as 0. Shaded cells are not used by interrupt-on-change.
DS40001637C-page 159
PIC16(L)F1784/6/7
15.0
15.1
15.2
15.3
DS40001637C-page 160
PIC16(L)F1784/6/7
FIGURE 15-1:
CDAFVR<1:0>
2
X1
X2
X4
FVR BUFFER1
(To ADC Module)
X1
X2
X4
FVR BUFFER2
(To Comparators, DAC)
HFINTOSC Enable
HFINTOSC
To BOR, LDO
FVREN
+
_
FVRRDY
TABLE 15-1:
Peripheral
HFINTOSC
Description
BOREN<1:0> = 11
BOR
LDO
The device runs off of the ULP regulator when in Sleep mode.
DS40001637C-page 161
PIC16(L)F1784/6/7
15.4
REGISTER 15-1:
R/W-0/0
R-q/q
R/W-0/0
R/W-0/0
FVREN
FVRRDY(1)
TSEN
TSRNG
R/W-0/0
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 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
162
Shaded cells are not used with the Fixed Voltage Reference.
DS40001637C-page 162
PIC16(L)F1784/6/7
16.0
TEMPERATURE INDICATOR
MODULE
FIGURE 16-1:
TEMPERATURE CIRCUIT
DIAGRAM
VDD
TSEN
TSRNG
16.1
Circuit Operation
EQUATION 16-1:
VOUT RANGES
VOUT
16.2
To ADC
TABLE 16-1:
Low Range: VOUT = VDD - 2VT
3.6V
1.8V
16.3
Temperature Output
16.4
DS40001637C-page 163
PIC16(L)F1784/6/7
TABLE 16-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
FVREN
FVRRDY
TSEN
TSRNG
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
161
DS40001637C-page 164
PIC16(L)F1784/6/7
17.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
FIGURE 17-1:
ADPREF = 00
VREF+
AN0
00000
AN1
00001
VREF-/AN2
00010
VREF+/AN3
00011
AN4
00100
AN5(1)
00101
AN6(1)
00110
AN7(1)
00111
AN8
01000
AN9
01001
AN10
01010
AN11
01011
AN12
01100
AN13
01101
ADPREF = 01
ADNREF = 1
ADPNEF = 0
Ref+ Ref+
ADC
GO/DONE
1
12
0
ADRMD
ADFM
(1)
ADON
0 = Sign Magnitude
1 = 2s Complement
16
VSS
AN21(1)
10
ADRESH
ADRESL
10101
Temperature Indicator
11101
Reserved
11110
FVR Buffer1
11111
CHS<4:0>(2)
CHSN<3:0>
Note 1:
2:
DS40001637C-page 165
PIC16(L)F1784/6/7
17.1
ADC Configuration
17.1.1
PORT CONFIGURATION
17.1.2
CHANNEL SELECTION
17.1.3
17.1.4
CONVERSION CLOCK
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (dedicated internal FRC oscillator)
DS40001637C-page 166
PIC16(L)F1784/6/7
TABLE 17-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
(3)
8.0 s
16.0 s
(3)
(3)
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
32.0 s(3)
64.0 s(3)
1.0-6.0 s(1,4)
FIGURE 17-2:
TCY - TAD TAD1
TAD3
TAD4
TAD5
TAD6
TAD7
sign
b11
b10
b9
b8
TAD8
b7
b5
b4
Conversion
starts
b3
b2
b1
b0
Holding cap.
discharge
Set GO
bit
Input
Sample
DS40001637C-page 167
PIC16(L)F1784/6/7
17.1.5
INTERRUPTS
17.1.6
RESULT FORMATTING
FIGURE 17-3:
ADFM = 0
ADRMD = 0
Bit 8
Bit 7
Bit 6
Bit 5
bit 7
Bit 4
Bit 3
bit 0
bit 7
Bit 2
Bit 1
Bit 0
Sign
bit 0
Loaded with 0
12-bit 2s compliment
ADFM = 1
ADRMD = 0
Bit 8
Bit 7
bit 7
bit 0
bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
bit 0
ADFM = 0
ADRMD = 1
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
bit 7
Bit 2
Bit 1
bit 0
bit 7
Bit 0
Sign
bit 0
Loaded with 0
10-bit 2s compliment
ADFM = 1
ADRMD = 1
Bit 8
Bit 7
bit 7
bit 0
bit 7
DS40001637C-page 168
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
bit 0
PIC16(L)F1784/6/7
TABLE 17-2:
ADRESL
(ADRES<7:0>)
2s Compliment Result
ADFM = 1, ADRMD = 0
ADRESH
(ADRES<15:8>)
ADRESL
(ADRES<7:0>)
+ 4095
1111 1111
1111 0000
0000 1111
1111 1111
0000 1001
0011 0011
+ 2355
1001 0011
0011 0000
+ 0001
0000 0000
0001 0000
0000 0000
0000 0001
0000
0000 0000
0000 0000
0000 0000
0000 0000
1111 1111
1111 1111
- 0001
0000 0000
0001 0001
- 4095
1111 1111
1111 0001
1111 0000
0000 0001
- 4096
0000 0000
0000 0001
1111 0000
0000 0000
Note 1: For the RSD ADC, the raw 13-bits from the ADC is presented in 2s compliment format, so no data
translation is required for 2s compliment results.
2: For the SAR ADC, the raw 13-bits from the ADC is presented in sign and magnitude format, so no data
translation is required for sign and magnitude results
DS40001637C-page 169
PIC16(L)F1784/6/7
17.2
17.2.1
ADC Operation
STARTING A CONVERSION
17.2.4
17.2.5
17.2.2
17.2.3
COMPLETION OF A CONVERSION
TERMINATING A CONVERSION
Note:
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.
Auto-conversion sources are:
CCP1
CCP2
CCP3
PSMC1(1)
PSMC2(1)
Note:
PSMC3
DS40001637C-page 170
PIC16(L)F1784/6/7
17.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 17-1:
A/D CONVERSION
ADC
DS40001637C-page 171
PIC16(L)F1784/6/7
17.3
REGISTER 17-1:
R/W-0/0
R/W-0/0
R/W-0/0
ADRMD
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
bit 6-2
bit 1
bit 0
Note 1:
2:
3:
4:
PIC16(L)F1784/7 only.
See Section 19.0 Digital-to-Analog Converter (DAC) Module for more information.
See Section 15.0 Fixed Voltage Reference (FVR) for more information.
See Section 16.0 Temperature Indicator Module for more information.
DS40001637C-page 172
PIC16(L)F1784/6/7
REGISTER 17-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 FVR or VREF+ pin as the source of the positive reference, be aware that a minimum
voltage specification exists. See Section 30.0 Electrical Specifications for details.
DS40001637C-page 173
PIC16(L)F1784/6/7
REGISTER 17-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TRIGSEL<3:0>
R/W-0/0
R/W-0/0
R/W-0/0
CHSN<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-4
bit 3-0
Note 1:
DS40001637C-page 174
PIC16(L)F1784/6/7
REGISTER 17-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
AD<11:4>
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 17-5:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
AD<3:0>
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADSIGN
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-1
bit 0
DS40001637C-page 175
PIC16(L)F1784/6/7
REGISTER 17-6:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADSIGN
R/W-x/u
R/W-x/u
R/W-x/u
AD<11: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-4
bit 3-0
REGISTER 17-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
AD<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
DS40001637C-page 176
PIC16(L)F1784/6/7
17.4
EQUATION 17-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/8191)
= 10pF 1k + 7k + 10k ln(0.000122)
= 1.62 s
Therefore:
T A CQ = 2s + 1.62s + 50C- 25C 0.05 s/C
= 4.87s
Note 1: The reference voltage (VREF) has no effect on the equation, since it cancels itself out.
2: Maximum source impedance feeding the input pin should be considered so that the pin leakage does not
cause a voltage divider, thereby limiting the absolute accuracy.
DS40001637C-page 177
PIC16(L)F1784/6/7
FIGURE 17-4:
Rs
VA
VDD
Analog
Input
pin
VT 0.6V
CPIN
5 pF
VT 0.6V
Sampling
Switch
SS Rss
RIC 1k
I LEAKAGE(1)
CHOLD = 10 pF
VSS/VREF-
Legend: CHOLD
CPIN
6V
5V
VDD 4V
3V
2V
= Sample/Hold Capacitance
= Input Capacitance
= Sampling Switch
VT
= Threshold Voltage
RSS
5 6 7 8 9 10 11
Sampling Switch
(k)
FIGURE 17-5:
Full-Scale Range
FFFh
FFEh
FFDh
FFCh
FFBh
03h
02h
01h
00h
0.5 LSB
VREF-
DS40001637C-page 178
Zero-Scale
Transition
Full-Scale
Transition
VREF+
PIC16(L)F1784/6/7
TABLE 17-3:
Name
ADCON0
ADRMD
ADCON1
ADFM
ADCON2
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
ADNREF
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
ADRESH
ADRESL
Bit 1
Bit 0
Register
on Page
GO/DONE
ADON
172
ADPREF<1:0>
CHSN<3:0>
173
174
175, 176
175, 176
ANSELA
ANSA7
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
132
ANSELB
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
138
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
TRISA
TRISA7
TRISA6
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
137
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
Legend:
CDAFVR<1:0>
ADFVR<1:0>
162
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for the ADC module.
DS40001637C-page 179
PIC16(L)F1784/6/7
18.0
OPERATIONAL AMPLIFIER
(OPA) MODULES
FIGURE 18-1:
OPAxIN+
0x
DAC_output
10
FVR Buffer 2
11
OPAXEN
OPAXSP(1)
OPAxIN-
OPAXOUT
OPA
OPAxNCH<1:0>
Note 1:
DS40001637C-page 180
PIC16(L)F1784/6/7
18.1
Effects of Reset
18.2
18.3
DS40001637C-page 181
PIC16(L)F1784/6/7
18.4
REGISTER 18-1:
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
OPAxEN
OPAxSP
R/W-0/0
R/W-0/0
OPAxCH<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-2
Unimplemented: Read as 0
bit 1-0
TABLE 18-1:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA7
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
132
ANSELB
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
138
DAC1EN
DAC1NSS
186
DAC1CON0
DAC1OE1 DAC1OE2
DAC1CON1
DAC1PSS<1:0>
DAC1R<7:0>
186
OPA1CON
OPA1EN
OPA1SP
OPA1PCH<1:0>
182
OPA2CON
OPA2EN
OPA2SP
OPA2PCH<1:0>
182
TRISA
TRISA7
TRISA6
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
137
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
Legend:
Note 1:
DS40001637C-page 182
PIC16(L)F1784/6/7
19.0
DIGITAL-TO-ANALOG
CONVERTER (DAC) MODULE
19.1
The DAC has 256 voltage level ranges. The 256 levels
are set with the DAC1R<7:0> bits of the DAC1CON1
register.
The DAC output voltage is determined by Equation 19-1:
EQUATION 19-1:
IF DACxEN = 1
DACxR 7:0
VOUT = VSOURCE+ VSOURCE- -------------------------------- + VSOURCE8
2
VSOURCE+ = VDD, VREF, or FVR BUFFER 2
VSOURCE- = VSS
19.2
19.3
DS40001637C-page 183
PIC16(L)F1784/6/7
FIGURE 19-1:
FVR BUFFER2
VSOURCE+
VDD
VREF+
DACxR<7:0>
R
R
DACxPSS<1:0>
2
R
DACxEN
R
256
Steps
R
32-to-1 MUX
R
DAC_Output
DACXOUT1
DACXOE1
DACxNSS
DACXOUT2
VREF-
DACXOE2
VSOURCE-
VSS
FIGURE 19-2:
DAC
Module
R
Voltage
Reference
Output
Impedance
DS40001637C-page 184
DACXOUTX
PIC16(L)F1784/6/7
19.4
19.5
Effects of a Reset
DS40001637C-page 185
PIC16(L)F1784/6/7
19.6
REGISTER 19-1:
R/W-0/0
U-0
R/W-0/0
R/W-0/0
DAC1EN
DAC1OE1
DAC1OE2
R/W-0/0
R/W-0/0
U-0
R/W-0/0
DAC1NSS
DAC1PSS<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
Unimplemented: Read as 0
bit 5
bit 4
bit 3-2
bit 1
Unimplemented: Read as 0
bit 0
REGISTER 19-2:
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
DAC1R<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
TABLE 19-1:
Name
FVRCON
DAC1CON0
Bit 6
FVREN
FVRRDY
DAC1EN
DAC1CON1
Legend:
Bit 5
Bit 4
TSEN
TSRNG
DAC1OE1 DAC1OE2
Bit 3
Bit 2
CDAFVR<1:0>
DAC1PSS<1:0>
Bit 1
Bit 0
ADFVR<1:0>
DAC1R<7:0>
DAC1NSS
Register
on page
162
186
186
= Unimplemented location, read as 0. Shaded cells are not used with the DAC module.
DS40001637C-page 186
PIC16(L)F1784/6/7
20.0
COMPARATOR MODULE
FIGURE 20-1:
20.1
Comparator Overview
SINGLE COMPARATOR
VIN+
VIN-
Output
VINVIN+
Output
Note:
TABLE 20-1:
COMPARATOR AVAILABILITY
PER DEVICE
Device
PIC16(L)F1784/6/7
C1
C2
C3
C4
DS40001637C-page 187
PIC16(L)F1784/6/7
FIGURE 20-2:
CxNCH<2:0>
CxON(1)
CxINTP
Interrupt
det
CXIN0-
CXIN1-
CXIN2-
2 MUX
Set CxIF
CXIN3-
(3)
CXIN4-
Reserved
Reserved
CxINTN
Interrupt
(2)
det
CXPOL
CxVN
Cx
CxVP
ZLF
EN
Q1
7
CxHYS
AGND
CxSP
to CMXCON0 (CXOUT)
and CM2CON1 (MCXOUT)
CxZLF
async_CxOUT
CXSYNC
CXOE
TRIS bit
CXOUT
CXIN0+
CXIN1+
Reserved
Reserved
Reserved
DAC1_Output
FVR Buffer2
D
From Timer1
tmr1_clk
sync_CxOUT
To Timer1
and PSMC Logic
MUX
(2)
7
AGND
CxON
CXPCH<2:0>
3
Note 1:
2:
3:
DS40001637C-page 188
PIC16(L)F1784/6/7
20.2
Comparator Control
Enable
Output selection
Output polarity
Speed/Power selection
Hysteresis enable
Output synchronization
Interrupt enable
Interrupt edge polarity
Positive input channel selection
Negative input channel selection
20.2.1
COMPARATOR ENABLE
20.2.2
COMPARATOR OUTPUT
SELECTION
20.2.3
TABLE 20-2:
COMPARATOR OUTPUT
STATE VS. INPUT
CONDITIONS
Input Condition
CxPOL
CxOUT
20.2.4
COMPARATOR SPEED/POWER
SELECTION
DS40001637C-page 189
PIC16(L)F1784/6/7
20.3
Comparator Hysteresis
20.5
Comparator Interrupt
When either edge detector is triggered and its associated enable bit is set (CxINTP and/or CxINTN bits of
the CMxCON1 register), the Corresponding Interrupt
Flag bit (CxIF bit of the PIR2 register) will be set.
20.4
20.4.1
COMPARATOR OUTPUT
SYNCHRONIZATION
20.6
DS40001637C-page 190
PIC16(L)F1784/6/7
20.7
20.9
CxIN- pin
Analog Ground
Note:
20.8
FIGURE 20-3:
TZLF
DS40001637C-page 191
PIC16(L)F1784/6/7
20.10.1
FIGURE 20-4:
Rs < 10K
Analog
Input
pin
VT 0.6V
RIC
To Comparator
VA
CPIN
5 pF
VT 0.6V
ILEAKAGE(1)
Vss
Legend: CPIN
= Input Capacitance
ILEAKAGE = Leakage Current at the pin due to various junctions
RIC
= Interconnect Resistance
= Source Impedance
RS
= Analog Voltage
VA
VT
= Threshold Voltage
Note 1: See Section 30.0 Electrical Specifications
DS40001637C-page 192
PIC16(L)F1784/6/7
20.11 Register Definitions: Comparator Control
REGISTER 20-1:
R/W-0/0
R-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-0/0
CxON
CxOUT
CxOE
CxPOL
CxZLF
CxSP
CxHYS
CxSYNC
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
DS40001637C-page 193
PIC16(L)F1784/6/7
REGISTER 20-2:
R/W-0/0
R/W-0/0
CxINTP
CxINTN
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
CxPCH<2:0>
R/W-0/0
R/W-0/0
CxNCH<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-3
bit 2-0
Note 1:
2:
PIC16(L)F1784/7 only.
Reserved, input floating for PIC16(L)F1786 only.
DS40001637C-page 194
PIC16(L)F1784/6/7
REGISTER 20-3:
U-0
U-0
U-0
R-0/0
MC4OUT
(1)
R-0/0
R-0/0
R-0/0
MC3OUT
MC2OUT
MC1OUT
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
bit 1
bit 0
Note 1:
PIC16(L)F1784/7 only.
TABLE 20-3:
Name
ANSELA
ANSELB
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA7
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
132
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
138
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1ZLF
C1SP
C1HYS
C1SYNC
193
CM2CON0
C2ON
C2OUT
C2OE
C2POL
C2ZLF
C2SP
C2HYS
C2SYNC
193
CM1CON1
C1NTP
C1INTN
CM2CON1
C2NTP
C2INTN
CM3CON0
C3ON
C3OUT
CM3CON1
C3INTP
C3INTN
CMOUT
FVRCON
C1PCH<2:0>
C1NCH<2:0>
C2PCH<2:0>
C3OE
C3POL
C2NCH<2:0>
C3ZLF
C3SP
C3PCH<2:0>
MC4OUT(1)
MC3OUT
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
DAC1OE1
DAC1OE2
DAC1PSS<1:0>
GIE
PEIE
TMR0IE
INTE
IOCIE
PIE2
OSFIE
C2IE
C1IE
EEIE
PIR2
OSFIF
C2IF
C1IF
EEIF
TRISA
TRISA7
TRISA6
TRISA5
TRISB
TRISB7
TRISB6
TRISC7
TRISC6
TRISC
Legend:
Note 1:
194
C3SYNC
193
MC2OUT
MC1OUT
195
194
ADFVR<1:0>
162
DAC1NSS
TMR0IF
INTF
IOCIF
93
BCL1IE
C4IE
C3IE
CCP2IE
95
BCL1IF
C4IF
C3IF
CCP2IF
99
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
132
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
138
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
DAC1CON1
INTCON
C3HYS
C3NCH<2:0>
DAC1EN
DAC1CON0
194
DAC1R<7:0>
186
186
= unimplemented location, read as 0. Shaded cells are unused by the comparator module.
PIC16(L)F1784/7 only.
DS40001637C-page 195
PIC16(L)F1784/6/7
21.0
21.1.2
TIMER0 MODULE
21.1
Timer0 Operation
21.1.1
FIGURE 21-1:
FOSC/4
Data Bus
0
T0CKI
Sync
2 TCY
TMR0
TMR0SE TMR0CS
8-bit
Prescaler
PSA
PS<2:0>
DS40001637C-page 196
PIC16(L)F1784/6/7
21.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
21.1.4
TIMER0 INTERRUPT
21.1.5
21.1.6
DS40001637C-page 197
PIC16(L)F1784/6/7
21.2
REGISTER 21-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 21-1:
Name
INTCON
TRISA
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
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
OPTION_REG WPUEN
TMR0
Bit Value
INTEDG
TMR0CS TMR0SE
PSA
PS<2:0>
198
TRISA6
TRISA5
196*
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
Legend: = Unimplemented location, read as 0. Shaded cells are not used by the Timer0 module.
* Page provides register information.
DS40001637C-page 198
PIC16(L)F1784/6/7
22.0
FIGURE 22-1:
T1GSS<1:0>
T1G
T1GSPM
00
From Timer0
Overflow
01
sync_C1OUT
10
t1g_in
T1GVAL
0
Single-Pulse
D
sync_C2OUT
11
CK Q
R
TMR1ON
T1GPOL
T1GTM
Acq. Control
Q1
Data Bus
D
Q
RD
T1GCON
EN
Interrupt
T1GGO/DONE
Set
TMR1GIF
det
TMR1GE
TMR1ON
To Comparator Module
TMR1(2)
TMR1H
EN
TMR1L
T1CLK
Synchronized
clock input
1
TMR1CS<1:0>
T1OSO
Reserved
T1OSC
T1OSI
T1SYNC
OUT
11
Synchronize(3)
Prescaler
1, 2, 4, 8
det
10
EN
0
T1OSCEN
(1)
FOSC
Internal
Clock
01
FOSC/4
Internal
Clock
00
2
T1CKPS<1:0>
FOSC/2
Internal
Clock
Sleep input
T1CKI
To Clock Switching Modules
DS40001637C-page 199
PIC16(L)F1784/6/7
22.1
Timer1 Operation
22.2
TABLE 22-1:
22.2.1
TIMER1 ENABLE
SELECTIONS
Timer1
Operation
TMR1ON
TMR1GE
Off
22.2.2
Off
Always On
Count Enabled
TABLE 22-2:
TMR1CS<1:0>
T1OSCEN
11
Reserved
10
Timer1 Oscillator
10
01
00
DS40001637C-page 200
Clock Source
PIC16(L)F1784/6/7
22.3
Timer1 Prescaler
22.4
Timer1 Oscillator
22.5.1
The oscillator circuit is enabled by setting the T1OSCEN bit of the T1CON register. The oscillator will continue to run during Sleep.
22.6
Note:
22.5
Timer1 Operation in
Asynchronous Counter Mode
Timer1 Gate
22.6.1
TABLE 22-3:
T1CLK
T1GPOL
T1G
Timer1 Operation
Counts
Holds Count
Holds Count
Counts
DS40001637C-page 201
PIC16(L)F1784/6/7
22.6.2
TABLE 22-4:
T1GSS
00
01
Overflow of Timer0
(TMR0 increments from FFh to 00h)
10
11
22.6.2.1
22.6.2.2
22.6.2.3
22.6.2.4
22.6.3
22.6.4
22.6.5
22.6.6
DS40001637C-page 202
PIC16(L)F1784/6/7
22.7
Timer1 Interrupt
Note:
22.8
22.9
Section 25.0
see
Section 25.2.4
FIGURE 22-2:
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
Note 1:
2:
DS40001637C-page 203
PIC16(L)F1784/6/7
FIGURE 22-3:
TMR1GE
T1GPOL
t1g_in
T1CKI
T1GVAL
Timer1
FIGURE 22-4:
N+1
N+2
N+3
N+4
TMR1GE
T1GPOL
T1GTM
t1g_in
T1CKI
T1GVAL
Timer1
DS40001637C-page 204
N+4
N+8
PIC16(L)F1784/6/7
FIGURE 22-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
DS40001637C-page 205
PIC16(L)F1784/6/7
FIGURE 22-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
DS40001637C-page 206
Cleared by software
N+1
N+2
N+3
N+4
Set by hardware on
falling edge of T1GVAL
Cleared by
software
PIC16(L)F1784/6/7
22.11 Register Definitions: Timer1 Control
T
REGISTER 22-1:
R/W-0/u
R/W-0/u
R/W-0/u
TMR1CS<1:0>
R/W-0/u
T1CKPS<1:0>
R/W-0/u
R/W-0/u
U-0
R/W-0/u
T1OSCEN
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
bit 2
bit 1
Unimplemented: Read as 0
bit 0
DS40001637C-page 207
PIC16(L)F1784/6/7
REGISTER 22-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
DS40001637C-page 208
PIC16(L)F1784/6/7
TABLE 22-5:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELB
ANSB6
ANSB5
ANSB4
ANSB3
ANSB2
ANSB1
ANSB0
138
CCP1CON
DC1B<1:0>
CCP1M<3:0>
CCP2CON
DC2B<1:0>
CCP2M<3:0>
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
TMR1GIF
ADIF
RCIF
TXIF
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
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
T1CON
T1GCON
Legend:
*
TMR1CS<1:0>
TMR1GE
T1GPOL
T1CKPS<1:0>
T1GTM
T1GSPM
TRISB3
280
280
98
199*
199*
TRISB2
TRISB1
TRISB0
137
TRISC3
TRISC2
TRISC1
TRISC0
142
T1OSCEN
T1SYNC
TMR1ON
207
T1GGO/
DONE
T1GVAL
T1GSS<1:0>
208
= unimplemented location, read as 0. Shaded cells are not used by the Timer1 module.
Page provides register information.
DS40001637C-page 209
PIC16(L)F1784/6/7
23.0
TIMER2 MODULE
FIGURE 23-1:
FOSC/4
Prescaler
1:1, 1:4, 1:16, 1:64
2
TMR2
Comparator
Reset
EQ
TMR2 Output
Postscaler
1:1 to 1:16
T2CKPS<1:0>
PR2
4
T2OUTPS<3:0>
DS40001637C-page 210
PIC16(L)F1784/6/7
23.1
Timer2 Operation
23.3
Timer2 Output
23.4
23.2
Timer2 Interrupt
DS40001637C-page 211
PIC16(L)F1784/6/7
23.5
REGISTER 23-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
DS40001637C-page 212
PIC16(L)F1784/6/7
TABLE 23-1:
Bit 6
CCP2CON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
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>
280
98
210*
TMR2ON
T2CKPS<1:0>
212
210*
Legend: = unimplemented location, read as 0. Shaded cells are not used for Timer2 module.
* Page provides register information.
DS40001637C-page 213
PIC16(L)F1784/6/7
24.0
PROGRAMMABLE SWITCH
MODE CONTROL (PSMC)
DS40001637C-page 214
Single-phase
Complementary Single-phase
Push-Pull
Push-Pull 4-Bridge
Complementary Push-Pull 4-Bridge
Pulse Skipping
Variable Frequency Fixed Duty Cycle
Complementary Variable Frequency Fixed Duty
Cycle
ECCP Compatible modes
- Full-Bridge
- Full-Bridge Reverse
3-Phase 6-Step PWM
PXCPRE<1:0>
1,2,
4, 8
CLR
sync_out
XOR
Falling
Event
PSMCXPHS
PSMCXDC =
PXDCPOL
PSMCXDCS
2012-2014 Microchip Technology Inc.
PSMCXREBS
PSMCXFEBS
sync_C1OUT
sync_C2OUT
sync_C3OUT
sync_C4OUT
PSMCXIN
CCP1
CCP2
PSMCXMDL
PSMCXA
PSMCXASDS
PSMCXB
PSMCXC
PSMCXD
PSMCXE
PSMCXF
PXMODE
Shutdown
Blanking
Latch
Rising
Event
PXPRPOL
PSMCXPRS
PSMCXPH =
PSMCXPOL
PSMCXOEN
PXPOFST
Output Control
PSMCXPR =
FFA
PSMCXTMR
Mode Control
psmc_clk
Modulation
PSMCXCLK
64 MHZ
FOSC
sync_in
XOR
Period
Event
PXCSRC<1:0>
PSMCXSTR
PIC16(L)F1784/6/7
DS40001637C-page 215
FIGURE 24-1:
PIC16(L)F1784/6/7
24.1
Fundamental Operation
FIGURE 24-2:
Inputs
Period Event
Rising Edge Event
Falling Edge Event
Outputs
PWM output
PSMCxIN pin
sync_C1OUT
sync_C2OUT
sync_C3OUT
sync_C4OUT
DS40001637C-page 216
PIC16(L)F1784/6/7
24.1.1
PERIOD EVENT
24.1.2
24.1.3
DS40001637C-page 217
PIC16(L)F1784/6/7
24.2
Event Sources
There are two main sources for the period, rising edge
and falling edge events:
Synchronous input
- Time base
Asynchronous Inputs
- Digital Inputs
- Analog inputs
24.2.1
TIME BASE
24.2.1.1
DS40001637C-page 218
24.2.1.2
EQUATION 24-1:
PWM PERIOD
PSMCxPR[15:0] + 1
Period = -------------------------------------------------F psmc_clk
24.2.1.3
PIC16(L)F1784/6/7
24.2.1.4
EQUATION 24-2:
PSMCxDC[15:0] PSMCxPH[15:0]
DUTYCYCLE = ---------------------------------------------------------------------------------------- PSMCxPR[15:0] + 1
24.2.2
24.2.3
24.2.4
24.2.5
DS40001637C-page 219
PIC16(L)F1784/6/7
24.2.6
CLOCK PRESCALER
Divide by 1
Divide by 2
Divide by 4
Divide by 8
FIGURE 24-3:
Period
psmc_clk
Counter
0030h
0000h
0001h
0002h
0003h
0027h
PSMCxPH<15:0>
0002h
PSMCxDC<15:0>
0028h
PSMCxPR<15:0>
0030h
0028h
0029h
0030h
0000h
Inputs
Period Event
PWM Output
DS40001637C-page 220
PIC16(L)F1784/6/7
24.2.7
ASYNCHRONOUS INPUTS
24.2.7.1
Comparator Inputs
The event triggers on the rising edge of the comparator output. Except for auto-shutdown, the event input is
not level sensitive.
24.2.8.1
24.2.7.2
24.2.7.3
Asynchronous Polarity
24.2.8
INPUT BLANKING
Rising
Falling
Period
Shutdown
Blanking Disabled
24.2.8.2
Immediate Blanking
DS40001637C-page 221
PIC16(L)F1784/6/7
24.2.9
OUTPUT WAVEFORM
GENERATION
24.2.10
24.2.10.1
OUTPUT CONTROL
Output Pin Enable
24.2.10.2
Output Steering
24.3
Modes of Operation
24.3.1
SINGLE-PHASE MODE
24.3.1.1
Mode Features
24.3.1.2
Waveform Generation
Single-phase
Complementary Single-phase
3-phase 6-step PWM
24.2.10.3
Polarity Control
DS40001637C-page 222
PIC16(L)F1784/6/7
EXAMPLE 24-1:
;
;
;
;
;
;
SINGLE-PHASE SETUP
FIGURE 24-4:
Period Event
Rising Edge Event
Falling Edge Event
PSMCxA
DS40001637C-page 223
PIC16(L)F1784/6/7
24.3.2
COMPLEMENTARY PWM
EXAMPLE 24-2:
24.3.2.1
24.3.2.2
;
;
;
;
;
Waveform Generation
FIGURE 24-5:
;
;
;
COMPLEMENTARY
SINGLE-PHASE SETUP
Period Event
Rising Edge Event
Falling Edge Event
PSMCxA
(Primary Output)
Rising Edge Dead Band
Rising Edge Dead Band
Falling Edge Dead Band
Falling Edge Dead Band
PSMCxB
(Complementary Output)
DS40001637C-page 224
PIC16(L)F1784/6/7
24.3.3
PUSH-PULL PWM
24.3.3.1
Code for setting up the PSMC generate the complementary single-phase waveform shown in Figure 24-6,
and given in Example 24-3.
EXAMPLE 24-3:
;
;
;
;
Mode Features
24.3.3.2
Waveform Generation
;
;
PUSH-PULL SETUP
FIGURE 24-6:
A Output
3
A Output
Period Event
B Output
Rising Edge Event
Falling Edge Event
PSMCxA
PSMCxB
DS40001637C-page 225
PIC16(L)F1784/6/7
24.3.4
24.3.4.1
Waveform Generation
Mode Features
FIGURE 24-7:
24.3.4.2
Period Event
PSMCxA
Falling Edge Dead Band
PSMCxE
PSMCxB
Falling Edge Dead Band
Rising Edge Dead Band
PSMCxF
DS40001637C-page 226
PIC16(L)F1784/6/7
24.3.5
24.3.5.1
Mode Features
No Dead-band control
No Steering control available
PWM is output on the following four pins only:
- PSMCxA
- PSMCxB
- PSMCxC
- PSMCxD
24.3.5.2
Waveform generation
FIGURE 24-8:
Period Event
PSMCxA
PSMCxC
PSMCxB
PSMCxD
DS40001637C-page 227
PIC16(L)F1784/6/7
24.3.6
24.3.6.2
24.3.6.1
FIGURE 24-9:
Waveform Generation
Period Event
Rising Edge Event
Falling Edge Event
Rising Edge Dead Band
PSMCxA
PSMCxC
Falling Edge Dead Band
PSMCxE
PSMCxB
PSMCxD
Falling Edge Dead Band
Rising Edge Dead Band
PSMCxF
DS40001637C-page 228
PIC16(L)F1784/6/7
24.3.7
PULSE-SKIPPING PWM
24.3.7.2
Waveform Generation
24.3.7.1
Mode Features
FIGURE 24-10:
10
11
12
period_event
Asynchronous
Rising Edge Event
Synchronous
Rising Edge Event
Falling Edge Event
PSMCxA
DS40001637C-page 229
PIC16(L)F1784/6/7
24.3.8
24.3.8.2
Waveform Generation
24.3.8.1
Mode Features
FIGURE 24-11:
10
Period Event
Asynchronous
Rising Edge Event
Synchronous
Rising Edge Event
PSMCxA
Falling Edge Dead Band
Rising Edge Dead Band
PSMCxB
DS40001637C-page 230
PIC16(L)F1784/6/7
24.3.9
24.3.9.2
24.3.9.1
Mode Features
24.3.9.3
FIGURE 24-12:
10
11
12
Period Event
Falling Edge Event
PSMCxA
PSMCxB
PSMCxC
Rising Edge Dead Band
Falling Edge Dead Band
PSMCxD
DS40001637C-page 231
PIC16(L)F1784/6/7
24.3.10
24.3.10.2
Waveform Generation
Period Event
24.3.10.1
Mode Features
FIGURE 24-13:
10
period_event
Rising Edge Event
PSMCxA
DS40001637C-page 232
PIC16(L)F1784/6/7
24.3.11
24.3.11.2
Period Event
24.3.11.1
Waveform Generation
Mode Features
FIGURE 24-14:
10
period_event
Rising Edge Event
PSMCxA
Falling Edge Dead Band
Rising Edge Dead Band
PSMCxB
DS40001637C-page 233
PIC16(L)F1784/6/7
24.3.12
3-PHASE PWM
24.3.12.2
Waveform Generation
24.3.12.1
Mode Features
TABLE 24-1:
TABLE 24-2:
PHASE GROUPING
PSMC grouping
PSMCxA
1H
PSMCxB
1L
PSMCxC
2H
PSMCxD
2L
PSMCxE
3H
PSMCxF
3L
PSMC outputs
PSMCxA
1H
00h
01h
02h
04h
08h
10h
20h
inactive
active
active
inactive
inactive
inactive
inactive
PSMCxB
1L
inactive
inactive
inactive
inactive
active
active
inactive
PSMCxC
2H
inactive
inactive
inactive
active
active
inactive
inactive
PSMCxD
2L
inactive
active
inactive
inactive
inactive
inactive
active
PSMCxE
3H
inactive
inactive
inactive
inactive
inactive
active
active
PSMCxF
3L
inactive
inactive
active
active
inactive
inactive
inactive
Note 1:
Steering for any value other than those shown will default to the output combination of the Least Significant
steering bit that is set.
DS40001637C-page 234
FIGURE 24-15:
3-Phase State
PSMCxSTR0
01h
02h
04h
08h
10h
20h
Period Event
Rising Edge Event
Falling Edge Event
PSMCxA (1H)
PSMCxB (1L)
PSMCxC (2H)
PSMCxD (2L)
PSMCxE (3H)
DS40001637C-page 235
PIC16(L)F1784/6/7
PSMCxF (3L)
PIC16(L)F1784/6/7
24.4
Dead-Band Control
24.4.1
DEAD-BAND TYPES
24.4.1.1
24.4.1.2
24.4.2
DEAD-BAND ENABLE
24.4.3
24.4.4
DEAD-BAND UNCERTAINTY
When the rising and falling edge events that trigger the
dead-band counters come from asynchronous inputs,
there will be uncertainty in the actual dead-band time of
each cycle. The maximum uncertainty is equal to one
psmc_clk period. The one clock of uncertainty may still
be introduced, even when the dead-band count time is
cleared to zero.
24.4.5
DEAD-BAND OVERLAP
24.4.5.1
24.4.5.2
24.4.5.3
DS40001637C-page 236
PIC16(L)F1784/6/7
24.5
Output Steering
FIGURE 24-16:
24.5.1
3-PHASE STEERING
24.5.2
Base_PWM_signal
PxSTRA
PSMCxA
PxSTRB
PSMCxB
PxSTRC
PSMCxC
PxSTRD
PSMCxD
PxSTRE
PSMCxE
PxSTRF
PSMCxF
DS40001637C-page 237
PIC16(L)F1784/6/7
24.5.3
COMPLEMENTARY PWM
STEERING
PSMCxB
PSMCxD
PSMCxE
PSMCxA
PSMCxC
PSMCxE
FIGURE 24-17:
Base_PWM_signal
PxSTRA
PSMCxA
PSMCxB
PxSTRB
Arrows indicate where a change in the steering bit automatically
forces a change in the corresponding PSMC output.
PxSTRC
PSMCxC
PSMCxD
PxSTRD
PxSTRE
PSMCxE
PSMCxF
PxSTRF
DS40001637C-page 238
PIC16(L)F1784/6/7
24.5.4
24.5.5
FIGURE 24-18:
Period Number
INITIALIZING SYNCHRONIZED
STEERING
PWM Signal
PxSTRA
Synchronized PxSTRA
PxSTRB
Synchronized PxSTRB
PSMCxA
PSMCxB
DS40001637C-page 239
PIC16(L)F1784/6/7
24.6
24.6.2.1
24.6.1
MODULATION ENABLE
24.6.2
MODULATION SOURCES
PxMDLBIT Bit
24.6.3
PSMCxIN pin
Any CCP output
Any Comparator output
PxMDLBIT of the PSMCxMDL register
FIGURE 24-19:
Modulation Input
PWM Off
PWM Period
DS40001637C-page 240
PWM Off
PWM
Off
PIC16(L)F1784/6/7
24.7
Auto-Shutdown
24.7.1
SHUTDOWN
24.7.1.1
Manual Override
24.7.1.2
24.7.2
24.7.2.1
24.7.3
RESTART FROM
AUTO-SHUTDOWN
24.7.3.1
Manual Restart
24.7.3.2
Auto-Restart
DS40001637C-page 241
PIC16(L)F1784/6/7
FIGURE 24-20:
cleared
in software
Cleared
in hardware
Cleared
in software
PSMCxA
PSMCxB
Operating State
Normal
Output
Autoshutdown
Manual Restart
DS40001637C-page 242
Normal
Output
Autoshutdown
Normal
Output
Auto-restart
PIC16(L)F1784/6/7
24.8
24.8.1
PSMC Synchronization
FIGURE 24-21:
SYNCHRONIZATION SOURCES
psmc_clk
Period Event
Caution must be used so that glitches on the period event are not missed
PSMCx Output
24.8.1.1
24.8.1.2
24.8.1.3
Synchronization Skid
DS40001637C-page 243
PIC16(L)F1784/6/7
24.9
FIGURE 24-22:
PSMCxPR<15:0>
Accumulator<3:0>
carry
psmc_clk
DS40001637C-page 244
Comparator
Period Event
PSMCxTMR<15:0>
TABLE 24-3:
FRACTIONAL FREQUENCY
ADJUST CALCULATIONS
Parameter
Value
FPSMC_CLK
64 MHz
TPSMC_CLK
15.625 ns
PSMCxPR<15:0>
00FFh = 255
TPWM
= (PSMCxPR<15:0>+1)*2*TPSMC_CLK
= 256*2*15.625ns
= 8 us
FPWM
125 kHz
TPWM+1
= (PSMCxPR<15:0>+2)*2*TPSMC_CLK
= 257*2*15.625ns
= 8.03125 us
FPWM+1
= 124.513 kHz
TRESOLUTION
= (TPWM+1-TPWM)/2FFA-Bits
= (8.03125us - 8.0 us)/16
= 0.03125us/16
~ 1.95 ns
FRESOLUTION
(FPWM+1-FPWM)/2FFA-Bits
~ -30.4 Hz
PIC16(L)F1784/6/7
TABLE 24-4:
FFA number
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
125.000
124.970
124.939
124.909
124.878
124.848
124.818
124.787
124.757
124.726
124.696
124.666
124.635
124.605
124.574
124.544
0
-30.4
-60.8
-91.2
-121.6
-152.0
-182.4
-212.8
-243.2
-273.6
-304.0
-334.4
-364.8
-395.2
-425.6
-456.0
DS40001637C-page 245
PIC16(L)F1784/6/7
24.10 Register Updates
Internal 64 MHz
External clock
module is enabled
module is disabled
24.10.1
PSMCxPRL
PSMCxPRH
PSMCxDCL
PSMCxDCH
PSMCxPHL
PSMCxPHH
PSMCxDBR
PSMCxDBF
PSMCxBLKR
PSMCxBLKF
PSMCxSTR0 (when the PxSSYNC bit is set)
24.10.2
24.10.3
DS40001637C-page 246
PIC16(L)F1784/6/7
24.12 Register Definitions: PSMC Control
REGISTER 24-1:
R/W-0/0
R/W/HC-0/0
R/W-0/0
R/W-0/0
PSMCxEN
PSMCxLD
PxDBFE
PxDBRE
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PxMODE<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
bit 6
bit 5
bit 4
bit 3-0
DS40001637C-page 247
PIC16(L)F1784/6/7
REGISTER 24-2:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
PxMDLEN
PxMDLPOL
PxMDLBIT
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PxMSRC<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
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3-0
DS40001637C-page 248
PIC16(L)F1784/6/7
REGISTER 24-3:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
P1POFST
P1PRPOL
P1DCPOL
R/W-0/0
R/W-0/0
P1SYNC<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-2
Unimplemented: Read as 0
bit 1-0
REGISTER 24-4:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
P2POFST
P2PRPOL
P2DCPOL
R/W-0/0
R/W-0/0
P2SYNC<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-2
Unimplemented: Read as 0
bit 1-0
DS40001637C-page 249
PIC16(L)F1784/6/7
REGISTER 24-5:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
P3POFST
P3PRPOL
P3DCPOL
R/W-0/0
R/W-0/0
P3SYNC<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-2
Unimplemented: Read as 0
bit 1-0
DS40001637C-page 250
PIC16(L)F1784/6/7
REGISTER 24-6:
U-0
U-0
R/W-0/0
R/W-0/0
PxCPRE<1:0>
U-0
U-0
R/W-0/0
R/W-0/0
PxCSRC<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-6
Unimplemented: Read as 0
bit 5-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
REGISTER 24-7:
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
PxOEF(1)
PxOEE(1)
PxOED(1)
PxOEC(1)
PxOEB
PxOEA
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:
DS40001637C-page 251
PIC16(L)F1784/6/7
REGISTER 24-8:
U-0
R/W-0/0
PxPOLIN
R/W-0/0
PxPOLF
(1)
R/W-0/0
(1)
PxPOLE
R/W-0/0
(1)
PxPOLD
R/W-0/0
PxPOLC
(1)
R/W-0/0
R/W-0/0
PxPOLB
PxPOLA
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
bit 5-0
Note 1:
REGISTER 24-9:
U-0
U-0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
PxFEBM1
PxFEBM0
PxREBM1
PxREBM0
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-2
Unimplemented: Read as 0
bit 1-0
DS40001637C-page 252
PIC16(L)F1784/6/7
REGISTER 24-10: PSMCxREBS: PSMC RISING EDGE BLANKED SOURCE REGISTER
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
PxREBSIN
PxREBSC4
PxREBSC3
PxREBSC2
PxREBSC1
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
PxFEBSIN
PxFEBSC4
PxFEBSC3
PxFEBSC2
PxFEBSC1
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS40001637C-page 253
PIC16(L)F1784/6/7
REGISTER 24-12: PSMCxPHS: PSMC PHASE SOURCE REGISTER(1)
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PxPHSIN
PxPHSC4
PxPHSC3
PxPHSC2
PxPHSC1
PxPHST
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Sources are not mutually exclusive: more than one source can cause a rising edge event.
DS40001637C-page 254
PIC16(L)F1784/6/7
REGISTER 24-13: PSMCxDCS: PSMC DUTY CYCLE SOURCE REGISTER(1)
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PxDCSIN
PxDCSC4
PxDCSC3
PxDCSC2
PxDCSC1
PxDCST
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Sources are not mutually exclusive: more than one source can cause a falling edge event.
DS40001637C-page 255
PIC16(L)F1784/6/7
REGISTER 24-14: PSMCxPRS: PSMC PERIOD SOURCE REGISTER(1)
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PxPRSIN
PxPRSC4
PxPRSC3
PxPRSC2
PxPRSC1
PxPRST
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Sources are not mutually exclusive: more than one source can force the period event and reset the
PSMCxTMR.
DS40001637C-page 256
PIC16(L)F1784/6/7
REGISTER 24-15: PSMCxASDC: PSMC AUTO-SHUTDOWN CONTROL REGISTER
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
R/W-0/0
PxASE
PxASDEN
PxARSEN
PxASDOV
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-1
Unimplemented: Read as 0
bit 0
PxASDEN = 1:
1 = Force PxASDL[n] levels on the PSMCx[n] pins without causing a PSMCxSIF interrupt
0 = Normal PWM and auto-shutdown execution
PxASDEN = 0:
No effect
Note 1:
PASE bit may be set in software. When this occurs the functionality is the same as that caused by
hardware.
DS40001637C-page 257
PIC16(L)F1784/6/7
REGISTER 24-16: PSMCxASDL: PSMC AUTO-SHUTDOWN OUTPUT LEVEL REGISTER
U-0
U-0
R/W-0/0
PxASDLF
(1)
R/W-0/0
(1)
PxASDLE
R/W-0/0
(1)
PxASDLD
R/W-0/0
(1)
PxASDLC
R/W-0/0
R/W-0/0
PxASDLB
PxASDLA
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
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
DS40001637C-page 258
PIC16(L)F1784/6/7
REGISTER 24-17: PSMCxASDS: PSMC AUTO-SHUTDOWN SOURCE REGISTER
R/W-0/0
U-0
U-0
PxASDSIN
R/W-0/0
R/W-0/0
PxASDSC4 PxASDSC3
R/W-0/0
R/W-0/0
U-0
PxASDSC2
PxASDSC1
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-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS40001637C-page 259
PIC16(L)F1784/6/7
REGISTER 24-18: PSMCxTMRL: PSMC TIME BASE COUNTER LOW 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
PSMCxTMRL<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
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-1/1
PSMCxTMRH<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
DS40001637C-page 260
PIC16(L)F1784/6/7
REGISTER 24-20: PSMCxPHL: PSMC PHASE COUNT LOW BYTE 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
PSMCxPHL<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
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
PSMCxPHH<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
DS40001637C-page 261
PIC16(L)F1784/6/7
REGISTER 24-22: PSMCxDCL: PSMC DUTY CYCLE COUNT LOW BYTE 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
PSMCxDCL<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
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
PSMCxDCH<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
DS40001637C-page 262
PIC16(L)F1784/6/7
REGISTER 24-24: PSMCxPRL: PSMC PERIOD COUNT LOW BYTE 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
PSMCxPRL<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
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
PSMCxPRH<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
DS40001637C-page 263
PIC16(L)F1784/6/7
REGISTER 24-26: PSMCxDBR: PSMC RISING EDGE DEAD-BAND TIME 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
PSMCxDBR<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
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
PSMCxDBF<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
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PSMCxFFA<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-4
Unimplemented: Read as 0
bit 3-0
DS40001637C-page 264
PIC16(L)F1784/6/7
REGISTER 24-29: PSMCxBLKR: PSMC RISING EDGE BLANKING TIME 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
PSMCxBLKR<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
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
PSMCxBLKF<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
DS40001637C-page 265
PIC16(L)F1784/6/7
REGISTER 24-31: PSMCxSTR0: PSMC STEERING CONTROL REGISTER 0
U-0
U-0
R/W-0/0
PxSTRF
(2)
R/W-0/0
PxSTRE
(2)
R/W-0/0
(2)
PxSTRD
R/W-0/0
PxSTRC
(2)
R/W-0/0
R/W-1/1
PxSTRB
PxSTRA
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
DS40001637C-page 266
PIC16(L)F1784/6/7
REGISTER 24-31: PSMCxSTR0: PSMC STEERING CONTROL REGISTER 0
bit 1
bit 0
In 3-phase Steering mode, only one PSTRx bit should be set at a time. If more than one is set, then the
lowest bit number steering combination has precedence.
These bits are not implemented on PSMC2.
DS40001637C-page 267
PIC16(L)F1784/6/7
REGISTER 24-32: PSMCxSTR1: PSMC STEERING CONTROL REGISTER 1
R/W-0/0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
PxSSYNC
PxLSMEN
PxHSMEN
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-2
Unimplemented: Read as 0
bit 1
PxMODE = 1100:
1 = Low side driver PSMCxB, PSMCxD and PSMCxF outputs are modulated according to
PSMCxMDL when the output is high and driven low without modulation when the output is low.
0 = PSMCxB, PSMCxD, and PSMCxF outputs are driven high and low by PSMCxSTR0 control
without modulation.
PxMODE <> 1100:
No effect on output
bit 0
PxMODE = 1100:
1 = High side driver PSMCxA, PSMCxC and PSMCxE outputs are modulated according to
PSMCxMDL when the output is high and driven low without modulation when the output is low.
0 = PSMCxA, PSMCxC and PSMCxE outputs are driven high and low by PSMCxSTR0 control
without modulation.
PxMODE <> 1100:
No effect on output
DS40001637C-page 268
PIC16(L)F1784/6/7
REGISTER 24-33: PSMCxINT: PSMC TIME BASE INTERRUPT 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
PxTOVIE
PxTPHIE
PxTDCIE
PxTPRIE
PxTOVIF
PxTPHIF
PxTDCIF
PxTPRIF
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
DS40001637C-page 269
PIC16(L)F1784/6/7
TABLE 24-5:
Name
INTCON
ODCONC
Bit6
Bit5
Bit4
BIt3
Bit2
Bit1
Bit0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
ODC7
ODC6
ODC5
ODC4
ODC3
ODC2
ODC1
ODC0
143
PIE4
PSMC3TIE
PSMC2TIE
PSMC1TIE
PSMC3SIE
PSMC2SIE
PSMC1SIE
97
PIR4
PSMC3TIF
PSMC2TIF
PSMC1TIF
PSMC3SIF
PSMC2SIF
PSMC1SIF
101
PSMCxASDC
PxASE
PxASDEN
PxARSEN
PSMCxASDL
PSMCxASDS
PxASDSIN
PxASDSC4
PxASDSC3
PxASDSC2
PxASDOV
257
PxASDLB
PxASDLA
258
PxASDSC1
259
PSMCxBLKF
PSMCxBLKF<7:0>
265
PSMCxBLKR
PSMCxBLKR<7:0>
265
PSMCxBLNK
PSMCxCLK
PSMCxCON
PSMCxEN
PSMCxLD
PxFEBM1
PxFEBM0
PxCPRE<1:0>
PxDBFE
PxDBRE
PxREBM1
PxREBM0
PxCSRC<1:0>
PxMODE<3:0>
252
251
247
PSMCxDBF
PSMCxDBF<7:0>
264
PSMCxDBR
PSMCxDBR<7:0>
264
PSMCxDCH
PSMCxDC<15:8>
262
PSMCxDCL
PSMCxDC<7:0>
262
PSMCxDCS
PxDCSIN
PxDCSC4
PxDCSC3
PxDCSC2
PxDCSC1
PxDCST
255
PSMCxFEBS
PxFEBSIN
PxFEBSC4
PxFEBSC3
PxFEBSC2
PxFEBSC1
253
PSMCxFFA
PSMCxINT
PxTOVIE
PxTPHIE
PxTDCIE
PxTPRIE
PSMCxMDL
PxMDLEN
PxMDLPOL
PxMDLBIT
PxOEF(1)
PxOEE(1)
PSMCxOEN
PSMCxFFA<3:0>
PxTOVIF
PxTPHIF
PxTDCIF
264
PxTPRIF
PxMSRC<3:0>
PxOED(1)
PxOEC(1)
PxOEB
269
248
PxOEA
251
PSMCxPHH
PSMCxPH<15:8>
261
PSMCxPHL
PSMCxPH<7:0>
261
PSMCxPHS
PxPHSIN
PSMCxPOL
PxPHSC4
PxPHSC3
PxPHSC2
PxPHSC1
PxPHST
254
PxPOLIN
PxPOLF(1)
PxPOLE(1)
PxPOLD(1)
PxPOLC(1)
PxPOLB
PxPOLA
252
PSMCxPRH
PSMCxPR<15:8>
263
PSMCxPRL
PSMCxPR<7:0>
263
PxPRSIN
PxPRSC4
PxPRSC3
PxPRSC2
PxPRSC1
PxPRST
256
PSMCxREBS
PxREBSIN
PxREBSC4
PxREBSC3
PxREBSC2
PxREBSC1
253
PSMCxSTR0
PxSTRF(1)
PxSTRE(1)
PxSTRD(1)
PxSTRC(1)
PxSTRB
PxSTRA
266
PSMCxSTR1
PxSSYNC
PxLSMEN
PxHSMEN
268
PSMCxSYNC
PxPOFST
PxPRPOL
PxDCPOL
PSMCxPRS
PxSYNC<1:0>
249
PSMCxTMRH
PSMCxTMR<15:8>
260
PSMCxTMRL
PSMCxTMR<7:0>
260
SLRCONC
TRISC
Legend:
Note 1:
SLRC7
SLRC6
SLRC5
SLRC4
SLRC3
SLCR2
SRC1
SLRC0
143
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
= unimplemented location, read as 0. Shaded cells are not used by PSMC module.
Unimplemented in PSMC2.
DS40001637C-page 270
PIC16(L)F1784/6/7
25.0
CAPTURE/COMPARE/PWM
MODULES
DS40001637C-page 271
PIC16(L)F1784/6/7
25.1
25.1.2
Capture Mode
25.1.1
FIGURE 25-1:
Prescaler
1, 4, 16
CAPTURE MODE
OPERATION BLOCK
DIAGRAM
CCPRxH
and
Edge Detect
25.1.3
25.1.4
CCP PRESCALER
EXAMPLE 25-1:
CLRF
MOVLW
CCPRxL
Capture
Enable
TMR1H
CHANGING BETWEEN
CAPTURE PRESCALERS
BANKSEL CCPxCON
CCPx
pin
MOVWF
TMR1L
CCPxM<3:0>
System Clock (FOSC)
DS40001637C-page 272
PIC16(L)F1784/6/7
25.1.5
25.1.6
DS40001637C-page 273
PIC16(L)F1784/6/7
25.2
Compare Mode
25.2.3
FIGURE 25-2:
COMPARE MODE
OPERATION BLOCK
DIAGRAM
CCPxM<3:0>
Mode Select
Set CCPxIF Interrupt Flag
(PIRx)
4
CCPRxH CCPRxL
CCPx
Pin
S
R
Output
Logic
Match
TRIS
Output Enable
Comparator
TMR1H
TMR1L
Auto-conversion Trigger
25.2.1
25.2.4
25.2.2
AUTO-CONVERSION TRIGGER
Note:
25.2.5
DS40001637C-page 274
PIC16(L)F1784/6/7
25.2.6
DS40001637C-page 275
PIC16(L)F1784/6/7
25.3
PWM Overview
FIGURE 25-3:
Period
Pulse Width
25.3.1
TMR2 = 0
FIGURE 25-4:
To PSMC module
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
DS40001637C-page 276
PIC16(L)F1784/6/7
25.3.2
4.
5.
6.
Note:
25.3.3
25.3.4
PWM PERIOD
EQUATION 25-1:
PWM PERIOD
TOSC = 1/FOSC
25.3.5
EQUATION 25-2:
PULSE WIDTH
EQUATION 25-3:
CCPRxL:CCPxCON<5:4>
Duty Cycle Ratio = ----------------------------------------------------------------------4 PR2 + 1
DS40001637C-page 277
PIC16(L)F1784/6/7
The 8-bit timer TMR2 register is concatenated with
either the 2-bit internal system clock (FOSC), or 2 bits of
the prescaler, to create the 10-bit time base. The system
clock is used if the Timer2 prescaler is set to 1:1.
EQUATION 25-4:
25.3.6
log 4 PR2 + 1
Resolution = ------------------------------------------ bits
log 2
PWM RESOLUTION
TABLE 25-1:
Note:
PWM Frequency
Timer Prescale
PR2 Value
Maximum Resolution (bits)
TABLE 25-2:
PWM RESOLUTION
1.22 kHz
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
Timer Prescale
PR2 Value
Maximum Resolution (bits)
DS40001637C-page 278
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
PIC16(L)F1784/6/7
25.3.7
25.3.8
25.3.9
EFFECTS OF RESET
Any Reset will force all ports to Input mode and the
CCP registers to their Reset states.
TABLE 25-3:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
APFCON2
CCP3SEL
CCP1CON
DC1B<1:0>
CCP1M<3:0>
280
CCP2CON
DC2B<1:0>
CCP2M<3:0>
280
CCP33CON
DC3B<1:0>
CCP3M<3:0>
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
93
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
96
Name
INTCON
280
280
93
PIE3
CCP3IE
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
PIR2
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
CCP3IF
PIR3
PR2
T2CON
TMR2
TRISA
Legend:
T2OUTPS<3:0>
TMR2ON
T2CKPS<1:0>
TRISA6
100
210*
212
210
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
= Unimplemented location, read as 0. Shaded cells are not used by the PWM.
* Page provides register information.
DS40001637C-page 279
PIC16(L)F1784/6/7
25.4
REGISTER 25-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
1011 = Compare mode: Auto-conversion Trigger (sets CCPxIF bit (CCP2), starts ADC conversion if
ADC module is enabled)(1)
1010 = Compare mode: generate software interrupt only
1001 = Compare mode: clear output on compare match (set CCPxIF)
1000 = Compare mode: set output on compare match (set CCPxIF)
0111 =
0110 =
0101 =
0100 =
0011 =
0010 =
0001 =
0000 =
Reserved
Compare mode: toggle output on match
Reserved
Capture/Compare/PWM off (resets CCPx module)
DS40001637C-page 280
PIC16(L)F1784/6/7
26.0
MASTER SYNCHRONOUS
SERIAL PORT (MSSP)
MODULE
26.1
Master mode
Slave mode
Clock Parity
Slave Select Synchronization (Slave mode only)
Daisy-chain connection of slave devices
FIGURE 26-1:
Write
SSPBUF 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
( TMR22Output )
Prescaler TOSC
4, 16, 64
Baud Rate
Generator
(SSPADD)
DS40001637C-page 281
PIC16(L)F1784/6/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
DS40001637C-page 282
LSb
Clock Cntl
SSPSR
MSb
SDA
Baud rate
generator
(SSPADD)
FIGURE 26-2:
PIC16(L)F1784/6/7
FIGURE 26-3:
Write
SSPBUF Reg
SCL
Shift
Clock
SSPSR Reg
SDA
MSb
LSb
SSPMSK Reg
Match Detect
Addr Match
SSPADD Reg
Start and
Stop bit Detect
Set, Reset
S, P bits
(SSPSTAT Reg)
DS40001637C-page 283
PIC16(L)F1784/6/7
26.2
DS40001637C-page 284
PIC16(L)F1784/6/7
FIGURE 26-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
26.2.1
DS40001637C-page 285
PIC16(L)F1784/6/7
26.2.2
FIGURE 26-5:
SDO
LSb
SCK
General I/O
Processor 1
DS40001637C-page 286
SDO
SDI
Shift Register
(SSPSR)
MSb
Serial Clock
Slave Select
(optional)
Shift Register
(SSPSR)
MSb
LSb
SCK
SS
Processor 2
PIC16(L)F1784/6/7
26.2.3
FIGURE 26-6:
Write to
SSPBUF
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)
SSP1IF
SSPSR to
SSPBUF
DS40001637C-page 287
PIC16(L)F1784/6/7
26.2.4
Daisy-Chain Configuration
26.2.5
SLAVE SELECT
SYNCHRONIZATION
DS40001637C-page 288
PIC16(L)F1784/6/7
FIGURE 26-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 26-8:
SS
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SSPBUF to
SSPSR
SDO
bit 7
bit 6
bit 7
SDI
bit 6
bit 0
bit 0
bit 7
bit 7
Input
Sample
SSP1IF
Interrupt
Flag
SSPSR to
SSPBUF
DS40001637C-page 289
PIC16(L)F1784/6/7
FIGURE 26-9:
SS
Optional
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
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
SSP1IF
Interrupt
Flag
SSPSR to
SSPBUF
Write Collision
detection active
FIGURE 26-10:
SS
Not Optional
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Write to
SSPBUF
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
SSP1IF
Interrupt
Flag
SSPSR to
SSPBUF
Write Collision
detection active
DS40001637C-page 290
PIC16(L)F1784/6/7
26.2.6
TABLE 26-1:
Name
ANSELA
APFCON1
Bit 6
ANSA7
C2OUTSEL CCP1SEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA5
ANSA4
ANSA3
ANSA2
ANSA1
ANSA0
132
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
INTCON
SSP1BUF
285*
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
333
SSP1STAT
SMP
CKE
D/A
R/W
UA
BF
329
TRISA
TRISA7
TRISA6
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
131
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISA0
142
Legend:
*
Note 1:
SSPM<3:0>
331
= Unimplemented location, read as 0. Shaded cells are not used by the MSSP in SPI mode.
Page provides register information.
PIC16(L)F1784/7 only.
DS40001637C-page 291
PIC16(L)F1784/6/7
26.3
VDD
SCL
DS40001637C-page 292
I2C MASTER/
SLAVE CONNECTION
FIGURE 26-11:
SCL
VDD
Master
Slave
SDA
SDA
PIC16(L)F1784/6/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.
26.3.1
CLOCK STRETCHING
26.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.
DS40001637C-page 293
PIC16(L)F1784/6/7
26.4
BYTE FORMAT
26.4.4
DS40001637C-page 294
TABLE 26-2:
TERM
Transmitter
PIC16(L)F1784/6/7
26.4.5
26.4.7
START CONDITION
RESTART CONDITION
STOP CONDITION
26.4.8
FIGURE 26-12:
SDA
SCL
S
Start
P
Change of
Change of
Data Allowed
Data Allowed
Condition
FIGURE 26-13:
Stop
Condition
Sr
Change of
Change of
Data Allowed
Restart
Data Allowed
Condition
DS40001637C-page 295
PIC16(L)F1784/6/7
26.4.9
ACKNOWLEDGE SEQUENCE
26.5
DS40001637C-page 296
PIC16(L)F1784/6/7
26.5.2
SLAVE RECEPTION
26.5.2.2
DS40001637C-page 297
DS40001637C-page 298
SSPOV
BF
SSP1IF
A7
A6
A5
A4
A3
A2
A1
ACK
D7
D6
D4
D3
D2
D1
SSPBUF is read
Cleared by software
D5
Receiving Data
D6
First byte
of data is
available
in SSPBUF
D0 ACK D7
D4
D3
D2
D1
Cleared by software
D5
Receiving Data
D0
ACK = 1
FIGURE 26-14:
SCL
SDA
Receiving Address
PIC16(L)F1784/6/7
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 0, DHEN = 0)
CKP
SSPOV
BF
SSP1IF
SCL
A7
A6
A5
A4
A3
A2
A1
R/W=0 ACK
SEN
2
D6
D5
D4
D3
D2
D1
D0
SSPBUF is read
Cleared by software
D7
Receive Data
ACK
SEN
3
D5
D4
D3
First byte
of data is
available
in SSPBUF
D2
D1
Cleared by software
D6
D7
Receive Data
D0
ACK
FIGURE 26-15:
SDA
Receive Address
PIC16(L)F1784/6/7
DS40001637C-page 299
DS40001637C-page 300
ACKTIM
CKP
ACKDT
BF
SSP1IF
Receiving Address
Slave software
clears ACKDT to
Address is
read from
SSBUF
If AHEN = 1:
SSP1IF 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
SSP1IF 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 26-16:
SCL
SDA
PIC16(L)F1784/6/7
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 1, DHEN = 1)
ACKTIM
CKP
ACKDT
BF
SSP1IF
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
SSPBUF
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 SSPBUF
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
SSPBUF 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 26-17:
SCL
SDA
R/W = 0
Master releases
SDA to slave for ACK sequence
PIC16(L)F1784/6/7
DS40001637C-page 301
PIC16(L)F1784/6/7
26.5.3
SLAVE TRANSMISSION
26.5.3.2
7-bit Transmission
1.
26.5.3.1
DS40001637C-page 302
D/A
R/W
ACKSTAT
CKP
BF
SSP1IF
Receiving Address
Received address
is read from SSPBUF
Indicates an address
has been received
A7 A6 A5 A4 A3 A2 A1
8
R/W = 1 Automatic
ACK
Transmitting Data
Automatic
Set by software
Data to transmit is
loaded into SSPBUF
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 26-18:
SCL
SDA
Master sends
Stop condition
PIC16(L)F1784/6/7
DS40001637C-page 303
PIC16(L)F1784/6/7
26.5.3.3
DS40001637C-page 304
D/A
R/W
ACKTIM
CKP
ACKSTAT
ACKDT
BF
SSP1IF
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 SSPBUF
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 SSPBUF
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 SSPSTAT
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 26-19:
SCL
SDA
PIC16(L)F1784/6/7
DS40001637C-page 305
PIC16(L)F1784/6/7
26.5.4
3.
4.
5.
6.
7.
8.
26.5.5
9.
DS40001637C-page 306
CKP
UA
BF
SSP1IF
0 A9 A8
Set by hardware
on 9th falling edge
When UA = 1;
SCL is held low
If address matches
SSPADD it is loaded into
SSPBUF
ACK
A7 A6 A5 A4 A3 A2 A1 A0 ACK
9
1
Data is read
from SSPBUF
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 SSPBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Receive Data
FIGURE 26-20:
SCL
SDA
Master sends
Stop condition
PIC16(L)F1784/6/7
DS40001637C-page 307
DS40001637C-page 308
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 SSPADD is
not allowed until 9th
falling edge of SCL
SSPBUF can be
read anytime before
the next received byte
Cleared by software
A7
A0
ACK
UA
D6
D5
D4
D2
D1
Update of SSPADD,
clears UA and releases
SCL
D3
Receive Data
Cleared by software
D7
Received data
is read from
SSPBUF
D6 D5
Receive Data
D0 ACK D7
FIGURE 26-21:
SSP1IF
SCL
SDA
PIC16(L)F1784/6/7
I2C SLAVE, 10-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 1, DHEN = 0)
D/A
R/W
ACKSTAT
CKP
UA
BF
SSP1IF
Set by hardware
Indicates an address
has been received
UA indicates SSPADD
must be updated
SSPBUF loaded
with received address
SCL
1
3
7 8
After SSPADD 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 SSPBUF
Sr
1 1 1 1 0 A9 A8
ACK
Set by software
releases SCL
Data to transmit is
loaded into SSPBUF
D7 D6 D5 D4 D3 D2 D1 D0
Master sends
Stop condition
ACK = 1
Master sends
not ACK
FIGURE 26-22:
SDA
Master sends
Restart event
PIC16(L)F1784/6/7
DS40001637C-page 309
PIC16(L)F1784/6/7
26.5.6
26.5.6.2
CLOCK STRETCHING
FIGURE 26-23:
26.5.6.3
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 26-22).
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
SSPCON1
DS40001637C-page 310
PIC16(L)F1784/6/7
26.5.8
FIGURE 26-24:
SDA
SCL
S
Receiving Data
ACK
D6
D5
D4
D3
D2
D1
D0
SSP1IF
BF (SSPSTAT<0>)
Cleared by software
GCEN (SSPCON2<7>)
SSPBUF is read
1
26.5.9
DS40001637C-page 311
PIC16(L)F1784/6/7
26.6
26.6.1
DS40001637C-page 312
PIC16(L)F1784/6/7
26.6.2
CLOCK ARBITRATION
FIGURE 26-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
26.6.3
DS40001637C-page 313
PIC16(L)F1784/6/7
26.6.4
CONDITION TIMING
FIGURE 26-26:
SDA = 1,
SCL = 1
TBRG
TBRG
SDA
2nd bit
1st bit
TBRG
SCL
S
DS40001637C-page 314
TBRG
PIC16(L)F1784/6/7
26.6.5
FIGURE 26-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
DS40001637C-page 315
PIC16(L)F1784/6/7
26.6.6
26.6.6.1
BF Status Flag
26.6.6.3
7.
8.
9.
10.
11.
12.
13.
26.6.6.2
DS40001637C-page 316
R/W
PEN
SEN
BF (SSPSTAT<0>)
SSP1IF
SCL
SDA
A6
A5
A4
A3
A2
A1
Cleared by software
SSPBUF written
D7
1
SCL held low
while CPU
responds to SSP1IF
ACK = 0
R/W = 0
A7
D5
D4
D3
D2
D1
D0
D6
Cleared by software
ACK
ACKSTAT in
SSPCON2 = 1
FIGURE 26-28:
SEN = 0
PIC16(L)F1784/6/7
DS40001637C-page 317
PIC16(L)F1784/6/7
26.6.7
26.6.7.1
BF Status Flag
26.6.7.2
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
26.6.7.3
26.6.7.4
DS40001637C-page 318
12.
13.
14.
15.
RCEN
ACKEN
SSPOV
BF
(SSPSTAT<0>)
SDA = 0, SCL = 1
while CPU
responds to SSP1IF
SSP1IF
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
P
Set SSP1IF interrupt
at end of Acknowledge sequence
Bus master
terminates
transfer
Set P bit
(SSPSTAT<4>)
and SSP1IF
PEN bit = 1
written here
D0
RCEN cleared
automatically
D7 D6 D5 D4 D3 D2 D1
RCEN cleared
automatically
RCEN = 1, start
next receive
Cleared by software
Cleared by software
D7 D6 D5 D4 D3 D2 D1
RCEN cleared
automatically
A1 R/W
FIGURE 26-29:
SCL
SDA
SEN = 0
Write to SSPBUF occurs here,
start XMIT
Write to SSPCON2<4>
to start Acknowledge sequence
SDA = ACKDT (SSPCON2<5>) = 0
PIC16(L)F1784/6/7
DS40001637C-page 319
PIC16(L)F1784/6/7
26.6.8
ACKNOWLEDGE SEQUENCE
TIMING
26.6.9
26.6.8.1
26.6.9.1
FIGURE 26-30:
TBRG
SDA
SCL
D0
ACK
SSP1IF
SSP1IF set at
the end of receive
Cleared in
software
Cleared in
software
SSP1IF set at the end
of Acknowledge sequence
DS40001637C-page 320
PIC16(L)F1784/6/7
FIGURE 26-31:
Write to SSPCON2,
set PEN
Falling edge of
9th clock
TBRG
SCL
SDA
ACK
P
TBRG
TBRG
TBRG
26.6.10
SLEEP OPERATION
2
26.6.11
EFFECTS OF A RESET
26.6.12
MULTI-MASTER MODE
Address Transfer
Data Transfer
A Start Condition
A Repeated Start Condition
An Acknowledge Condition
26.6.13
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, BCL1IF and reset the
I2C port to its Idle state (Figure 26-31).
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
SSPBUF 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 SSP1IF bit will be set.
A write to the SSPBUF 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 SSPSTAT
register, or the bus is Idle and the S and P bits are
cleared.
DS40001637C-page 321
PIC16(L)F1784/6/7
FIGURE 26-32:
SDA
SCL
BCL1IF
DS40001637C-page 322
PIC16(L)F1784/6/7
26.6.13.1
FIGURE 26-33:
The reason that bus collision is not a factor during a Start condition is that no two
bus masters can assert a Start condition
at the exact same time. Therefore, one
master will always assert SDA before the
other. This condition does not cause a bus
collision because the two masters must be
allowed to arbitrate the first address
following the Start condition. If the address
is the same, arbitration must be allowed to
continue into the data portion, Repeated
Start or Stop conditions.
SDA
SCL
Set SEN, enable Start
condition if SDA = 1, SCL = 1
SEN
BCL1IF
SSP1IF
SSP1IF and BCL1IF are
cleared by software
DS40001637C-page 323
PIC16(L)F1784/6/7
FIGURE 26-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 BCL1IF.
BCL1IF
Interrupt cleared
by software
SSP1IF 0
FIGURE 26-35:
SDA
SCL
TBRG
SEN
BCL1IF
Set SSP1IF
SSP1IF
SDA = 0, SCL = 1,
set SSP1IF
DS40001637C-page 324
Interrupts cleared
by software
PIC16(L)F1784/6/7
26.6.13.2
FIGURE 26-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 BCL1IF and release SDA and SCL.
RSEN
BCL1IF
Cleared by software
S
SSP1IF
FIGURE 26-37:
TBRG
SDA
SCL
BCL1IF
RSEN
S
SSP1IF
DS40001637C-page 325
PIC16(L)F1784/6/7
26.6.13.3
b)
FIGURE 26-38:
TBRG
TBRG
SDA
SDA sampled
low after TBRG,
set BCL1IF
SSP1IF
FIGURE 26-39:
TBRG
TBRG
SDA
Assert SDA
SCL
PEN
BCL1IF
P
SSP1IF
DS40001637C-page 326
PIC16(L)F1784/6/7
TABLE 26-3:
Name
APFCON1
Bit 6
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIE2
OSFIE
C2IE
C1IE
EEIE
BCL1IE
C4IE
C3IE
CCP2IE
95
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
PIR2
OSFIF
C2IF
C1IF
EEIF
BCL1IF
C4IF
C3IF
CCP2IF
99
INTCON
C2OUTSEL CCP1SEL
Bit 5
SSP1ADD
ADD<7:0>
SSP1BUF
334
285*
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
332
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
331
SMP
CKE
D/A
R/W
UA
BF
329
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISA0
142
SSP1MSK
SSP1STAT
TRISC
Legend:
*
Note 1:
SSPM<3:0>
331
334
MSK<7:0>
= unimplemented location, read as 0. Shaded cells are not used by the MSSP module in I2C mode.
Page provides register information.
PIC16(L)F1784/7 only.
DS40001637C-page 327
PIC16(L)F1784/6/7
26.7
EQUATION 26-1:
FOSC
FCLOCK = ------------------------------------------------ SSPxADD + 1 4
FIGURE 26-40:
SSPM<3:0>
Reload
SSPADD<7:0>
Reload
Control
SCL
SSPCLK
FOSC/2
TABLE 26-4:
Note 1:
FOSC
FCY
BRG Value
FCLOCK
(2 Rollovers of BRG)
32 MHz
8 MHz
13h
400 kHz(1)
32 MHz
8 MHz
19h
308 kHz
32 MHz
8 MHz
4Fh
100 kHz
16 MHz
4 MHz
09h
400 kHz(1)
16 MHz
4 MHz
0Ch
308 kHz
16 MHz
4 MHz
27h
100 kHz
4 MHz
1 MHz
09h
100 kHz
I2C
I2C
The
interface does not conform to the 400 kHz
specification (which applies to rates greater than
100 kHz) in all details, but may be used with care where higher rates are required by the application.
DS40001637C-page 328
PIC16(L)F1784/6/7
26.8
REGISTER 26-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
(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
DS40001637C-page 329
PIC16(L)F1784/6/7
REGISTER 26-1:
bit 0
DS40001637C-page 330
PIC16(L)F1784/6/7
REGISTER 26-2:
R/C/HS-0/0
R/C/HS-0/0
R/W-0/0
R/W-0/0
WCOL
SSPOV
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 SSPBUF register.
When enabled, these pins must be properly configured as input or output.
When enabled, the SDA and SCL pins must be configured as inputs.
SSPADD values of 0, 1 or 2 are not supported for I2C mode.
SSPADD value of 0 is not supported. Use SSPM = 0000 instead.
DS40001637C-page 331
PIC16(L)F1784/6/7
REGISTER 26-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 SSPBUF may not be written (or writes to the SSPBUF are disabled).
DS40001637C-page 332
PIC16(L)F1784/6/7
REGISTER 26-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
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
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 SSPBUF.
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.
DS40001637C-page 333
PIC16(L)F1784/6/7
REGISTER 26-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 26-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
bit 7-3
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 7-0
bit 7-1
bit 0
DS40001637C-page 334
PIC16(L)F1784/6/7
27.0
ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
FIGURE 27-1:
TXIE
Interrupt
TXIF
TXREG Register
8
MSb
TX/CK pin
LSb
(8)
Pin Buffer
and Control
TRMT
SPEN
TXEN
Baud Rate Generator
FOSC
+1
SPBRGH
TX9
BRG16
SPBRGL
Multiplier
x4
x16 x64
SYNC
1 X 0 0
BRGH
X 1 1 0
BRG16
X 1 0 1
TX9D
DS40001637C-page 335
PIC16(L)F1784/6/7
FIGURE 27-2:
CREN
RX/DT pin
Data
Recovery
FOSC
BRG16
+1
SPBRGH
SPBRGL
RSR Register
MSb
Pin Buffer
and Control
Multiplier
x4
x16 x64
SYNC
1 X 0 0
BRGH
X 1 1 0
BRG16
X 1 0 1
Stop
RCIDL
OERR
(8)
LSb
0 START
RX9
n
n
FERR
RX9D
RCREG Register
8
FIFO
Data Bus
RCIF
RCIE
Interrupt
DS40001637C-page 336
PIC16(L)F1784/6/7
27.1
27.1.1
EUSART ASYNCHRONOUS
TRANSMITTER
27.1.1.1
27.1.1.2
Transmitting Data
27.1.1.3
27.1.1.4
DS40001637C-page 337
PIC16(L)F1784/6/7
27.1.1.5
TSR Status
27.1.1.7
27.1.1.6
1.
2.
3.
FIGURE 27-3:
Write to TXREG
BRG Output
(Shift Clock)
TX/CK
pin
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
TRMT bit
(Transmit Shift
Reg. Empty Flag)
DS40001637C-page 338
4.
5.
6.
7.
8.
ASYNCHRONOUS TRANSMISSION
Word 1
Start bit
bit 0
bit 1
bit 7/8
Stop bit
Word 1
1 TCY
Word 1
Transmit Shift Reg.
PIC16(L)F1784/6/7
FIGURE 27-4:
Write to TXREG
TX/CK
pin
Start bit
bit 0
bit 1
Word 1
1 TCY
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
bit 7/8
Stop bit
Start bit
Word 2
bit 0
1 TCY
Word 1
Transmit Shift Reg.
TRMT bit
(Transmit Shift
Reg. Empty Flag)
Note:
Word 2
Word 1
BRG Output
(Shift Clock)
Word 2
Transmit Shift Reg.
TABLE 27-1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
346
Name
INTCON
RCSTA
SPBRGL
BRG<7:0>
348
SPBRGH
BRG<15:8>
348
TRISC
TXREG
TXSTA
Legend:
*
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
TX9
TXEN
142
337*
SYNC
SENDB
BRGH
TRMT
TX9D
345
= unimplemented location, read as 0. Shaded cells are not used for asynchronous transmission.
Page provides register information.
DS40001637C-page 339
PIC16(L)F1784/6/7
27.1.2
EUSART ASYNCHRONOUS
RECEIVER
27.1.2.1
27.1.2.2
Receiving Data
27.1.2.3
Receive Interrupts
DS40001637C-page 340
PIC16(L)F1784/6/7
27.1.2.4
27.1.2.5
27.1.2.7
Address Detection
27.1.2.6
DS40001637C-page 341
PIC16(L)F1784/6/7
27.1.2.8
27.1.2.9
1.
FIGURE 27-5:
Rcv Shift
Reg
Rcv Buffer Reg.
RCIDL
ASYNCHRONOUS RECEPTION
Start
bit
bit 0
RX/DT pin
bit 1
Start
bit
Word 1
RCREG
bit 0
Start
bit
bit 7/8
Stop
bit
Word 2
RCREG
Read Rcv
Buffer Reg.
RCREG
RCIF
(Interrupt Flag)
OERR bit
CREN
Note:
This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word,
causing the OERR (overrun) bit to be set.
DS40001637C-page 342
PIC16(L)F1784/6/7
TABLE 27-2:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
Name
INTCON
RCREG
RCSTA
RX9
SREN
SPBRGL
TXSTA
Legend:
*
ADDEN
FERR
OERR
RX9D
BRG<7:0>
SPBRGH
TRISC
CREN
98
340*
346
348
BRG<15:8>
348
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
345
= unimplemented location, read as 0. Shaded cells are not used for asynchronous reception.
Page provides register information.
DS40001637C-page 343
PIC16(L)F1784/6/7
27.2
DS40001637C-page 344
PIC16(L)F1784/6/7
27.3
REGISTER 27-1:
R/W-/0
R/W-0/0
CSRC
TX9
R/W-0/0
TXEN
(1)
R/W-0/0
R/W-0/0
R/W-0/0
R-1/1
R/W-0/0
SYNC
SENDB
BRGH
TRMT
TX9D
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:
DS40001637C-page 345
PIC16(L)F1784/6/7
REGISTER 27-2:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R-0/0
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
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
DS40001637C-page 346
PIC16(L)F1784/6/7
REGISTER 27-3:
R-0/0
R-1/1
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
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
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS40001637C-page 347
PIC16(L)F1784/6/7
27.4
EXAMPLE 27-1:
CALCULATING BAUD
RATE ERROR
DS40001637C-page 348
PIC16(L)F1784/6/7
TABLE 27-3:
Configuration Bits
BRG/EUSART Mode
8-bit/Asynchronous
FOSC/[64 (n+1)]
8-bit/Asynchronous
16-bit/Asynchronous
16-bit/Asynchronous
8-bit/Synchronous
16-bit/Synchronous
SYNC
BRG16
BRGH
1
Legend:
FOSC/[4 (n+1)]
TABLE 27-4:
Name
BAUDCON
RCSTA
FOSC/[16 (n+1)]
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
346
SPBRGL
BRG<7:0>
348
SPBRGH
BRG<15:8>
348
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
345
Legend: = unimplemented location, read as 0. Shaded cells are not used for the Baud Rate Generator.
* Page provides register information.
DS40001637C-page 349
PIC16(L)F1784/6/7
TABLE 27-5:
BAUD
RATE
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
300
1200
1221
1.73
255
1200
0.00
239
1200
0.00
143
2400
2404
0.16
207
2404
0.16
129
2400
0.00
119
2400
0.00
71
9600
9615
0.16
51
9470
-1.36
32
9600
0.00
29
9600
0.00
17
10417
10417
0.00
47
10417
0.00
29
10286
-1.26
27
10165
-2.42
16
19.2k
19.23k
0.16
25
19.53k
1.73
15
19.20k
0.00
14
19.20k
0.00
57.6k
55.55k
-3.55
57.60k
0.00
57.60k
0.00
115.2k
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
300
300
0.16
207
300
0.00
191
300
0.16
51
1200
1202
0.16
103
1202
0.16
51
1200
0.00
47
1202
0.16
12
2400
2404
0.16
51
2404
0.16
25
2400
0.00
23
9600
9615
0.16
12
9600
0.00
10417
10417
0.00
11
10417
0.00
19.2k
19.20k
0.00
57.6k
57.60k
0.00
115.2k
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
300
1200
2400
9600
9615
0.16
207
9615
0.16
129
9600
0.00
119
9600
0.00
71
10417
10417
0.00
191
10417
0.00
119
10378
-0.37
110
10473
0.53
65
19.2k
19.23k
0.16
103
19.23k
0.16
64
19.20k
0.00
59
19.20k
0.00
35
57.6k
57.14k
-0.79
34
56.82k
-1.36
21
57.60k
0.00
19
57.60k
0.00
11
115.2k
117.64k
2.12
16
113.64k
-1.36
10
115.2k
0.00
115.2k
0.00
DS40001637C-page 350
PIC16(L)F1784/6/7
TABLE 27-5:
BAUD
RATE
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
1202
0.16
207
1200
0.00
191
300
1202
0.16
0.16
207
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19231
0.16
25
19.23k
0.16
12
19.2k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300.0
0.00
6666
300.0
-0.01
4166
300.0
0.00
3839
300.0
0.00
2303
1200
1200
-0.02
3332
1200
-0.03
1041
1200
0.00
959
1200
0.00
575
2400
2401
-0.04
832
2399
-0.03
520
2400
0.00
479
2400
0.00
287
9600
9615
0.16
207
9615
0.16
129
9600
0.00
119
9600
0.00
71
10417
10417
0.00
191
10417
0.00
119
10378
-0.37
110
10473
0.53
65
19.2k
19.23k
0.16
103
19.23k
0.16
64
19.20k
0.00
59
19.20k
0.00
35
57.6k
57.14k
-0.79
34
56.818
-1.36
21
57.60k
0.00
19
57.60k
0.00
11
115.2k
117.6k
2.12
16
113.636
-1.36
10
115.2k
0.00
115.2k
0.00
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
299.9
-0.02
1666
300.1
0.04
832
300.0
0.00
767
300.5
0.16
207
1200
1199
-0.08
416
1202
0.16
207
1200
0.00
191
1202
0.16
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19.23k
0.16
25
19.23k
0.16
12
19.20k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
DS40001637C-page 351
PIC16(L)F1784/6/7
TABLE 27-5:
BAUD
RATE
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
300.0
1200
0.00
0.00
26666
6666
300.0
1200
0.00
-0.01
16665
4166
300.0
1200
0.00
0.00
15359
3839
300.0
1200
0.00
0.00
9215
2303
2400
2400
0.01
3332
2400
0.02
2082
2400
0.00
1919
2400
0.00
1151
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
9600
9604
0.04
832
9597
-0.03
520
9600
0.00
479
9600
0.00
287
10417
10417
0.00
767
10417
0.00
479
10425
0.08
441
10433
0.16
264
143
19.2k
19.18k
-0.08
416
19.23k
0.16
259
19.20k
0.00
239
19.20k
0.00
57.6k
57.55k
-0.08
138
57.47k
-0.22
86
57.60k
0.00
79
57.60k
0.00
47
115.2k
115.9k
0.64
68
116.3k
0.94
42
115.2k
0.00
39
115.2k
0.00
23
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
832
300
300.0
0.00
6666
300.0
0.01
3332
300.0
0.00
3071
300.1
0.04
1200
1200
-0.02
1666
1200
0.04
832
1200
0.00
767
1202
0.16
207
2400
2401
0.04
832
2398
0.08
416
2400
0.00
383
2404
0.16
103
9600
9615
0.16
207
9615
0.16
103
9600
0.00
95
9615
0.16
25
10417
10417
191
10417
0.00
95
10473
0.53
87
10417
0.00
23
19.2k
19.23k
0.16
103
19.23k
0.16
51
19.20k
0.00
47
19.23k
0.16
12
57.6k
57.14k
-0.79
34
58.82k
2.12
16
57.60k
0.00
15
115.2k
117.6k
2.12
16
111.1k
-3.55
115.2k
0.00
DS40001637C-page 352
PIC16(L)F1784/6/7
27.4.1
AUTO-BAUD DETECT
TABLE 27-6:
FIGURE 27-6:
BRG16
BRGH
BRG Base
Clock
BRG ABD
Clock
FOSC/64
FOSC/512
FOSC/16
FOSC/128
FOSC/16
FOSC/128
FOSC/4
FOSC/32
Note:
BRG Value
0000h
RX pin
001Ch
Start
Edge #1
bit 1
bit 0
Edge #2
bit 3
bit 2
Edge #3
bit 5
bit 4
Edge #4
bit 7
bit 6
Edge #5
Stop bit
BRG Clock
Auto Cleared
Set by User
ABDEN bit
RCIDL
RCIF bit
(Interrupt)
Read
RCREG
SPBRGL
XXh
1Ch
SPBRGH
XXh
00h
Note 1:
The ABD sequence requires the EUSART module to be configured in Asynchronous mode.
DS40001637C-page 353
PIC16(L)F1784/6/7
27.4.2
AUTO-BAUD OVERFLOW
27.4.3
AUTO-WAKE-UP ON BREAK
27.4.3.1
Special Considerations
Break Character
To avoid character errors or character fragments during
a wake-up event, the wake-up character must be all
zeros.
When the wake-up is enabled the function works
independent of the low time on the data stream. If the
WUE bit is set and a valid non-zero character is
received, the low time from the Start bit to the first rising
edge will be interpreted as the wake-up event. The
remaining bits in the character will be received as a
fragmented character and subsequent characters can
result in framing or overrun errors.
Therefore, the initial character in the transmission must
be all 0s. This must be ten or more bit times, 13-bit
times recommended for LIN bus, or any number of bit
times for standard RS-232 devices.
Oscillator Start-up Time
Oscillator start-up time must be considered, especially
in applications using oscillators with longer start-up
intervals (i.e., LP, XT or HS/PLL mode). The Sync
Break (or wake-up signal) character must be of
sufficient length, and be followed by a sufficient
interval, to allow enough time for the selected oscillator
to start and provide proper initialization of the EUSART.
WUE Bit
The wake-up event causes a receive interrupt by
setting the RCIF bit. The WUE bit is cleared in
hardware by a rising edge on RX/DT. The interrupt
condition is then cleared in software by reading the
RCREG register and discarding its contents.
To ensure that no actual data is lost, check the RCIDL
bit to verify that a receive operation is not in process
before setting the WUE bit. If a receive operation is not
occurring, the WUE bit may then be set just prior to
entering the Sleep mode.
DS40001637C-page 354
PIC16(L)F1784/6/7
FIGURE 27-7:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Auto Cleared
WUE bit
RX/DT Line
RCIF
Note 1:
FIGURE 27-8:
Q1
Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4
OSC1
Auto Cleared
Note 1
RCIF
Sleep Command Executed
Note 1:
2:
Sleep Ends
If the wake-up event requires long oscillator warm-up time, the automatic clearing of the WUE bit can occur while the stposc signal is
still active. This sequence should not depend on the presence of Q clocks.
The EUSART remains in idle while the WUE bit is set.
DS40001637C-page 355
PIC16(L)F1784/6/7
27.4.4
27.4.4.1
27.4.5
FIGURE 27-9:
Write to TXREG
BRG Output
(Shift Clock)
TX (pin)
Start bit
bit 0
bit 1
bit 11
Stop bit
Break
TXIF bit
(Transmit
Interrupt Flag)
TRMT bit
(Transmit Shift
Empty Flag)
SENDB
(send Break
control bit)
DS40001637C-page 356
Auto Cleared
PIC16(L)F1784/6/7
27.5
27.5.1
Clearing the SCKP bit sets the Idle state as low. When
the SCKP bit is cleared, the data changes on the rising
edge of each clock.
27.5.1.3
27.5.1.4
SYNC = 1
CSRC = 1
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
27.5.1.1
27.5.1.2
1.
2.
3.
4.
5.
6.
Master Clock
7.
8.
Clock Polarity
DS40001637C-page 357
PIC16(L)F1784/6/7
FIGURE 27-10:
SYNCHRONOUS TRANSMISSION
RX/DT
pin
bit 0
bit 1
Word 1
bit 2
bit 7
bit 0
bit 1
Word 2
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
TXREG Reg
Write Word 1
Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
TXEN bit
Note:
1
Sync Master mode, SPBRGL = 0, continuous transmission of two 8-bit words.
FIGURE 27-11:
bit 0
bit 2
bit 1
bit 6
bit 7
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
TABLE 27-7:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
346
Name
INTCON
RCSTA
SPBRGL
BRG<7:0>
348
SPBRGH
BRG<15:8>
348
TRISC
TRISC7
TRISC6
TXREG
TXSTA
Legend:
*
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
TX9
TXEN
SYNC
SENDB
142
337*
BRGH
TRMT
TX9D
345
= unimplemented location, read as 0. Shaded cells are not used for synchronous master transmission.
Page provides register information.
DS40001637C-page 358
PIC16(L)F1784/6/7
27.5.1.5
27.5.1.6
Slave Clock
27.5.1.7
27.5.1.8
27.5.1.9
1.
DS40001637C-page 359
PIC16(L)F1784/6/7
FIGURE 27-12:
RX/DT
pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
bit SREN
SREN bit
CREN bit 0
RCIF bit
(Interrupt)
Read
RCREG
Note:
Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
TABLE 27-8:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
SPEN
RX9
SREN
OERR
RX9D
INTCON
RCREG
RCSTA
ADDEN
340*
FERR
346
SPBRGL
BRG<7:0>
348
SPBRGH
BRG<15:8>
348
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
345
Legend:
*
= unimplemented location, read as 0. Shaded cells are not used for synchronous master reception.
Page provides register information.
DS40001637C-page 360
PIC16(L)F1784/6/7
27.5.2
SYNC = 1
CSRC = 0
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
1.
2.
3.
4.
27.5.2.1
5.
27.5.2.2
1.
2.
3.
4.
5.
6.
7.
8.
TABLE 27-9:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
346
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
Name
INTCON
TXREG
TXSTA
Legend:
*
TX9
TXEN
SYNC
SENDB
142
337*
BRGH
TRMT
TX9D
345
= unimplemented location, read as 0. Shaded cells are not used for synchronous slave transmission.
Page provides register information.
DS40001637C-page 361
PIC16(L)F1784/6/7
27.5.2.3
27.5.2.4
1.
2.
3.
4.
5.
6.
7.
8.
9.
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
APFCON1
C2OUTSEL
CC1PSEL
SDOSEL
SCKSEL
SDISEL
TXSEL
RXSEL
CCP2SEL
127
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
347
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
93
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
94
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
98
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
346
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
142
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
345
Name
INTCON
RCREG
Legend:
*
340*
= unimplemented location, read as 0. Shaded cells are not used for synchronous slave reception.
Page provides register information.
DS40001637C-page 362
PIC16(L)F1784/6/7
27.6
27.6.1
27.6.2
SYNCHRONOUS TRANSMIT
DURING SLEEP
27.6.3
DS40001637C-page 363
PIC16(L)F1784/6/7
28.0
IN-CIRCUIT SERIAL
PROGRAMMING (ICSP)
28.1
28.2
28.3
FIGURE 28-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
DS40001637C-page 364
PIC16(L)F1784/6/7
FIGURE 28-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 28-3:
Device to be
Programmed
VDD
VDD
VDD
VPP
MCLR/VPP
VSS
VSS
Data
ICSPDAT
Clock
ICSPCLK
To Normal Connections
DS40001637C-page 365
PIC16(L)F1784/6/7
29.0
Each instruction is a 14-bit word containing the operation code (opcode) and all required operands. The
opcodes are broken into three broad categories.
Byte Oriented
Bit Oriented
Literal and Control
All instruction examples use the format 0xhh to represent a hexadecimal number, where h signifies a hexadecimal digit.
29.1
TABLE 29-1:
Read-Modify-Write Operations
Field
Description
mm
TABLE 29-2:
ABBREVIATION DESCRIPTIONS
Field
Description
PC
Program Counter
TO
Time-Out bit
Carry bit
DC
Zero bit
PD
Power-Down bit
DS40001637C-page 366
PIC16(L)F1784/6/7
FIGURE 29-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
DS40001637C-page 367
PIC16(L)F1784/6/7
TABLE 29-3:
Mnemonic,
Operands
Description
Cycle
s
MS
b
LSb
Status
Affecte
d
Notes
ADDWF
ADDWF
C
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
f, d
f, d
Decrement f, Skip if 0
Increment f, Skip if 0
1(2)
1(2)
00
00
1011
1111
dfff
dfff
ffff
ffff
1, 2
1, 2
00bb
01bb
bfff
bfff
ffff
ffff
2
2
01
01
10bb
11bb
bfff
bfff
ffff
ffff
1, 2
1, 2
11
11
11
00
11
11
11
11
1110
1001
1000
0000
0001
0000
1100
1010
kkkk
kkkk
kkkk
001k
1kkk
kkkk
kkkk
kkkk
f, b
f, b
Bit Clear f
Bit Set f
1
1
01
01
BTFSC
BTFSS
f, b
f, b
1 (2)
1 (2)
LITERAL OPERATIONS
ADDLW
ANDLW
IORLW
MOVLB
MOVLP
MOVLW
SUBLW
XORLW
Note 1:
2:
k
k
k
k
k
k
k
k
1
1
1
1
1
1
1
1
kkkk C, DC, Z
kkkk
Z
kkkk
Z
kkkk
kkkk
kkkk
kkkk C, DC, Z
kkkk
Z
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.
DS40001637C-page 368
PIC16(L)F1784/6/7
TABLE 29-4:
Mnemonic,
Operands
Description
Cycle
s
MS
b
LSb
Status
Affecte
d
Notes
CONTROL OPERATIONS
BRA
BRW
CALL
CALLW
GOTO
RETFIE
RETLW
RETUR
N
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
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
0000
0010
0001
0011
0fff
INHERENT OPERATIONS
CLRWDT
NOP
OPTION
RESET
SLEEP
TRIS
ADDFS
R
MOVIW
n, k
n mm
1
1
1
1
1
1
TO, PD
TO, PD
C-COMPILER OPTIMIZED
k[n]
n mm
MOVWI
k[n]
Note 1:
2:
3:
1
1
11
00
1
1
11
00
11
2, 3
m
1111 0nkk kkkk
2
2, 3
kkkk
1nkk
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.
29.2
Instruction Descriptions
ADDFSR
Syntax:
Operands:
-32 k 31
n [ 0, 1]
Operation:
FSR(n) + k FSR(n)
Status Affected:
None
Description:
DS40001637C-page 369
PIC16(L)F1784/6/7
ADDLW
Syntax:
[ label ] ADDLW
ANDLW
Syntax:
[ label ] ANDLW
Operands:
0 k 255
Operands:
0 k 255
Operation:
(W) + k (W)
Operation:
Status Affected:
C, DC, Z
Status Affected:
Description:
Description:
ADDWF
Add W and f
ANDWF
AND W with f
Syntax:
[ label ] ADDWF
f,d
Syntax:
[ label ] ANDWF
f,d
Operands:
0 f 127
d
Operands:
0 f 127
d
Operation:
Operation:
Status Affected:
C, DC, Z
Status Affected:
Description:
Description:
ASRF
Syntax:
[ label ] ASRF
Operands:
0 f 127
d
Operation:
(f<7>) dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
f {,d}
ADDWFC
Syntax:
[ label ] ADDWFC
Operands:
0 f 127
d
Operation:
Status Affected:
C, DC, Z
Status Affected:
C, Z
Description:
Description:
f {,d}
register f
DS40001637C-page 370
PIC16(L)F1784/6/7
BCF
Bit Clear f
Syntax:
[ label ] BCF
BSF
f,b
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operands:
0 f 127
0b7
Operation:
0 (f<b>)
Operation:
1 (f<b>)
Status Affected:
None
Description:
Status Affected:
None
Description:
f,b
BTFSC
Syntax:
BRA
Relative Branch
Operands:
Syntax:
0 f 127
0b7
Operation:
skip if (f<b>) = 0
Operands:
Status Affected:
None
Description:
Operation:
(PC) + 1 + k PC
Status Affected:
None
Description:
BRW
Syntax:
[ label ] BRW
Operands:
None
Operation:
(PC) + (W) PC
Status Affected:
None
Description:
BTFSS
Syntax:
Operands:
0 f 127
0b<7
Operation:
skip if (f<b>) = 1
Status Affected:
None
Description:
DS40001637C-page 371
PIC16(L)F1784/6/7
CALL
Call Subroutine
CLRW
Clear W
Syntax:
[ label ] CALL k
Syntax:
[ label ] CLRW
Operands:
0 k 2047
Operands:
None
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<6:3>) PC<14:11>
Operation:
00h (W)
1Z
Status Affected:
Status Affected:
None
Description:
Description:
CLRWDT
Syntax:
[ label ] CLRWDT
Operands:
None
Operation:
00h WDT
0 WDT prescaler,
TO
PD
CALLW
Syntax:
[ label ] CALLW
Operands:
None
Status Affected:
TO, PD
Operation:
(PC) +1 TOS,
(W) PC<7:0>,
(PCLATH<6:0>) PC<14:8>
Description:
COMF
Complement f
Syntax:
[ label ] COMF
Operands:
0 f 127
d [0,1]
Status Affected:
None
Description:
f,d
Operation:
(f) (destination)
Status Affected:
Description:
CLRF
Clear f
Syntax:
[ label ] CLRF
Operands:
0 f 127
Operation:
00h (f)
1Z
Status Affected:
DECF
Decrement f
Description:
Syntax:
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination)
Status Affected:
Description:
Decrement register f. If d is 0,
the result is stored in the W
register. If d is 1, the result is
stored back in register f.
DS40001637C-page 372
PIC16(L)F1784/6/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 ]
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:
IORWF
Inclusive OR W with f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
Description:
GOTO k
INCF
Increment f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (destination)
Status Affected:
Description:
INCF f,d
INCFSZ f,d
IORLW k
IORWF
f,d
DS40001637C-page 373
PIC16(L)F1784/6/7
LSLF
MOVF
Move f
Syntax:
[ label ] LSLF
Syntax:
[ label ]
Operands:
0 f 127
d
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:
Description:
f {,d}
Status Affected:
C, Z
Description:
register f
Words:
Cycles:
Example:
Logical Right Shift
Syntax:
[ label ] LSRF
Operands:
0 f 127
d
Operation:
0 dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
DS40001637C-page 374
W =
Z =
f {,d}
register f
MOVF
FSR, 0
After Instruction
LSRF
MOVF f,d
PIC16(L)F1784/6/7
MOVLB
MOVIW
Move INDFn to W
Syntax:
[ label ] MOVLB k
Syntax:
Operands:
0 k 31
Operation:
k BSR
Status Affected:
None
Description:
MOVLP
Syntax:
[ label ] MOVLP k
Operands:
0 k 127
Operation:
k PCLATH
Status Affected:
None
Description:
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:
Mode
Syntax
mm
Preincrement
++FSRn
00
Predecrement
--FSRn
01
Status Affected:
None
Postincrement
FSRn++
10
Description:
Postdecrement
FSRn--
11
Description:
Words:
Cycles:
MOVLW
Move literal to W
Syntax:
[ label ]
Operands:
0 k 255
Operation:
k (W)
Example:
MOVLW k
MOVLW
0x5A
After Instruction
W
MOVWF
Move W to f
Syntax:
[ label ]
Operands:
0 f 127
0x5A
MOVWF
Operation:
(W) (f)
Status Affected:
None
Description:
Words:
Cycles:
Example:
MOVWF
OPTION_REG
Before Instruction
OPTION_REG = 0xFF
W
= 0x4F
After Instruction
OPTION_REG = 0x4F
W
= 0x4F
DS40001637C-page 375
PIC16(L)F1784/6/7
MOVWI
Move W to INDFn
NOP
No Operation
Syntax:
Syntax:
[ label ]
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
Mode
Syntax
mm
Preincrement
++FSRn
00
Predecrement
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
NOP
Operands:
None
Operation:
No operation
Status Affected:
None
Description:
No operation.
Words:
Cycles:
Example:
NOP
OPTION
Syntax:
[ label ] OPTION
Operands:
None
Operation:
(W) OPTION_REG
Status Affected:
None
Description:
RESET
Software Reset
Syntax:
[ label ] RESET
Operands:
None
Operation:
Status Affected:
None
Description:
DS40001637C-page 376
PIC16(L)F1784/6/7
RETFIE
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
None
Operation:
TOS PC,
1 GIE
Operation:
TOS PC
Status Affected:
None
Status Affected:
None
Description:
Description:
Words:
Cycles:
Example:
RETFIE
RETURN
RETURN
RETFIE
After Interrupt
PC =
GIE =
TOS
1
RETLW
Syntax:
[ label ]
Operands:
RLF
0 k 255
Syntax:
[ label ]
Operation:
k (W);
TOS PC
Operands:
0 f 127
d [0,1]
Status Affected:
None
Operation:
Description:
Status Affected:
Description:
Words:
Cycles:
Example:
TABLE
RETLW k
RLF
ADDWF
RETLW
RETLW
RETLW
Words:
Cycles:
Example:
PC
k1
k2
;W = offset
;Begin table
;
kn
; End of table
Before Instruction
W
0x07
After Instruction
W
RLF
f,d
Register f
REG1,0
Before Instruction
REG1
=
0110
C
=
After Instruction
REG1
=
0110
W
=
1100
C
=
1110
0
1110
1100
1
value of k8
DS40001637C-page 377
PIC16(L)F1784/6/7
RRF
SUBWF
Subtract W from f
Syntax:
[ label ]
Syntax:
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
Description:
Description:
RRF f,d
Register f
SLEEP
Syntax:
[ label ] SLEEP
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
Description:
SUBLW
Syntax:
[ label ] SUBLW k
Operands:
0 k 255
Operation:
k - (W) W)
Wk
C=1
Wk
DC = 0
W<3:0> k<3:0>
DC = 1
W<3:0> k<3:0>
DS40001637C-page 378
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:
Status Affected:
C, DC, Z
Description:
SWAPF
Swap Nibbles in f
Syntax:
Operands:
0 f 127
d [0,1]
Operation:
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Status Affected:
None
Description:
f {,d}
PIC16(L)F1784/6/7
TRIS
Syntax:
[ label ] TRIS f
Operands:
5f7
Operation:
Status Affected:
None
Description:
XORLW
Syntax:
[ label ] XORLW k
Operands:
0 k 255
Operation:
(W) .XOR. k W)
Status Affected:
Description:
XORWF
Exclusive OR W with f
Syntax:
[ label ] XORWF
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
Description:
f,d
DS40001637C-page 379
PIC16(L)F1784/6/7
30.0
ELECTRICAL SPECIFICATIONS
30.1
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 Section 30.4 Thermal
Considerations to calculate device specifications.
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.
DS40001637C-page 380
PIC16(L)F1784/6/7
30.2
The standard operating conditions for any device are defined as:
Operating Voltage:
Operating Temperature:
DS40001637C-page 381
PIC16(L)F1784/6/7
PIC16F1784/6/7 VOLTAGE FREQUENCY GRAPH, -40C TA +125C
FIGURE 30-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 30-6 for each Oscillator modes supported frequencies.
VDD (V)
FIGURE 30-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 30-6 for each Oscillator modes supported frequencies.
DS40001637C-page 382
PIC16(L)F1784/6/7
30.3
DC Characteristics
TABLE 30-1:
SUPPLY VOLTAGE
PIC16LF1784/6/7
PIC16F1784/6/7
Param.
No.
D001
Sym.
VDD
Characteristic
VDR
VPOR*
VPORR*
VFVR
D004*
SVDD
Max.
Units
Conditions
1.8
2.5
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
0.8
1.5
-4
-4
-5
0.05
V/ms
D002*
D003
Typ
D001
D002*
Min.
DS40001637C-page 383
PIC16(L)F1784/6/7
FIGURE 30-3:
VDD
VPOR
VPORR
SVDD
VSS
NPOR(1)
POR REARM
VSS
TVLOW(3)
Note 1:
2:
3:
DS40001637C-page 384
TPOR(2)
PIC16(L)F1784/6/7
TABLE 30-2:
PIC16LF1784/6/7
PIC16F1784/6/7
Param
No.
Device
Characteristics
LDO Regulator
D009
D010
D010
D012
D012
Note 1:
2:
3:
4:
5:
6:
Conditions
Min.
Typ
Max.
Units
Note
VDD
75
15
Sleep VREGCON<1> = 0
0.3
Sleep VREGCON<1> = 1
FOSC = 32 kHz
LP Oscillator mode (Note 4),
-40C TA +85C
20
1.8
12
24
3.0
18
63
2.3
20
74
3.0
22
79
5.0
160
650
1.8
320
1000
3.0
260
700
2.3
330
1100
3.0
380
1300
5.0
FOSC = 32 kHz
LP Oscillator mode (Note 4, 5),
-40C TA +85C
FOSC = 4 MHz
XT Oscillator mode
FOSC = 4 MHz
XT Oscillator mode (Note 5)
The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
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.
For RC oscillator configurations, current through REXT is not included. The current through the resistor can be extended
by the formula IR = VDD/2REXT (mA) with REXT in k
FVR and BOR are disabled.
0.1 F capacitor on VCAP.
8 MHz crystal oscillator with 4x PLL enabled.
DS40001637C-page 385
PIC16(L)F1784/6/7
TABLE 30-2:
PIC16LF1784/6/7
PIC16F1784/6/7
Param
No.
Device
Characteristics
D014
D014
D015
D015
D017
D017
D019
D019
D020
D020
D022
D022
Note 1:
2:
3:
4:
5:
6:
Conditions
Min.
Typ
Max.
Units
VDD
125
550
1.8
280
1100
3.0
220
650
2.3
290
1000
3.0
350
1200
5.0
2.1
6.2
mA
3.0
2.5
7.5
mA
3.6
2.1
6.5
mA
3.0
2.2
7.5
mA
5.0
130
180
1.8
150
250
3.0
150
250
2.3
170
330
3.0
220
430
5.0
0.8
2.2
mA
1.8
1.2
3.7
mA
3.0
1.0
2.3
mA
2.3
1.3
3.9
mA
3.0
1.4
4.1
mA
5.0
2.1
6.2
mA
3.0
2.5
7.5
mA
3.6
2.1
6.5
mA
3.0
2.2
7.5
mA
5.0
2.1
6.2
mA
3.0
2.5
7.5
mA
3.6
2.1
6.5
mA
3.0
2.2
7.5
mA
5.0
Note
FOSC = 4 MHz
EC Oscillator mode
Medium-Power mode
FOSC = 4 MHz
EC Oscillator mode (Note 5)
Medium-Power mode
FOSC = 32 MHz
EC Oscillator High-Power mode
FOSC = 32 MHz
EC Oscillator High-Power mode (Note 5)
FOSC = 500 kHz
MFINTOSC mode
FOSC = 500 kHz
MFINTOSC mode (Note 5)
FOSC = 16 MHz
HFINTOSC mode
FOSC = 16 MHz
HFINTOSC mode (Note 5)
FOSC = 32 MHz
HFINTOSC mode
FOSC = 32 MHz
HFINTOSC mode
FOSC = 32 MHz
HS Oscillator mode (Note 6)
FOSC = 32 MHz
HS Oscillator mode (Note 5, 6)
The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
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.
For RC oscillator configurations, current through REXT is not included. The current through the resistor can be extended
by the formula IR = VDD/2REXT (mA) with REXT in k
FVR and BOR are disabled.
0.1 F capacitor on VCAP.
8 MHz crystal oscillator with 4x PLL enabled.
DS40001637C-page 386
PIC16(L)F1784/6/7
TABLE 30-3:
PIC16LF1784/6/7
PIC16F1784/6/7
Param
No.
Device Characteristics
Min.
Typ
Max.
+85C
Conditions
Max.
+125C
Units
Note
VDD
D023
Base IPD
D023
Base IPD
D023A
Base IPD
D024
D024
D025
D025
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
10
16
18
2.3
11
18
20
3.0
12
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
17
5.0
0.5
1.8
0.8
8.5
12
3.0
1.1
10
2.3
1.3
8.5
20
3.0
1.4
10
25
5.0
D028
D028
Note 1:
2:
3:
4:
5:
SOSC Current
SOSC Current
DS40001637C-page 387
PIC16(L)F1784/6/7
TABLE 30-3:
PIC16LF1784/6/7
PIC16F1784/6/7
Param
No.
Device Characteristics
Min.
D029
D029
D030
D030
D031
D032
Note 1:
2:
3:
4:
5:
Conditions
Max.
+85C
Max.
+125C
Units
VDD
Note
(2)
0.05
0.08
10
3.0
0.3
12
2.3
0.4
13
3.0
0.5
16
5.0
250
1.8
280
3.0
230
2.3
250
3.0
5.0
1.8
350
250
650
3.0
250
650
3.0
D031
D032
Typ
350
850
5.0
250
650
1.8
300
700
3.0
280
650
2.3
300
700
3.0
310
700
5.0
DS40001637C-page 388
PIC16(L)F1784/6/7
TABLE 30-4:
I/O PORTS
Sym.
VIL
Characteristic
Min.
Typ
Max.
Units
Conditions
I/O PORT:
D034
0.8
0.15 VDD
0.2 VDD
0.3 VDD
D034A
D035
D036
D036A
VIH
0.8
0.2 VDD
0.3 VDD
I/O ports:
D040
2.0
0.25 VDD +
0.8
0.8 VDD
0.7 VDD
D040A
D041
MCLR
2.1
0.8 VDD
D043A
0.7 VDD
D043B
0.9 VDD
(Note 1)
nA
IIL
D060
I/O ports
125
1000
nA
D061
MCLR(3)
50
200
nA
25
25
100
140
200
300
0.6
VDD - 0.7
IPUR
D070*
VOL
D080
I/O ports
VOH
D090
I/O ports
Note 1:
2:
3:
4:
DS40001637C-page 389
PIC16(L)F1784/6/7
TABLE 30-4:
Sym.
Characteristic
Min.
Typ
Max.
Units
15
pF
50
pF
Conditions
D101*
D101A* CIO
D102
Charging current
200
D102A
0.0
mA
Note 1:
2:
3:
4:
DS40001637C-page 390
PIC16(L)F1784/6/7
TABLE 30-5:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
Program Memory
Programming Specifications
D110
VIHH
8.0
9.0
D111
IDDP
10
mA
2.7
VDDMAX
D112
D113
VPEW
VDDMIN
VDDMAX
D114
1.0
mA
D115
5.0
mA
E/W
(Note 3)
ED
Byte Endurance
100K
-40C to +85C
D117
VDRW
VDDMIN
VDDMAX
D118
TDEW
4.0
5.0
ms
D119
40
Year
Provided no other
specifications are violated
D120
TREF
100k
E/W
-40C to +85C
D121
EP
Cell Endurance
10K
E/W
D122
VPR
VDDMIN
VDDMAX
D123
TIW
2.5
ms
D124
40
Year
Provided no other
specifications are violated
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 12.2 Using the Data EEPROM for a more detailed discussion on data EEPROM
endurance.
3: Required only if single-supply programming is disabled.
DS40001637C-page 391
PIC16(L)F1784/6/7
30.4
Thermal Considerations
TH01
TH02
TH03
TH04
TH05
Sym.
Characteristic
Typ.
Units
JA
60
C/W
80
C/W
90
C/W
27.5
C/W
47.2
C/W
41
C/W
46
C/W
24.4
C/W
31.4
C/W
24
C/W
24
C/W
24
C/W
24.7
C/W
5.5
C/W
14.5
C/W
JC
TJMAX
PD
Conditions
20
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
3: TJ = Junction Temperature
DS40001637C-page 392
PIC16(L)F1784/6/7
30.5
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 30-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
Rev. 10-000133A
8/1/2013
Load Condition
Pin
CL
VSS
DS40001637C-page 393
PIC16(L)F1784/6/7
FIGURE 30-5:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
OSC1/CLKIN
OS02
OS04
OS04
OS03
OSC2/CLKOUT
(LP,XT,HS Modes)
OSC2/CLKOUT
(CLKOUT Mode)
TABLE 30-6:
OS01
Sym.
FOSC
Characteristic
Oscillator Frequency(1)
OS02
TOSC
Oscillator Period(1)
OS03
TCY
OS04*
TosH,
TosL
TosR,
TosF
OS05*
Min.
Typ
Max.
Units
Conditions
DC
0.5
MHz
DC
MHz
DC
20
MHz
32.768
kHz
LP Oscillator mode
0.1
MHz
XT Oscillator mode
MHz
HS Oscillator mode
20
MHz
DC
MHz
27
LP Oscillator mode
250
ns
XT Oscillator mode
50
ns
HS Oscillator mode
50
ns
EC Oscillator mode
30.5
LP Oscillator mode
250
10,000
ns
XT Oscillator mode
50
1,000
ns
HS Oscillator mode
250
ns
RC Oscillator mode
200
TCY
DC
ns
TCY = 4/FOSC
LP oscillator
100
ns
XT oscillator
20
ns
HS oscillator
ns
LP oscillator
ns
XT oscillator
ns
HS oscillator
DS40001637C-page 394
PIC16(L)F1784/6/7
TABLE 30-7:
OSCILLATOR PARAMETERS
OS08
Sym.
HFOSC
OS08A MFOSC
Characteristic
OS09
LFOSC
OS10*
TIOSC ST HFINTOSC
Wake-up from Sleep Start-up Time
MFINTOSC
Wake-up from Sleep Start-up Time
Freq.
Tolerance
Min.
Typ
Max.
Units
2%
3%
16.0
16.0
MHz
MHz
5%
16.0
MHz
-40C TA +125C
2%
3%
500
500
kHz
kHz
5%
500
kHz
-40C TA +125C
31
kHz
-40C TA +125C
3.2
VREGPM = 0
24
35
VREGPM = 0
Conditions
FIGURE 30-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)
DS40001637C-page 395
PIC16(L)F1784/6/7
TABLE 30-8:
Sym.
Characteristic
Min.
F10
F11
FSYS
F12
TRC
F13*
CLK
Typ
Max.
Units
MHz
16
32
MHz
ms
-0.25%
+0.25%
Conditions
FIGURE 30-7:
Cycle
Write
Fetch
Q1
Q4
Read
Execute
Q2
Q3
FOSC
OS12
OS11
OS20
OS21
CLKOUT
OS19
OS16
OS13
OS18
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
DS40001637C-page 396
PIC16(L)F1784/6/7
TABLE 30-9:
Sym.
Characteristic
OS11
TosH2ckL
OS12
(1)
OS13
TckL2ioV
OS14
OS15
OS16
TioV2ckH
TosH2ioV
TosH2ioI
OS17
TioV2osH
OS18* TioR
OS19* TioF
OS20* Tinp
OS21* Tioc
(1)
Min.
Typ
Max.
Units
Conditions
70
ns
VDD = 3.3-5.0V
72
ns
VDD = 3.3-5.0V
20
ns
TOSC + 200 ns
50
50
70*
ns
ns
ns
20
ns
25
25
40
15
28
15
72
32
55
30
ns
ns
VDD = 3.3-5.0V
VDD = 3.3-5.0V
VDD = 1.8V
VDD = 3.3-5.0V
VDD = 1.8V
VDD = 3.3-5.0V
ns
ns
DS40001637C-page 397
PIC16(L)F1784/6/7
FIGURE 30-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.
FIGURE 30-9:
VDD
VBOR and VHYST
VBOR
37
TPWRT
Reset
(due to BOR)
33(1)
Note 1: The delay, (TPWRT) releasing Reset, only occurs when the Power-up Timer is enabled, (PWRTE = 0).
DS40001637C-page 398
PIC16(L)F1784/6/7
TABLE 30-10: 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
2
5
s
s
10
16
27
ms
VDD = 3.3V-5V
1:16 Prescaler used
30
TMCL
31
32
TOST
1024
33*
TPWRT
40
65
140
ms
34*
TIOZ
2.0
35
VBOR
2.55
2.30
1.80
2.70
2.45
1.90
2.85
2.6
2.10
V
V
V
BORV = 0
BORV=1 (F device)
BORV=1 (LF device)
1.8
2.1
2.5
LPBOR = 1
25
75
mV
-40C to +85C
35
VDD VBOR
35A
36*
VHYST
37*
Note 1:
2:
3:
4:
Tosc (Note 3)
DS40001637C-page 399
PIC16(L)F1784/6/7
FIGURE 30-10:
T0CKI
40
41
42
T1CKI
45
46
49
47
TMR0 or
TMR1
40*
Sym.
TT0H
Characteristic
Min.
No Prescaler
With Prescaler
TT0L
41*
No Prescaler
With Prescaler
42*
TT0P
T0CKI Period
45*
TT1H
TT1L
46*
T1CKI Low
Time
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
30
ns
Synchronous, No Prescaler
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
Greater of:
30 or TCY + 40
N
ns
47*
TT1P
48
FT1
49*
Asynchronous
Typ
60
ns
32.4
32.768
33.1
kHz
2 TOSC
7 TOSC
Conditions
N = prescale value
(2, 4, ..., 256)
N = prescale value
(1, 2, 4, 8)
Timers in Sync
mode
DS40001637C-page 400
PIC16(L)F1784/6/7
FIGURE 30-11:
CCPx
(Capture mode)
CC01
CC02
CC03
Note:
CC01* TccL
Characteristic
No Prescaler
With Prescaler
CC02* TccH
No Prescaler
With Prescaler
CC03* TccP
*
Min.
Typ
Max.
Units
0.5TCY + 20
ns
20
ns
0.5TCY + 20
ns
20
ns
3TCY + 40
N
ns
Conditions
DS40001637C-page 401
PIC16(L)F1784/6/7
TABLE 30-13:
Operating Conditions
VDD = 3V, Temp. = 25C, Single-ended 2 s TAD, VREF+ = 3V, VREF- = VSS
Param
Sym.
No.
Characteristic
Min.
Typ
Max.
Units
Conditions
AD01
NR
Resolution
10
bit
AD02
EIL
Integral Error
1.6
LSb
AD03
EDL
Differential Error
1.4
AD04
3.5
LSb
AD05
EGN
LSb
AD06
1.8
VDD
AD07
VAIN
Full-Scale Range
VREF
AD08
ZAIN
Recommended Impedance of
Analog Voltage Source
10
Gain Error
AD09
NR
Resolution
12
bit
AD10
EIL
Integral Error
LSb
AD11
EDL
Differential Error
AD12
AD13
EGN
AD14
AD15
VAIN
Full-Scale Range
AD16
ZAIN
Recommended Impedance of
Analog Voltage Source
Note 1:
2:
3:
4:
Gain Error
LSb
LSb
LSb
1.8
VDD
VREF
10
Sym.
AD130* TAD
AD131
TCNV
AD132* TACQ
Characteristic
Min.
Typ
Max.
Units
Conditions
1.0
9.0
TOSC-based
1.0
2.5
6.0
15 (12-bit)
13 (10-bit)
TAD
Acquisition Time
5.0
DS40001637C-page 402
PIC16(L)F1784/6/7
FIGURE 30-12:
BSF ADCON0, GO
AD134
1 Tcy
(TOSC/2(1))
AD131
Q4
AD130
ADC CLK
7
ADC Data
0
NEW_DATA
OLD_DATA
ADRES
1 Tcy
ADIF
GO
Sample
DONE
Sampling Stopped
AD132
Note 1: If the ADC clock source is selected as RC, a time of TCY is added before the ADC clock starts. This
allows the SLEEP instruction to be executed.
FIGURE 30-13:
BSF ADCON0, GO
AD134
(TOSC/2 + TCY(1))
1 Tcy
AD131
Q4
AD130
ADC CLK
7
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 RC, a time of TCY is added before the ADC clock starts. This
allows the SLEEP instruction to be executed.
DS40001637C-page 403
PIC16(L)F1784/6/7
TABLE 30-15: OPERATIONAL AMPLIFIER (OPA)
Standard Operating Conditions (unless otherwise stated):
VDD = 3.0 Temperature 25C, High-Power Mode
DC CHARACTERISTICS
Param
No.
Symbol
OPA01*
GBWP
Parameters
Min.
Typ.
Max.
Units
3.5
MHz
OPA02*
TON
Turn on Time
10
OPA03*
PM
Phase Margin
60
degrees
OPA04*
SR
Slew Rate
V/s
OPA05
OFF
Offset
mV
OPA06
CMRR
55
70
dB
OPA07*
AOL
90
dB
OPA08
VICM
VDD
OPA09*
PSRR
80
dB
Conditions
High-Power mode
Sym.
Characteristics
Typ.
Max.
Units
2.5
mV
Comments
CM01
VIOFF
CM02
VICM
VDD
CM03
CMRR
40
50
dB
CM04A
60
125
ns
Normal-Power mode
measured at VDD/2 (Note 1)
CM04B
60
110
ns
Normal-Power mode
measured at VDD/2 (Note 1)
85
ns
85
ns
10
20
45
75
mV
CM04C
TRESP
CM04D
Min.
Normal-Power mode
VICM = VDD/2
CM05
Tmc2ov
CM06
*
Note 1:
2:
DS40001637C-page 404
PIC16(L)F1784/6/7
TABLE 30-17: DIGITAL-TO-ANALOG CONVERTER (DAC) SPECIFICATIONS
Operating Conditions: VDD = 3V, Temperature = 25C (unless otherwise stated).
Param
No.
Sym.
Characteristics
Min.
Typ.
Max.
Units
DAC01*
CLSB
Step Size
VDD/256
DAC02*
CACC
Absolute Accuracy
1.5
LSb
DAC03*
CR
600
DAC04*
CST
Settling Time(1)
10
*
Note 1:
Comments
FIGURE 30-14:
CK
US121
US121
DT
US122
US120
Note:
Symbol
Characteristic
Min.
Max.
Units
3.0-5.5V
80
ns
1.8-5.5V
100
ns
US121 TCKRF
3.0-5.5V
45
ns
1.8-5.5V
50
ns
3.0-5.5V
45
ns
1.8-5.5V
50
ns
US122 TDTRF
FIGURE 30-15:
Conditions
US125
DT
US126
Note: Refer to Figure 30-4 for load conditions.
DS40001637C-page 405
PIC16(L)F1784/6/7
TABLE 30-19: EUSART SYNCHRONOUS RECEIVE REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Symbol
Characteristic
DS40001637C-page 406
Min.
Max.
Units
10
ns
15
ns
Conditions
PIC16(L)F1784/6/7
FIGURE 30-16:
SS
SP70
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 30-4 for load conditions.
FIGURE 30-17:
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 30-4 for load conditions.
DS40001637C-page 407
PIC16(L)F1784/6/7
FIGURE 30-18:
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 30-4 for load conditions.
FIGURE 30-19:
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 30-4 for load conditions.
DS40001637C-page 408
PIC16(L)F1784/6/7
TABLE 30-20: SPI MODE REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param
No.
Symbol
Characteristic
Min.
Typ
2.25*TCY
ns
SP71* TSCH
TCY + 20
ns
SP72* TSCL
TCY + 20
ns
100
ns
100
ns
3.0-5.5V
10
25
ns
1.8-5.5V
25
50
ns
SP75* TDOR
SP76* TDOF
10
25
ns
SP77* TSSH2DOZ
10
50
ns
SP78* TSCR
3.0-5.5V
10
25
ns
1.8-5.5V
25
50
ns
10
25
ns
50
ns
SP79* TSCF
3.0-5.5V
1.8-5.5V
145
ns
Tcy
ns
50
ns
1.5TCY + 40
ns
FIGURE 30-20:
SCL
SP93
SP91
SP90
SP92
SDA
Start
Condition
Stop
Condition
DS40001637C-page 409
PIC16(L)F1784/6/7
TABLE 30-21: I2C BUS START/STOP BITS REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param
No.
Symbol
SP90*
TSU:STA
SP91*
THD:STA
TSU:STO
SP92*
Characteristic
Max. Units
4700
Setup time
600
Start condition
4000
Hold time
600
Stop condition
4700
Setup time
600
4000
600
Hold time
*
Typ
Start condition
SP93
Min.
Conditions
ns
ns
ns
ns
FIGURE 30-21:
SCL
SP100
SP90
SP102
SP101
SP106
SP107
SP91
SDA
In
SP92
SP110
SP109
SP109
SDA
Out
Note: Refer to Figure 30-4 for load conditions.
DS40001637C-page 410
PIC16(L)F1784/6/7
TABLE 30-22: I2C BUS DATA REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Symbol
SP100* THIGH
Characteristic
Min.
Max.
Units
4.0
0.6
SSP module
SP101* TLOW
1.5TCY
4.7
1.3
1.5TCY
SSP module
SP102* TR
SP103* TF
SP106* THD:DAT
1000
ns
20 + 0.1CB
300
ns
250
ns
20 + 0.1CB
250
ns
ns
0.9
ns
SP107* TSU:DAT
250
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)
DS40001637C-page 411
PIC16(L)F1784/6/7
31.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 F 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.
DS40001637C-page 412
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
35
14
12
30
25
10
IDD (A)
Typical
IDD (A)
Max.
Max: 85C + 3
Typical: 25C
Max.
Max: 85C + 3
Typical: 25C
Typical
20
15
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
VDD (V)
4.0
4.5
5.0
6.0
5.5
VDD (V)
FIGURE 31-1:
IDD, LP Oscillator Mode,
Fosc = 32 kHz, PIC16LF1784/6/7 Only.
FIGURE 31-2:
IDD, LP Oscillator Mode,
Fosc = 32 kHz, PIC16F1784/6/7 Only.
500
400
450
Typical: 25C
350
4 MHz XT
Max: 85C + 3
400
4 MHz XT
300
350
IDD (A)
IDD (A)
4 MHz EXTRC
4 MHz EXTRC
250
200
300
250
1 MHz XT
200
150
1 MHz XT
150
100
100
50
1 MHz EXTRC
1 MHz EXTRC
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
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)
VDD (V)
FIGURE 31-3:
IDD Typical, XT and EXTRC
Oscillator, PIC16LF1784/6/7 Only.
FIGURE 31-4:
IDD Maximum, XT and
EXTRC Oscillator, PIC16LF1784/6/7 Only.
600
450
4 MHz XT
4 MHz XT
Max: 85C + 3
Typical: 25C
400
500
4 MHz EXTRC
350
400
250
IDD (A)
IDD (A)
300
1 MHz XT
200
150
4 MHz EXTRC
1 MHz XT
300
200
1 MHz EXTRC
1 MHz EXTRC
100
100
50
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-5:
IDD Typical, XT and EXTRC
Oscillator, PIC16F1784/6/7 Only.
DS40001637C-page 413
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-6:
IDD Maximum, XT and
EXTRC Oscillator, PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
9
30
Max.
Max: 85C + 3
Typical: 25C
Max: 85C + 3
Typical: 25C
25
Max.
Typical
Typical
20
IDD (A)
IDD (A)
6
5
15
4
3
10
2
5
1
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
2.0
2.5
3.0
3.5
VDD (V)
FIGURE 31-7:
IDD, EC Oscillator LP Mode,
Fosc = 32 kHz, PIC16LF1784/6/7 Only.
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-8:
IDD, EC Oscillator LP Mode,
Fosc = 32 kHz, PIC16F1784/6/7 Only.
,
70
60
Max.
Max: 85C + 3
Typical: 25C
60
Max: 85C + 3
Typical: 25C
50
Max.
50
IDD (A)
IDD (A)
40
Typical
30
Typical
40
30
20
20
10
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
6.0
5.5
VDD (V)
VDD (V)
FIGURE 31-9:
IDD, EC Oscillator LP Mode,
Fosc = 500 kHz, PIC16LF1784/6/7 Only.
FIGURE 31-10:
IDD, EC Oscillator LP Mode,
Fosc = 500 kHz, PIC16F1784/6/7 Only.
350
400
300
350
4 MHz
Typical: 25C
4 MHz
Max: 85C + 3
300
250
IDD (A)
IDD (A)
250
200
150
200
150
100
1 MHz
1 MHz
100
50
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 31-11:
IDD Typical, EC Oscillator
MP Mode, PIC16LF1784/6/7 Only.
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 31-12:
IDD Maximum, EC Oscillator
MP Mode, PIC16LF1784/6/7 Only.
DS40001637C-page 414
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
450
400
400
350
Max: 85C + 3
Typical: 25C
4 MHz
4 MHz
350
300
IDD (A)
IDD (A)
300
250
200
250
1 MHz
200
1 MHz
150
150
100
100
50
50
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
2.0
2.5
3.0
3.5
4.0
FIGURE 31-13:
IDD Typical, EC Oscillator
MP Mode, PIC16F1784/6/7 Only.
yp
4.5
5.0
5.5
6.0
VDD (V)
VDD (V)
FIGURE 31-14:
IDD Maximum, EC Oscillator
MP Mode, PIC16F1784/6/7 Only.
g
3.5
3.0
Typical: 25C
Max: 85C + 3
3.0
2.5
32 MHz
32 MHz
2.5
IDD (mA)
IDD (mA)
2.0
1.5
16 MHz
2.0
1.5
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
1.6
3.8
1.8
2.0
2.2
2.4
2.6
FIGURE 31-15:
IDD Typical, EC Oscillator
HP Mode, PIC16LF1784/6/7 Only.
yp
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
VDD (V)
FIGURE 31-16:
IDD Maximum, EC Oscillator
HP Mode, PIC16LF1784/6/7 Only.
g
3.0
2.5
32 MHz
Max: 85C + 3
Typical: 25C
32 MHz
2.5
2.0
IDD (mA)
IDD (mA)
2.0
1.5
16 MHz
1.5
16 MHz
1.0
1.0
8 MHz
0.5
8 MHz
0.5
0.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-17:
IDD Typical, EC Oscillator
HP Mode, PIC16F1784/6/7 Only.
DS40001637C-page 415
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-18:
IDD Maximum, EC Oscillator
HP Mode, PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
9
30
Max.
Max.
Max: 85C + 3
Typical: 25C
25
7
Typical
Typical
20
IDD (A)
IDD (A)
6
5
15
4
3
10
2
Max: 85C + 3
Typical: 25C
5
1
0
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 31-19:
IDD, LFINTOSC Mode,
Fosc = 31 kHz, PIC16LF1784/6/7 Only.
FIGURE 31-20:
IDD, LFINTOSC Mode,
Fosc = 31 kHz, PIC16F1784/6/7 Only.
700
600
550
Max.
Max: 85C + 3
Typical: 25C
500
Max.
Max: 85C + 3
Typical: 25C
600
Typical
450
500
IDD (A)
IDD (A)
400
350
Typical
400
300
300
250
200
200
150
100
100
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
VDD (V)
FIGURE 31-21:
IDD, MFINTOSC Mode,
Fosc = 500 kHz, PIC16LF1784/6/7 Only.
4.5
5.0
5.5
6.0
FIGURE 31-22:
IDD, MFINTOSC Mode,
Fosc = 500 kHz, PIC16F1784/6/7 Only.
1.8
1.8
16 MHz
1.6
1.6
16 MHz
Typical: 25C
Max: 85C + 3
1.4
1.4
1.2
1.2
8 MHz
IDD (mA)
IDD (mA)
4.0
VDD (V)
1.0
0.8
4 MHz
2 MHz
0.6
0.4
8 MHz
1.0
4 MHz
0.8
2 MHz
0.6
1 MHz
0.4
1 MHz
0.2
0.2
0.0
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 31-23:
IDD Typical, HFINTOSC
Mode, PIC16LF1784/6/7 Only.
3.8
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 31-24:
IDD Maximum, HFINTOSC
Mode, PIC16LF1784/6/7 Only.
DS40001637C-page 416
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
1.6
1.8
16 MHz
1.4
1.6
Typical: 25C
1.2
8 MHz
1.0
1.2
8 MHz
IDD (mA)
IDD (mA)
16 MHz
Max: 85C + 3
1.4
4 MHz
0.8
2 MHz
0.6
1.0
4 MHz
0.8
2 MHz
0.6
1 MHz
0.4
1 MHz
0.4
0.2
0.2
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
0.0
6.0
2.0
2.5
3.0
3.5
4.0
VDD (V)
FIGURE 31-25:
IDD Typical, HFINTOSC
Mode, PIC16F1784/6/7 Only.
yp
5.0
5.5
6.0
FIGURE 31-26:
IDD Maximum, HFINTOSC
Mode, PIC16F1784/6/7 Only.
,
2.0
2.0
1.8
1.6
1.6
1.4
1.4
16 MHz
1.2
IDD (mA)
16 MHz
1.0
8 MHz
0.8
20 MHz
Max: 85C + 3
1.8
20 MHz
1.2
IDD (mA)
4.5
VDD (V)
1.0
8 MHz
0.8
0.6
0.6
0.4
0.4
4 MHz
4 MHz
0.2
0.2
0.0
0.0
2.4
2.6
2.8
3.0
3.2
3.4
3.6
2.4
3.8
2.6
2.8
3.0
3.2
3.4
3.6
FIGURE 31-27:
IDD Typical, HS Oscillator,
25C, PIC16LF1784/6/7 Only.
FIGURE 31-28:
IDD Maximum, HS Oscillator,
PIC16LF1784/6/7 Only.
2.1
2.0
20 MHz
Max: 85C + 3
1.8
20 MHz
1.8
1.6
16 MHz
16 MHz
1.4
1.5
IDD (mA)
1.2
IDD (mA)
3.8
VDD (V)
VDD (V)
1.0
8 MHz
0.8
1.2
8 MHz
0.9
4 MHz
0.6
0.6
0.4
4 MHz
0.3
0.2
0.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-29:
IDD Typical, HS Oscillator,
25C, PIC16F1784/6/7 Only.
DS40001637C-page 417
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-30:
IDD Maximum, HS Oscillator,
PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
4.0
4.0
Max.
3.5
3.5
3.0
3.0
2.5
2.5
IDD (mA)
IDD (mA)
Max.
2.0
Typical
1.5
1.0
2.0
Typical
1.5
1.0
Typical: 25C
Max: 85C + 3
0.5
Typical: 25C
Max: 85C + 3
0.5
0.0
0.0
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
2.0
2.5
3.0
3.5
VDD (V)
FIGURE 31-31:
IDD, HS Oscillator, 32 MHz
(8 MHz + 4x PLL), PIC16LF1784/6/7 Only.
4.5
5.0
5.5
6.0
FIGURE 31-32:
IDD, HS Oscillator, 32 MHz
(8 MHz + 4x PLL), PIC16F1784/6/7 Only.
450
1.2
400
Max.
Max.
1.0
350
300
0.8
IPD (A)
IPD (nA)
4.0
VDD (V)
250
Max: 85C + 3
Typical: 25C
200
150
Max: 85C + 3
Typical: 25C
0.6
0.4
Typical
100
0.2
Typical
50
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
2.0
2.5
3.0
3.5
FIGURE 31-33:
IPD Base, LP Sleep Mode,
PIC16LF1784/6/7 Only.
4.5
5.0
5.5
6.0
FIGURE 31-34:
IPD Base, LP Sleep Mode
(VREGPM = 1), PIC16F1784/6/7 Only.
2.5
3.0
Max: 85C + 3
Typical: 25C
2.5
Max: 85C + 3
Typical: 25C
2.0
Max.
Max.
IPD (A)
2.0
IPD (A)
4.0
VDD (V)
VDD (V)
1.5
1.5
1.0
1.0
Typical
Typical
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 31-35:
IPD, Watchdog Timer (WDT),
PIC16LF1784/6/7 Only.
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-36:
IPD, Watchdog Timer (WDT),
PIC16F1784/6/7 Only.
DS40001637C-page 418
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
p ,
35
35
Max: 85C + 3
Typical: 25C
Max.
30
30
Max.
25
Typical
IPD (nA)
IPD (nA)
25
20
20
15
Typical
15
10
10
Max: 85C + 3
Typical: 25C
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
2.0
2.5
3.0
3.5
4.0
VDD (V)
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-37:
IPD, Fixed Voltage Reference
(FVR), PIC16LF1784/6/7 Only.
FIGURE 31-38:
IPD, Fixed Voltage Reference
(FVR), PIC16F1784/6/7 Only.
p ,
p ,
),
),
13
11
Max: 85C + 3
Typical: 25C
10
Max: 85C + 3
Typical: 25C
12
Max.
Max.
11
10
Typical
IPD (nA)
IPD (nA)
Typical
8
7
6
6
5
5
4
4
2.9
3.0
3.1
3.2
3.3
3.4
3.5
3.6
2.8
3.7
3.0
3.2
3.4
3.6
3.8
4.0
FIGURE 31-39:
IPD, Brown-Out Reset
(BOR), BORV = 1, PIC16LF1784/6/7 Only.
4.4
4.6
4.8
5.0
5.2
5.4
5.6
FIGURE 31-40:
IPD, Brown-Out Reset
(BOR), BORV = 1, PIC16F1784/6/7 Only.
1.8
Max.
1.6
Max: 85C + 3
Typical: 25C
1.6
1.4
Max.
1.4
1.2
1.2
Max: 85C + 3
Typical: 25C
1.0
IPD (A)
IPD (nA)
4.2
VDD (V)
VDD (V)
0.8
0.6
1.0
0.8
0.6
Typical
Typical
0.4
0.4
0.2
0.2
0.0
2.9
3.0
3.1
3.2
3.3
3.4
3.5
3.6
FIGURE 31-41:
IPD, LP Brown-Out Reset
(LPBOR = 0), PIC16LF1784/6/7 Only.
DS40001637C-page 419
3.7
0.0
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
FIGURE 31-42:
IPD, LP Brown-Out Reset
(LPBOR = 0), PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
p ,
p ,
12
Max: 85C + 3
Typical: 25C
Max: 85C + 3
Typical: 25C
10
Max.
Max.
IPD (A)
IPD (A)
3
Typical
6
Typical
4
2
2
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
2.0
2.5
3.0
3.5
4.0
VDD (V)
FIGURE 31-43:
IPD, Timer1 Oscillator,
FOSC = 32 kHz, PIC16LF1784/6/7 Only.
p ,
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-44:
IPD, Timer1 Oscillator,
FOSC = 32 kHz, PIC16F1784/6/7 Only.
p ,
700
900
Max: 85C + 3
Typical: 25C
600
Max: 85C + 3
Typical: 25C
800
Max.
700
Max.
500
IPD (A)
IPD (A)
600
400
Typical
300
500
Typical
400
300
200
200
100
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
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 31-45:
IPD, Op Amp, High GBWP
Mode (OPAxSP = 1), PIC16LF1784/6/7 Only.
FIGURE 31-46:
IPD, Op Amp, High GBWP
Mode (OPAxSP = 1), PIC16F1784/6/7 Only.
500
1.4
Max: 85C + 3
Typical: 25C
450
Max: 85C + 3
Typical: 25C
Max.
400
1.2
Max.
350
1.0
IPD (A)
IPD (A)
300
250
200
0.8
0.6
150
0.4
Typical
100
Typical
0.2
50
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 31-47:
IPD, ADC Non-Converting,
PIC16LF1784/6/7 Only.
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-48:
IPD, ADC Non-Converting,
PIC16F1784/6/7 Only.
DS40001637C-page 420
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
800
800
Max: -40C + 3
Typical: 25C
700
Max: -40C + 3
Typical: 25C
Max.
600
600
Typical
IPD (A)
IPD (A)
Max.
700
500
Typical
500
400
400
300
300
200
200
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
VDD (V)
FIGURE 31-49:
IPD, Comparator, NP Mode
(CxSP = 1), PIC16LF1784/6/7 Only.
FIGURE 31-50:
IPD, Comparator, NP Mode
(CxSP = 1), PIC16F1784/6/7 Only.
5
Max: -40C max + 3
Typical;:statistical mean @ 25C
Min: +125C min - 3
5
4
3
VOL (V)
VOH (V)
3
Max.
Typical
Min.
Min.
Typical
Max.
50
60
0
-30
-25
-20
-15
-10
-5
10
20
30
IOH (mA)
FIGURE 31-51:
VOH vs. IOH Over
Temperature, VDD = 5.0V, PIC16F1784/6/7 Only.
40
IOL (mA)
70
80
FIGURE 31-52:
VOL vs. IOL Over
Temperature, VDD = 5.0V, PIC16F1784/6/7 Only.
3.0
3.5
Max: -40C max + 3
Typical: statistical mean @ 25C
Min: +125C min - 3
3.0
2.5
2.5
VOL (V)
VOH (V)
2.0
2.0
Max.
Typical
Min.
1.5
1.5
Max.
Typical
Min.
1.0
1.0
0.5
0.5
0.0
0.0
-14
-12
-10
-8
-6
-4
IOH (mA)
FIGURE 31-53:
VOH vs. IOH Over
Temperature, VDD = 3.0V.
DS40001637C-page 421
-2
10
15
20
25
30
IOL (mA)
FIGURE 31-54:
VOL vs. IOL Over
Temperature, VDD = 3.0V.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
Voh vs. Ioh over Temperature, Vdd = 1.8V
2.0
1.8
Max: -40C max + 3
Typical: statistical mean @ 25C
Min: +125C min - 3
1.8
1.6
1.6
1.4
1.4
1.2
VOL (V)
VOH (V)
1.2
1.0
Min.
Typical
Max.
1
Min.
Typical
Max.
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0.0
0
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
FIGURE 31-55:
VOH vs. IOH Over
Temperature, VDD = 1.8V, PIC16LF1784/6/7
Only.
10
FIGURE 31-56:
VOL vs. IOL Over
Temperature, VDD = 1.8V, PIC16LF1784/6/7
Only.
q
LFINTOSC Frequency
40
38
40
Max.
36
Frequency (kHz)
34
34
Frequency (kHz)
Max.
36
38
Typical
32
30
Min.
28
26
Typical
32
30
Min.
28
26
24
22
24
22
20
1.5
1.8
2.1
2.4
2.7
3.0
3.3
3.6
20
VDD (V)
2.5
3.5
4.5
5.5
VDD (V)
FIGURE 31-57:
LFINTOSC Frequency,
PIC16LF1784/6/7 Only.
FIGURE 31-58:
LFINTOSC Frequency,
PIC16F1784/6/7 Only.
24
24
22
22
Max.
Max.
20
18
Time (mS)
Time (mS)
20
Typical
16
18
Typical
16
Min.
14
14
Min.
12
12
10
10
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 31-59:
WDT Time-Out Period,
PIC16F1784/6/7 Only.
6.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 31-60:
WDT Time-Out Period,
PIC16LF1784/6/7 Only.
DS40001637C-page 422
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
g
70
2.00
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
60
Max.
1.95
Max.
50
Voltage (mV)
Voltage (V)
Typical
1.90
Min.
40
30
Typical
20
1.85
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
Min.
10
1.80
-60
-40
-20
20
40
60
80
100
120
-60
140
-40
-20
Temperature (C)
40
60
80
100
120
140
Temperature (C)
FIGURE 31-61:
Brown-Out Reset Voltage,
Low Trip Point (BORV = 1), PIC16LF1784/6/7
Only.
g ,
20
FIGURE 31-62:
Brown-Out Reset Hysteresis,
Low Trip Point (BORV = 1), PIC16LF1784/6/7
Only.
)
70
2.60
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
60
2.55
Max.
Max.
Typical
50
Voltage (mV)
Voltage (V)
2.50
Min.
2.45
2.40
40
Typical
30
20
Min.
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
2.35
10
2.30
-60
-40
-20
20
40
60
80
100
120
-60
140
-40
-20
FIGURE 31-63:
Brown-Out Reset Voltage,
Low Trip Point (BORV = 1), PIC16F1784/6/7
Only.
40
60
80
100
120
140
FIGURE 31-64:
Brown-Out Reset Hysteresis,
Low Trip Point (BORV = 1), PIC16F1784/6/7 Only.
2.85
80
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
2.80
Max.
60
Voltage (mV)
2.75
Typical
Min.
2.70
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
70
Max.
Voltage (V)
20
Temperature (C)
Temperature (C)
50
Typical
40
30
20
2.65
Min.
10
2.60
0
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-65:
Brown-Out Reset Voltage,
High Trip Point (BORV = 0).
DS40001637C-page 423
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-66:
Brown-Out Reset Hysteresis,
High Trip Point (BORV = 0).
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
y
2.6
50
Max.
45
2.5
Max.
40
2.4
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
35
Voltage (mV)
Voltage (V)
2.3
2.2
Typical
2.1
Max: Typical + 3
Typical: Statistical Mean
30
25
20
Typical
2.0
15
1.9
10
Min.
1.8
1.7
0
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
20
Temperature (C)
FIGURE 31-67:
40
60
80
100
120
140
Temperature (C)
FIGURE 31-68:
110
100
Max: Typical + 3 (-40C to +125C)
Typical; statistical mean @ 25C
Min: Typical - 3 (-40C to +125C)
90
100
Max.
90
Max.
Time (mS)
Time (mS)
80
Typical
70
80
Typical
70
Min.
60
60
50
Min.
50
40
40
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
FIGURE 31-69:
PWRT Period,
PIC16F1784/6/7 Only.
3.2
3.4
3.6
3.8
FIGURE 31-70:
PWRT Period,
PIC16LF1784/6/7 Only.
g ,
1.58
1.58
1.70
1.68
Max: Typical + 3
Typical: 25C
Max. Min: Typical - 3
1.56
1.56
Max.
1.66
1.54
1.54
1.64
Voltage
Voltage
(V)(V)
Typical
Voltage (V)
3.0
VDD (V)
VDD (V)
1.62
1.60
Min.
1.58
Typical
1.52
1.52
1.50
1.5
Min.
1.56
1.48
1.48
1.54
Max: Typical + 3
Typical: Statistical Mean
1.46
1.46
-40 Min: Typical
-20 - 3 0
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
1.52
-60
-40
-20
20
40
60
80
100
120
Temperature (C)
FIGURE 31-71:
140
20
40
60
80
100
120
Temperature (C)
1.44
1.50
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-72:
POR Rearm Voltage,
NP Mode (VREGPM = 0), PIC16F1784/6/7 Only.
DS40001637C-page 424
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
g ,
1.4
12
1.3
10
Max.
1.2
Time (s)
Voltage (V)
8
1.1
Typical
1.0
Max.
6
Typical
0.9
4
Min.
0.8
Max: Typical + 3
Typical: Statistical Mean
Min: Typical - 3
0.7
0.6
0
-60
-40
-20
20
40
60
80
100
120
140
1.5
2.0
2.5
3.0
3.5
Temperature (C)
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 31-73:
POR Rearm Voltage,
NP Mode, PIC16LF1784/6/7 Only.
FIGURE 31-74:
VREGPM = 0.
50
40
45
Max: Typical + 3
Typical: statistical mean @ 25C
35
40
Max.
Max.
35
Time (s)
Time (s)
30
30
Typical
25
Typical
25
20
20
15
10
Note:
The FVR Stabilization Period applies when:
1) coming out of Reset or exiting Sleep mode for PIC12/16LFxxxx devices.
2) when exiting Sleep mode with VREGPM = 1 for PIC12/16Fxxxx devices
In all other cases, the FVR is stable when released from Reset.
15
10
1.5
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
FIGURE 31-75:
VREGPM = 1.
FIGURE 31-76:
1.0
1.0
0.5
0.5
DNL (LSb)
DNL (LSb)
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (mV)
VDD (V)
0.0
-0.5
0.0
-0.5
-1.0
-1.0
0
128
256
384
512
640
768
896
1024
Output Code
FIGURE 31-77:
ADC 10-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 1 S, 25C.
DS40001637C-page 425
128
256
384
512
640
768
896
1024
Output Code
FIGURE 31-78:
ADC 10-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 4 S, 25C.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
g
1.0
2.0
1.0
1.5
1.0
0.5
DNL
(LSb)
INL
(LSb)
INL (LSb)
0.5
0.0
0.5
0.0
0.0
-0.5
-1.0
-1.5
-0.5
-0.5
-2.0
0
512
1024
1536
2048
2560
3072
3584
4096
640
768
896
1024
Output Code
-1.0
-1.0
0
128
256
384
512
640
768
1024
896
128
256
384
FIGURE 31-79:
ADC 10-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 1 S, 25C.
512
Output Code
Output Code
FIGURE 31-80:
ADC 10-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 4 S, 25C.
2.5
2.0
2.0
1.5
1.5
0.5
Max 125C
1.0
Max -40C
Max 25C
0.5
0.0
-0.5
-1.0
INL (LSb)
DNL (LSb)
1.0
0.0
Min 25C
Min 25C
Min 125C
-0.5
Min -40C
-1.0
Min 125C
Min -40C
-1.5
-1.5
-2.0
-2.0
-2.5
0.5
1.0
2.0
TAD (s)
4.0
0.5
8.0
FIGURE 31-81:
ADC 10-bit Mode,
Single-Ended DNL, VDD = 3.0V, VREF = 3.0V.
1.0
2.0
TAD (s)
4.0
8.0
FIGURE 31-82:
ADC 10-bit Mode,
Single-Ended INL, VDD = 3.0V, VREF = 3.0V.
2.0
2.0
Max 125C
1.5
1.5
Max -40C
Max 125C
1.0
1.0
Max 25C
Max -40C
0.5
Max 25C
0.5
0.0
Min -40C
-0.5
Min 25C
-1.0
INL (LSb)
DNL (LSb)
Max -40C
Max 125C
Max 25C
0.0
Min -40C
-0.5
Min 25C
-1.0
Min 125C
-1.5
Min 125C
-2.0
-1.5
-2.5
-2.0
1.8
2.3
Reference Voltage (V)
3.0
FIGURE 31-83:
ADC 10-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 1 S.
-3.0
1.8
2.3
Reference Voltage (V)
3.0
FIGURE 31-84:
ADC 10-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 1 S.
DS40001637C-page 426
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
g
g
3.0
2.5
2.5
2.0
2.0
1.5
DNL (LSb)
DNL (LSb)
1.5
1.0
0.5
1.0
0.5
0.0
0.0
-0.5
-0.5
-1.0
-1.0
-1.5
-1.5
0
500
1000
1500
2000
2500
3000
4000
3500
500
1000
1500
Output Code
FIGURE 31-85:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 1 S, 25C.
2500
3000
3500
4000
FIGURE 31-86:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 4 S, 25C.
,
3.5
3.0
3.0
2.5
2.5
2.0
INL (LSb)
2.0
INL (LSb)
2000
Output Code
1.5
1.0
1.5
1.0
0.5
0.5
0.0
0.0
-0.5
-0.5
-1.0
-1.0
-1.5
-1.5
0
500
1000
1500
2000
2500
3000
3500
4000
500
1000
1500
Output Code
FIGURE 31-87:
ADC 12-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 1 S, 25C.
2000
2500
3000
4000
3500
Output Code
FIGURE 31-88:
ADC 12-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 4 S, 25C.
4.5
5.5
Max -40C
Max -40C
3
Max 125C
3.5
Max 125C
INL (LSb)
DNL (LSb)
Max 25C
1.5
Max 25C
1.5
-0.5
Min 25C
Min -40C
Min 125C
-1.5
Min 25C
Min -40C
-2.5
Min 125C
-3
-4.5
0.5
1.0
2.0
TAD (s)
4.0
8.0
FIGURE 31-89:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 3.0V, VREF = 3.0V.
DS40001637C-page 427
0.5
1.0
2.0
TAD (s)
4.0
8.0
FIGURE 31-90:
ADC 12-bit Mode,
Single-Ended INL, VDD = 3.0V, VREF = 3.0V.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
,
,
6
5
4
Max -40C
Max -40C
Max 25C
Max 125C
INL (LSb)
DNL (LSb)
Max 25C
Max 125C
1
0
Min 125C
-1
Min 125C
Min 25C
-2
Min -40C
Min -40C
-1
-3
Min 25C
-4
-2
1.8
2.3
Reference Voltage (V)
1.8
3.0
FIGURE 31-91:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 3.0V, TAD = 1 S.
2.3
Reference Voltage (V)
3.0
FIGURE 31-92:
ADC 12-bit Mode,
Single-Ended INL, VDD = 3.0V, TAD = 1 S.
2.5
2.5
2.0
2.0
1.5
DNL (LSb)
DNL (LSb)
1.5
1.0
0.5
1.0
0.5
0.0
0.0
-0.5
-0.5
-1.0
-1.5
-1.0
0
500
1000
1500
2000
2500
3000
3500
4000
500
1000
1500
Output Code
FIGURE 31-93:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 5.5V, TAD = 1 S, 25C.
2500
3000
3500
4000
FIGURE 31-94:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 5.5V, TAD = 4 S, 25C.
3.5
3.5
2.0
3.0
3.0
1.5
2.5
1.0
2.5
INL
DNL(LSb)
(LSb)
INL (LSb)
2000
Output Code
2.0
1.5
0.5
2.0
0.0
1.5
-0.5
1.0
1.0
-1.0
0.5
0.5
-1.5
0.0
0.0
-2.0
0
512
1024
500
1000
1536
-0.5
-0.5
0
500
1000
1500
2000
2500
3000
3500
4000
Output Code
FIGURE 31-95:
ADC 12-bit Mode,
Single-Ended INL, VDD = 5.5V, TAD = 1 S, 25C.
1500
2048
2560
Output Code
2000
2500
3072
3000
3584
3500
4096
4000
Output Code
FIGURE 31-96:
ADC 12-bit Mode,
Single-Ended INL, VDD = 5.5V, TAD = 4 S, 25C.
DS40001637C-page 428
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
,
4
3
Max 25C
Max -40C
Max -40C
Max 125C
Max 25C
2
INL (LSb)
DNL (LSb)
Max 125C
-1
Min -40C
Min 125C
-2
1.0
2.0
TAD (s)
Min 25C
-1
Min 25C
Min -40C
Min 125C
-2
4.0
1.0
FIGURE 31-97:
ADC 12-bit Mode,
Single-Ended DNL, VDD = 5.5V, VREF = 5.5V.
2.0
TAD (s)
FIGURE 31-98:
ADC 12-bit Mode,
Single-Ended INL, VDD = 5.5V, VREF = 5.5V.
900
800
700
Max.
800
Max.
Typical
ADC Output Codes
600
ADC Output Codes
4.0
500
Typical
400
300
700
Min.
600
500
Min.
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
200
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
100
400
300
0
2.5
3.0
3.5
4.0
4.5
5.0
6.0
5.5
2.4
2.8
3.2
3.6
4.4
4.8
5.2
5.6
VDD (V)
VDD (V)
FIGURE 31-99:
Temp. Indicator Initial Offset,
High Range, Temp. = 20C, PIC16F1784/6/7 Only.
FIGURE 31-100:
Temp. Indicator Initial Offset,
Low Range, Temp. = 20C, PIC16F1784/6/7 Only.
800
150
ADC Vref+ set to Vdd
ADC Vref- set to Gnd
Max.
100
Max.
600
125
700
500
Min.
400
Min.
75
50
25
0
Typical
300
-25
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
200
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-50
Typical
100
-75
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 31-101:
Temp. Indicator Initial Offset,
Low Range, Temp. = 20C, PIC16LF1784/6/7
Only.
DS40001637C-page 429
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-102:
Temp. Indicator Slope
Normalized to 20C, High Range, VDD = 5.5V,
PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
250
150
Max.
200
Max.
Min.
100
50
0
100
150
Min.
50
-50
-50
Typical
-100
Typical
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-150
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-100
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
20
Temperature (C)
40
60
80
100
120
140
Temperature (C)
FIGURE 31-103:
Temp. Indicator Slope
Normalized to 20C, High Range, VDD = 3.6V,
PIC16F1784/6/7 Only.
FIGURE 31-104:
Temp. Indicator Slope
Normalized to 20C, Low Range, VDD = 3.0V,
PIC16F1784/6/7 Only.
250
150
Max.
200
Max.
100
Min.
100
50
0
150
Min.
50
-50
-50
Typical
-100
Typical
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-150
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-100
-60
-40
-20
20
40
60
80
100
120
140
-60
-40
-20
20
Temperature (C)
FIGURE 31-105:
Temp. Indicator Slope
Normalized to 20C, Low Range, VDD = 1.8V,
PIC16LF1784/6/7 Only.
60
80
100
120
140
FIGURE 31-106:
Temp. Indicator Slope
Normalized to 20C, Low Range, VDD = 3.0V,
PIC16LF1784/6/7 Only.
250
80
ADC Vref+ set to Vdd
ADC Vref- set to Gnd
200
Max
Max.
75
150
70
Min.
100
50
CMRR (dB)
40
Temperature (C)
Typical
65
60
Min
55
50
-50
-100
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
Typical
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
45
40
-150
-60
-40
-20
20
40
60
80
100
120
Temperature (C)
FIGURE 31-107:
Temp. Indicator Slope
Normalized to 20C, High Range, VDD = 3.6V,
PIC16LF1784/6/7 Only.
140
-50
-30
-10
10
30
50
70
90
110
130
Temperature (C)
FIGURE 31-108:
Op Amp, Common Mode
Rejection Ratio (CMRR), VDD = 3.0V.
DS40001637C-page 430
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
g
35%
8
6
25%
20%
-40C
25C
15%
85C
Max
Typical
Percent of Units
30%
2
0
Min
-2
125C
10%
-4
5%
-6
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-8
0%
0.0
-7
-5
-4
-3
-2
-1
0
1
2
Offset Voltage (mV)
0.3
0.6
0.9
1.2
1.5
1.8
2.1
2.4
2.7
3.0
7
Common Mode Voltage (V)
FIGURE 31-109:
Op Amp, Output Voltage
Histogram, VDD = 3.0V, VCM = VDD/2.
FIGURE 31-110:
Op Amp, Offset Over
Common Mode Voltage, VDD = 3.0V,
Temp. = 25C.
1.2
8
Max
6
1.0
4
Typical
2
0
-2
0.8
0.6
0.4
-4
Min
0.2
Max: Typical + 3
Typical; statistical mean
Min: Typical - 3
-6
0.0
-8
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
-60
5.0
-40
-20
20
40
60
80
100
FIGURE 31-111:
Op Amp, Offset Over
Common Mode Voltage, VDD = 5.0V,
Temp. = 25C, PIC16F1784/6/7 Only.
140
FIGURE 31-112:
Op Amp, Output Slew Rate,
Rising Edge, PIC16LF1784/6/7 Only.
,
4.0
3.8
Vdd = 3.6V
3.7
3.7
3.6
Slew Rate (V/us)
120
Temperature (C)
3.4
Vdd = 5.5V
3.5
3.4
Vdd = 2.3V
3.3
Vdd = 3V
3.1
3.2
3.1
2.8
3.0
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-113:
Op Amp, Output Slew Rate,
Falling Edge, PIC16LF1784/6/7 Only.
DS40001637C-page 431
-60
-40
-20
20
40
60
80
100
120
140
Temperature (C)
FIGURE 31-114:
Op Amp, Output Slew Rate,
Rising Edge, PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
5.4
45
5.2
43
Vdd = 2.3V
-40C
41
Hysteresis (mV)
5.0
4.8
4.6
Vdd = 3.6V
4.4
39
25C
37
85C
35
125
33
4.2
31
4.0
3.8
Vdd = 5.5V
29
Vdd = 3V
27
3.6
25
-60
-40
-20
20
40
60
80
100
120
140
0.0
0.5
Temperature (C)
1.0
1.5
2.0
2.5
3.0
3.5
FIGURE 31-115:
Op Amp, Output Slew Rate,
Falling Edge, PIC16F1784/6/7 Only.
FIGURE 31-116:
Comparator Hysteresis,
NP Mode (CxSP = 1), VDD = 3.0V, Typical
Measured Values.
yp
30
30
25
20
20
15
15
10
25
MAX
5
0
-5
MAX
10
5
0
-5
MIN
-10
-10
-15
MIN
-15
-20
0.0
0.5
1.0
1.5
2.0
2.5
3.0
-20
0.0
0.5
1.0
1.5
2.0
2.5
3.0
FIGURE 31-117:
Comparator Offset, NP Mode
(CxSP = 1), VDD = 3.0V, Typical Measured Values
at 25C.
FIGURE 31-118:
Comparator Offset, NP Mode
(CxSP = 1), VDD = 3.0V, Typical Measured Values
From -40C to 125C.
50
Hysteresis (mV)
45
40
25C
125
35
85
30
-40C
25
20
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
FIGURE 31-119:
Comparator Hysteresis,
NP Mode (CxSP = 1), VDD = 5.5V, Typical
Measured Values, PIC16F1784/6/7 Only.
DS40001637C-page 432
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
40
30
25
30
20
Offset Voltage (mV)
Hysteresis (mV)
15
MAX
10
5
0
-5
-10
20
MAX
10
-10
MIN
MIN
-15
-20
-20
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
0.0
5.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
FIGURE 31-120:
Comparator Offset, NP Mode
(CxSP = 1), VDD = 5.0V, Typical Measured Values
at 25C, PIC16F1784/6/7 Only.
FIGURE 31-121:
Comparator Offset, NP Mode
(CxSP = 1), VDD = 5.0V, Typical Measured Values
From -40C to 125C, PIC16F1784/6/7 Only.
yp
90
140
Max: Typical + 3 (-40C to +125C)
Typical; statistical mean @ 25C
Min: Typical - 3 (-40C to +125C)
120
80
70
125C
60
125C
Time (nS)
Time (nS)
100
80
25C
60
50
25C
40
30
40
20
-40C
-40C
20
10
0
0
1.8
2.1
2.4
2.7
3.0
3.3
2.2
3.6
2.5
2.8
3.1
3.4
3.7
4.0
4.3
4.6
4.9
5.2
5.5
VDD (V)
VDD (V)
FIGURE 31-122:
Comparator Response Time
Over Voltage, NP Mode (CxSP = 1), Typical
Measured Values, PIC16LF1784/6/7 Only.
FIGURE 31-123:
Comparator Response Time
Over Voltage, NP Mode (CxSP = 1), Typical
Measured Values, PIC16F1784/6/7 Only.
800
1,400
Max: Typical + 3 (-40C to +125C)
Typical; statistical mean @ 25C
Min: Typical - 3 (-40C to +125C)
1,200
700
600
Time (nS)
Time (nS)
1,000
800
125C
600
500
125C
400
300
25C
25C
400
200
200
100
-40C
-40C
0
0
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
VDD (V)
FIGURE 31-124:
Comparator Output Filter
Delay Time Over Temp., NP Mode (CxSP = 1),
Typical Measured Values, PIC16LF1784/6/7
Only.
DS40001637C-page 433
2.2
2.5
2.8
3.1
3.4
3.7
4.0
4.3
4.6
4.9
5.2
5.5
VDD (V)
FIGURE 31-125:
Comparator Output Filter
Delay Time Over Temp., NP Mode (CxSP = 1),
Typical Measured Values, PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
0.025
0.00
0.020
-0.05
0.015
-0.10
0.010
0.005
-40C
25C
0.000
85C
125C
-0.005
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
-0.15
-0.20
25C
85C
125C
-0.30
-0.010
-0.35
-0.015
-0.40
-0.020
-40C
-0.25
-0.45
0
FIGURE 31-126:
Typical DAC DNL Error,
VDD = 3.0V, VREF = External 3V.
FIGURE 31-127:
Typical DAC INL Error,
VDD = 3.0V, VREF = External 3V.
0.020
0.00
-0.05
0.015
-0.10
Absolute INL (LSb)
0.010
0.005
-40C
25C
0.000
85C
125C
-0.15
-0.20
-40C
25C
-0.25
85C
125C
-0.30
-0.005
-0.35
-0.010
-0.40
-0.015
-0.45
0
FIGURE 31-128:
Typical DAC INL Error,
VDD = 5.0V, VREF = External 5V,
PIC16F1784/6/7 Only.
FIGURE 31-129:
Typical DAC INL Error,
VDD = 5.0V, VREF = External 5V,
PIC16F1784/6/7 Only.
0.45
0.4
0.90
-2.1
0.35
0.3
0.3
Vref = Ext.
1.8V
Vref = Ext.
2.0V
0.25
0.2
0.15
0.2
0.1
0.05
-50
50
Temperature (C)
100
Absolute
Absolute
INL (LSb)
INL (LSb)
Absolute
Absolute
DNL (LSb)
DNL (LSb)
0.4
0.10
-2.3
0.88
-2.5
Vref = Ext.
1.8V
Vref = Ext.
2.0V
Vref = Ext.
3.0V
0.86
-2.7
-2.9
0.84
-3.1
0.0
25
85
125
-3.3
0.82
-3.5
0.0
0.80
150
-40
1.0
2.0
3.0
Temperature (C)
4.0
5.0
0.78
-60
-40
-20
20
40
60
Temperature (C)
80
100
120
140
FIGURE 31-130:
Absolute Value of DAC DNL
Error, VDD = 3.0V, VREF = VDD.
-60
-40
-20
FIGURE 31-131:
Error, VDD = 3.0V.
20
40
60
Temperature (C)
80
100
120
140
DS40001637C-page 434
PIC16(L)F1784/6/7
Note: Unless otherwise noted, VIN = 5V, FOSC = 300 kHz, CIN = 0.1 F, TA = 25C.
0.3
0.30
0.9
-2.1
Vref = Int. Vdd
0.26
0.2
Vref = Ext.
1.8V
Vref = Ext.
2.0V
Vref = Ext.
3.0V
Vref = Ext.
5.0V
0.15
0.22
0.1
-40
25
85
125
0.18
0.05
Absolute
Absolute
INL (LSb)
INL (LSb)
Absolute
Absolute
DNL (LSb)
DNL (LSb)
0.25
-2.3
0.88
-2.5
Vref = Ext.
1.8V
Vref = Ext.
2.0V
Vref = Ext.
3.0V
0.86
-2.7
-2.9
-40
25
85
0.84
-3.1
125
-3.3
0.82
-3.5
0
0.14 0.0
1.0
2.0
3.0
4.0
Temperature (C)
5.0
0.0
0.8
6.0
0.10
1.0
2.0
3.0
4.0
Temperature (C)
5.0
6.0
0.78
-60
-40
-20
20
40
60
Temperature (C)
80
100
120
140
FIGURE 31-132:
Absolute Value of DAC DNL
Error, VDD = 5.0V, PIC16F1784/6/7 Only.
DS40001637C-page 435
-60
-40
-20
20
40
60
Temperature (C)
80
100
120
140
FIGURE 31-133:
Absolute Value of DAC INL
Error, VDD = 5.0V, PIC16F1784/6/7 Only.
PIC16(L)F1784/6/7
32.0
DEVELOPMENT SUPPORT
32.1
Multiple projects
Multiple tools
Multiple configurations
Simultaneous debugging sessions
DS40001637C-page 436
PIC16(L)F1784/6/7
32.2
MPLAB XC Compilers
32.3
MPASM Assembler
32.4
32.5
DS40001637C-page 437
PIC16(L)F1784/6/7
32.6
32.7
DS40001637C-page 438
32.8
32.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)F1784/6/7
32.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.
DS40001637C-page 439
PIC16(L)F1784/6/7
33.0
PACKAGING INFORMATION
33.1
Example
PIC16F1786
-I/SP e3
1204017
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
YYWWNNN
Example
PIC16F1786
-I/SO e3
1204017
1204017
Example
PIC16F1786
-I/SS e3
1204017
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
DS40001637C-page 440
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)F1784/6/7
Package Marking Information (Continued)
PIN 1
Example
PIN 1
16F1786
-I/ML e3
XXXXXXXX
XXXXXXXX
YYWWNNN
120417
XXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX
YYWWNNN
Example
PIC16F1784
-E/P e3
120417
PIN 1
Example
PIN 1
PIC16
F1784
-I/MV e3
120417
DS40001637C-page 441
PIC16(L)F1784/6/7
Package Marking Information (Continued)
PIN 1
Example
PIN 1
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
YYWWNNN
PIC16F1784
-E/ML e3
120417
Example
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
YYWWNNN
PIC16F1784
-E/PT e3
120417
DS40001637C-page 442
PIC16(L)F1784/6/7
33.2
Package Details
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
N
NOTE 1
E1
2 3
D
E
A2
b1
A1
eB
7'"
(":('"
8#(*
& "
'
8-9/
8
8;
<
=
2-
>
>
.
>
>
#$
'#$
?$'
.
..
$$ 5?$'
/
=
;!
:'
.
.@
.
:$ 5""
=
*
=
2
>
>
7
:$?$'
:+
:$?$'
;!
+
,
.
!"
!"#$%&'#
(!
)*#'(#"'* '$+''' $
,& '-
'
"'
. (""$/$' #$($&"
'
#""$&"
'
#"""'% $0
"$
("$'
/1
2-3 2" ("
' % '!#"++'#''
"
+ -2
DS40001637C-page 443
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 444
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 445
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 446
PIC16(L)F1784/6/7
#$
%
&'
%
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
D
N
E
E1
1 2
NOTE 1
b
e
c
A2
A1
L1
7'"
(":('"
8#(*
& "
'
:://
8
8;
<
=
@2-
;!
9'
>
>
@
=
'$&&
>
>
;!
?$'
=
=
$$ 5?$'
/
.
@
;!
:'
4':'
4'
'
:
/4
:$ 5""
>
4'
A
A
=A
:$?$'
>
.=
!"
!"#$%&'#
(!
)*#'(#"'* '$+''' $
(""$/$' #$($&"
'
#""$&"
'
#"""'% $((
"$
. ("$'
/1
2-3 2" ("
' % '!#"++'#''
"
/43 &
(")#"#+'#''
)&
&
('
#
""
+ -.2
DS40001637C-page 447
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 448
PIC16(L)F1784/6/7
( )* ! + , -.- ()!
/# '&& 0
+#
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
D
D2
EXPOSED
PAD
e
E
b
E2
2
K
N
NOTE 1
L
BOTTOM VIEW
TOP VIEW
A3
A1
7'"
(":('"
8#(*
& "
'
:://
8
8;
<
=
@2-
;!
9'
=
'$&&
.
;!
?$'
/% "$ $?$'
/
;!
:'
/% "$ $:'
/4
@2.@
.
@2-
.@
.
-' '?$'
.
.
.
-' ':'
>
+ -2
DS40001637C-page 449
PIC16(L)F1784/6/7
( )* ! + , -.- ()!
/# '&& 0
+#
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
DS40001637C-page 450
PIC16(L)F1784/6/7
1
-
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
N
NOTE 1
E1
1 2 3
A2
b1
A1
eB
7'"
(":('"
8#(*
& "
'
8-9/
8
8;
<
2-
>
>
>
>
>
#$
'#$
?$'
>
@
$$ 5?$'
/
=
>
=
;!
:'
=
>
>
:$ 5""
=
>
*
.
>
>
.
2
>
>
7
:$?$'
:+
:$?$'
;!
+
,
!"
!"#$%&'#
(!
)*#'(#"'* '$+''' $
,& '-
'
"'
. (""$/$' #$($&"
'
#""$&"
'
#"""'% $0
"$
("$'
/1
2-3 2" ("
' % '!#"++'#''
"
+ -@2
DS40001637C-page 451
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 452
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 453
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 454
PIC16(L)F1784/6/7
DS40001637C-page 455
PIC16(L)F1784/6/7
DS40001637C-page 456
PIC16(L)F1784/6/7
DS40001637C-page 457
PIC16(L)F1784/6/7
11 2#
( )3 2 4.4.4 * ' 2()
!"
4
'("' #
'
5$
+")
""'
5
& ' '$'
''
366+++(
(6
5
D
D1
E
e
E1
N
b
NOTE 1
1 2 3
NOTE 2
A2
A1
L
L1
7'"
(":('"
8#(*
&:$"
:://
8
8;
<
:$ '
;!
9'
>
=2>
'$&&
>
4':'
@
4'
'
:
/4
4'
;!
?$'
2-
;!
:'
2-
$$ 5?$'
/
2-
$$ 5:'
2-
A
.A
A
:$ 5""
>
:$?$'
.
.
$
&'
A
A
.A
$
&'2''(
A
A
.A
!"
!"#$%&'#
(!
)*#'(#"'* '$+''' $
-(&
"'
"
'X"Y(!
. (""$/$' #$($&"
'
#""$&"
'
#"""'% $((
"$
("$'
/1
2-3 2" ("
' % '!#"++'#''
"
/43 &
(")#"#+'#''
)&
&
('
#
""
+ -@2
DS40001637C-page 458
PIC16(L)F1784/6/7
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001637C-page 459
PIC16(L)F1784/6/7
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (06/2012)
Initial release.
Revision B (11/2012)
Minor updates.
Revision C (08/2014)
Change from Preliminary to Final data sheet.
Corrected the following Tables: Family Types Table on
page 3, Table 3-3, Table 3-8, Table 20-3, Table 22-2,
Table 22-3, Table 23-1, Table 25-3, Table 30-1, Table
30-2, Table 30-3, Table 30-6, Table 30-7, Table 30-13,
Table 30-14, Table 30-15, Table 30-16, Table 30-20.
Corrected the following Sections: Section 3.2, Section
9.2, Section 13.3, Section 17.1.6, Section 15.1, Section
15.3, Section 17.2.5, Section 18.2, Section 18.3, Section 19.0, Section 22.6.5, Section 22.9, Section 23.0,
Section 23.1, Section 24.2.4, Section 24.2.5, Section
24.2.7, Section 24.8, Section 25.0, Section 26.6.7.4,
Section 30.3.
Corrected the following Registers: Register 4-2, Register 8-2, Register 8-5, Register 17-3, Register 18-1,
Register 24-3, Register 24-4.
Corrected Equation 17-1.
Corrected Figure 30-9. Removed Figure 24-21.
DS40001637C-page 460
PIC16(L)F1784/6/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://microchip.com/support
DS40001637C-page 461
PIC16(L)F1784/6/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:
PIC16F1784, PIC16LF1784,
PIC16F1786, PIC16LF1786,
PIC16F1787, PIC16LF1787
Blank
T
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:(2)
ML
MV
P
PT
SP
SO
SS
=
=
=
=
=
=
=
Pattern:
PIC16LF1784/7- I/P
Industrial temperature
PDIP package
PIC16F1786- E/SS
Extended temperature,
SSOP package
(Industrial)
(Extended)
QFN
UQFN
PDIP
TQFP
SPDIP
SOIC
SSOP
Note
1:
2:
DS40001637C-page 462
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 ==
2012-2014 Microchip Technology Inc.
DS40001637C-page 463
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
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
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
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
DS40001637C-page 464
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
India - Pune
Tel: 91-20-3019-1500
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Germany - Dusseldorf
Tel: 49-2129-3766400
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Germany - Pforzheim
Tel: 49-7231-424750
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Italy - Venice
Tel: 39-049-7625286
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
Poland - Warsaw
Tel: 48-22-3325737
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
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 - Kaohsiung
Tel: 886-7-213-7830
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
03/25/14