PIC16F887
PIC16F887
PIC16F887
RE3/MCLR/VPP 1 28 RB7/ICSPDAT
RA0/AN0/ULPWU/C12IN0- 2 27 RB6/ICSPCLK
RA1/AN1/C12IN1- 3 26 RB5/AN13/T1G
RA2/AN2/VREF-/CVREF/C2IN+ 4 25 RB4/AN11/P1D
PIC16F882/883/886
RA3/AN3/VREF+/C1IN+ 5 24 RB3/AN9/PGM/C12IN2-
RA4/T0CKI/C1OUT 6 23 RB2/AN8/P1B
RA5/AN4/SS/C2OUT 7 22 RB1/AN10/P1C/C12IN3-
VSS 8 21 RB0/AN12/INT
RA7/OSC1/CLKIN 9 20 VDD
RA6/OSC2/CLKOUT 10 19 VSS
RC0/T1OSO/T1CKI 11 18 RC7/RX/DT
RC1/T1OSI/CCP2 12 17 RC6/TX/CK
RC2/P1A/CCP1 13 16 RC5/SDO
RC3/SCK/SCL 14 15 RC4/SDI/SDA
28-Pin PDIP/SOIC/SSOP
Comparators
Interrupt
EUSART
Pull-up
Analog
Timers
MSSP
ECCP
Basic
I/O
RA0/AN0/ULPWU/C12IN0-
RA1/AN1/C12IN1-
RE3/MCLR/VPP
RB5/AN13/T1G
RB4/AN11/P1D
RB6/ICSPCLK
RB7/ICSPDAT
28
27
26
25
24
23
22
RA2/AN2/VREF-/CVREF/C2IN+ 1 21 RB3/AN9/PGM/C12IN2-
RA3/AN3/VREF+/C1IN+ 2 20 RB2/AN8/P1B
RA4/T0CKI/C1OUT 3 19 RB1/AN10/P1C/C12IN3-
RA5/AN4/SS/C2OUT 4 PIC16F882/883/886 18 RB0/AN12/INT
VSS 5 17 VDD
RA7/OSC1/CLKIN 6 16 VSS
RA6/OSC2/CLKOUT 7 15 RC7/RX/DT
10
11
12
13
14
8
9
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC3/SCK/SCL
RC4/SDI/SDA
RC6/TX/CK
RC2/P1A/CCP1
RC5/SDO
Comparators
28-Pin QFN
Interrupt
EUSART
Pull-up
Analog
Timers
MSSP
ECCP
Basic
I/O
RE3/MCLR/VPP 1 40 RB7/ICSPDAT
RA0/AN0/ULPWU/C12IN0- 2 39 RB6/ICSPCLK
RA1/AN1/C12IN1- 3 38 RB5/AN13/T1G
RA2/AN2/VREF-/CVREF/C2IN+ 4 37 RB4/AN11
RA3/AN3/VREF+/C1IN+ 5 36 RB3/AN9/PGM/C12IN2-
RA4/T0CKI/C1OUT 6 35 RB2/AN8
RA5/AN4/SS/C2OUT 7 34 RB1/AN10/C12IN3-
RE0/AN5 8 33 RB0/AN12/INT
PIC16F884/887
RE1/AN6 9 32 VDD
RE2/AN7 10 31 VSS
VDD 11 30 RD7/P1D
VSS 12 29 RD6/P1C
RA7/OSC1/CLKIN 13 28 RD5/P1B
RA6/OSC2/CLKOUT 14 27 RD4
RC0/T1OSO/T1CKI 15 26 RC7/RX/DT
RC1/T1OSI/CCP2 16 25 RC6/TX/CK
RC2/P1A/CCP1 17 24 RC5/SDO
RC3/SCK/SCL 18 23 RC4/SDI/SDA
RD0 19 22 RD3
RD1 20 21 RD2
Comparators
40-Pin PDIP
Interrupt
EUSART
Analog
Pull-up
Timers
MSSP
ECCP
Basic
I/O
RC1/T1OSCI/CCP2
RC0/T1OSO/T1CKI
RC2/P1A/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC6/TX/CK
RC5/SDO
RD3
RD2
RD1
RD0
44
43
42
41
40
39
37
36
35
34
38
RC7/RX/DT 1 33 RA6/OSC2/CLKOUT
RD4 2 32 RA7/OSC1/CLKIN
RD5/P1B 3 31 VSS
RD6/P1C 4 30 VSS
RD7/P1D 5 29 NC
VSS 6 PIC16F884/887 28 VDD
VDD 7 27 RE2/AN7
VDD 8 26 RE1/AN6
RB0/AN12/INT 9 25 RE0/AN5
RB1/AN10/C12IN3- 10 24 RA5/AN4/SS/C2OUT
RB2/AN8 11 23 RA4/T0CKI/C1OUT
12
13
14
15
16
17
18
19
20
21
22
RB7/ICSPDAT
RB3/AN9/PGM/C12IN2-
RA1/AN1/C12IN1-
RA3/AN3//VREF+/C1IN+
RB4/AN11
RA0/AN0/ULPWU/C12IN0-
RA2/AN2/VREF-/CVREF/C2IN+
RB5/AN13/T1G
NC
RB6/ICSPCLK
RE3/MCLR/VPP
Comparators
44-Pin QFN
Interrupt
EUSART
Analog
Pull-up
Timers
MSSP
ECCP
Basic
I/O
RC1/T1OSCI/CCP2
RC2/P1A/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC6/TX/CK
RC5/SDO
RD3
RD2
RD1
RD0
NC
44
43
42
41
40
39
37
36
35
34
38
RC7/RX/DT 1 33 NC
RD4 2 32 RC0/T1OSO/T1CKI
RD5/P1B 3 31 RA6/OSC2/CLKOUT
RD6/P1C 4 30 RA7/OSC1/CLKIN
RD7/P1D 5 29 VSS
VSS 6 PIC16F884/887 28 VDD
VDD 7 27 RE2/AN7
RB0/AN12/INT 8 26 RE1/AN6
RB1/AN10/C12IN3- 9 25 RE0/AN5
RB2/AN8 10 24 RA5/AN4/SS/C2OUT
RB3/AN9/PGM/C12IN2- 11 23 RA4/T0CKI/C1OUT
12
13
14
15
16
17
18
19
20
21
22
RA2/AN2/VREF-/CVREF/C2IN+
RB7/ICSPDAT
RA3/AN3//VREF+/C1IN+
RB4/AN11
NC
NC
RB5/AN13/T1G
RB6/ICSPCLK
RE3/MCLR/VPP
RA1/AN1/C12IN1-
RA0/AN0/ULPWU/C12IN0-
Comparators
44-Pin TQFP
Interrupt
EUSART
Analog
Pull-up
Timers
MSSP
ECCP
Basic
I/O
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Configuration PORTA
13 8 RA0
Data Bus
Program Counter RA1
Flash RA2
2K(2)/4K(1)/ RA3
8K X 14 RA4
RAM
Program RA5
Memory
8-Level Stack 128(2)/256(1)/ RA6
(13-Bit) 368 Bytes
RA7
File
Registers
Program PORTB
14
Bus RAM Addr RB0
9
RB1
Addr MUX RB2
Instruction Reg
RB3
Direct Addr 7 Indirect RB4
8 Addr RB5
RB6
FSR Reg
RB7
In-Circuit
Debugger
(ICD)
T1OSI Timer1
32 kHz
CCP1/P1A
SCK/SCL
T1OSO Oscillator
SDI/SDA
RX/DT
TX/CK
SDO
P1C
P1D
P1B
SS
Master Synchronous
Timer0 Timer1 Timer2 EUSART ECCP
Serial Port (MSSP)
VREF+
VREF+ Analog-To-Digital Converter 2 Analog Comparators 8
VREF- EEDATA
VREF- (ADC) and Reference
CVREF 128(2)/
256 Bytes
Data
EEPROM
AN0
AN1
AN2
AN3
AN4
AN8
AN9
AN10
AN11
AN12
AN13
C12IN0-
C12IN1-
C12IN2-
C12IN3-
C1IN+
C2IN+
C1OUT
C2OUT
EEADDR
Configuration PORTA
13 8 RA0
Data Bus
Program Counter RA1
Flash RA2
4K(1)/8K X 14 RA3
RA4
Program RAM RA5
Memory 8-Level Stack 256(1)/368 Bytes RA6
(13-Bit) File RA7
Registers
Program PORTB
14
Bus RAM Addr RB0
9
RB1
Addr MUX RB2
Instruction Reg
RB3
Direct Addr 7 Indirect RB4
8 Addr RB5
RB6
FSR Reg
RB7
T1OSI Timer1
32 kHz
CCP1/P1A
SCK/SCL
T1OSO Oscillator
SDI/SDA
RX/DT
TX/CK
SDO
P1C
P1D
P1B
SS
T0CKI T1G T1CKI
Master Synchronous
Timer0 Timer1 Timer2 EUSART ECCP
Serial Port (MSSP)
VREF+
VREF+ Analog-To-Digital Converter 2 Analog Comparators 8
VREF- EEDATA
VREF- (ADC) and Reference
CVREF
256 Bytes
Data
EEPROM
AN0
AN1
AN2
AN3
AN4
AN5
AN6
AN7
AN8
AN9
AN10
AN11
AN12
AN13
C1IN+
C2IN+
C1OUT
C2OUT
C12IN0-
C12IN1-
C12IN2-
C12IN3-
EEADDR
PC<12:0>
CALL, RETURN 13
Interrupt Vector 0004h RETFIE, RETLW
On-Chip 0005h
Program Page 0
Memory 07FFh Stack Level 1
Stack Level 2
Stack Level 8
96 Bytes
EFh 16Fh 1EFh
accesses F0h accesses 170h accesses 1F0h
7Fh 70h-7Fh FFh 70h-7Fh 17Fh 70h-7Fh 1FFh
Bank 0 Bank 1 Bank 2 Bank 3
Bank 0
00h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx xxxx xxxx
01h TMR0 Timer0 Module Register xxxx xxxx uuuu uuuu
02h PCL Program Counters (PC) Least Significant Byte 0000 0000 0000 0000
03h STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 000q quuu(5)
04h FSR Indirect Data Memory Address Pointer xxxx xxxx uuuu uuuu
05h PORTA(3) RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0 xxxx xxxx 0000 0000
06h PORTB(3) RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx 0000 0000
07h PORTC(3) RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx 0000 0000
08h PORTD(3,4) RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxx xxxx 0000 0000
09h PORTE(3) RE3 RE2(4) RE1(4) RE0(4) ---- xxxx ---- 0000
0Ah PCLATH Write Buffer for upper 5 bits of Program Counter ---0 0000 ---0 0000
0Bh INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF(1) 0000 000x 0000 000u
0Ch PIR1 ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF -000 0000 0000 0000
0Dh PIR2 OSFIF C2IF C1IF EEIF BCLIF ULPWUIF CCP2IF 0000 00-0 0000 0000
0Eh TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
0Fh TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
10h T1CON T1GINV TMR1GE T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 uuuu uuuu
11h TMR2 Timer2 Module Register 0000 0000 0000 0000
12h T2CON TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
13h SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
14h SSPCON(2) WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 0000 0000
15h CCPR1L Capture/Compare/PWM Register 1 Low Byte (LSB) xxxx xxxx uuuu uuuu
16h CCPR1H Capture/Compare/PWM Register 1 High Byte (MSB) xxxx xxxx uuuu uuuu
17h CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 0000
19h TXREG EUSART Transmit Data Register 0000 0000 0000 0000
1Ah RCREG EUSART Receive Data Register 0000 0000 0000 0000
1Bh CCPR2L Capture/Compare/PWM Register 2 Low Byte (LSB) xxxx xxxx uuuu uuuu
1Ch CCPR2H Capture/Compare/PWM Register 2 High Byte (MSB) xxxx xxxx uuuu uuuu
1Dh CCP2CON DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 --00 000
1Eh ADRESH A/D Result Register High Byte xxxx xxxx uuuu uuuu
1Fh ADCON0 ADCS1 ADCS0 CHS3 CHS2 CHS1 CHS0 GO/ ADON 0000 0000 00-0 0000
DONE
Legend: = Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: MCLR and WDT Reset do not affect the previous value data latch. The RBIF bit will be cleared upon Reset but will set again if the
mismatch exists.
2: When SSPCON register bits SSPM<3:0> = 1001, any reads or writes to the SSPADD SFR address are accessed through the SSPMSK
register. See Registers 13-2 and 13-4 for more details.
3: Port pins with analog functions controlled by the ANSEL and ANSELH registers will read 0 immediately after a Reset even though the data
latches are either undefined (POR) or unchanged (other Resets).
4: PIC16F884/PIC16F887 only.
5: See Table 14-5 for Reset value for specific condition.
Bank 1
80h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx xxxx xxxx
81h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
82h PCL Program Counters (PC) Least Significant Byte 0000 0000 0000 0000
83h STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 000q quuu(5)
84h FSR Indirect Data Memory Address Pointer xxxx xxxx uuuu uuuu
85h TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 1111 1111
86h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
87h TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
88h TRISD(3) TRISD7 TRISD6 TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111 1111 1111
89h TRISE TRISE3 TRISE2(3) TRISE1(3) TRISE0(3) ---- 1111 ---- 1111
8Ah PCLATH Write Buffer for the upper 5 bits of the Program Counter ---0 0000 ---0 0000
8Bh INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF(1) 0000 000x 0000 000u
8Ch PIE1 ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE -000 0000 0000 0000
8Dh PIE2 OSFIE C2IE C1IE EEIE BCLIE ULPWUIE CCP2IE 0000 00-0 0000 0000
8Eh PCON ULPWUE SBOREN POR BOR --01 --qq --0u --uu(4,6)
8Fh OSCCON IRCF2 IRCF1 IRCF0 OSTS HTS LTS SCS -110 q000 -110 q000
90h OSCTUNE TUN4 TUN3 TUN2 TUN1 TUN0 ---0 0000 ---u uuuu
91h SSPCON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000 0000 0000
92h PR2 Timer2 Period Register 1111 1111 1111 1111
93h SSPADD(2) Synchronous Serial Port (I2C mode) Address Register 0000 0000 0000 0000
93h SSPMSK(2) MSK7 MSK6 MSK5 MSK4 MSK3 MSK2 MSK1 MSK0 1111 1111 1111 1111
94h SSPSTAT SMP CKE D/A P S R/W UA BF 0000 0000 0000 0000
95h WPUB WPUB7 WPUB6 WPUB5 WPUB4 WPUB3 WPUB2 WPUB1 WPUB0 1111 1111 1111 1111
96h IOCB IOCB7 IOCB6 IOCB5 IOCB4 IOCB3 IOCB2 IOCB1 IOCB0 0000 0000 0000 0000
97h VRCON VREN VROE VRR VRSS VR3 VR2 VR1 VR0 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 -010
99h SPBRG BRG7 BRG6 BRG5 BRG4 BRG3 BRG2 BRG1 BRG0 0000 0000 0000 0000
9Ah SPBRGH BRG15 BRG14 BRG13 BRG12 BRG11 BRG10 BRG9 BRG8 0000 0000 0000 0000
9Bh PWM1CON PRSEN PDC6 PDC5 PDC4 PDC3 PDC2 PDC1 PDC0 0000 0000 0000 0000
9Ch ECCPAS ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0 PSSBD1 PSSBD0 0000 0000 0000 0000
9Dh PSTRCON STRSYNC STRD STRC STRB STRA ---0 0001 ---0 0001
9Eh ADRESL A/D Result Register Low Byte xxxx xxxx uuuu uuuu
9Fh ADCON1 ADFM VCFG1 VCFG0 0-00 ---- 0-00 ----
Legend: = Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: MCLR and WDT Reset do not affect the previous value data latch. The RBIF bit will be cleared upon Reset but will set again if the mismatch
exists.
2: Accessible only when SSPCON register bits SSPM<3:0> = 1001.
3: PIC16F884/PIC16F887 only.
4: If VDD goes too low, Power-on Reset will be activated and registers will be affected differently.
5: See Table 14-5 for Reset value for specific condition.
6: If Reset was due to brown-out, then bit 0 = 0. All other Resets will cause bit 0 = u.
Bank 2
100h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx xxxx xxxx
101h TMR0 Timer0 Module Register xxxx xxxx uuuu uuuu
102h PCL Program Counters (PC) Least Significant Byte 0000 0000 0000 0000
103h STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 000q quuu(3)
104h FSR Indirect Data Memory Address Pointer xxxx xxxx uuuu uuuu
105h WDTCON WDTPS3 WDTPS2 WDTPS1 WDTPS0 SWDTEN ---0 1000 ---0 1000
106h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx 0000 0000
107h CM1CON0 C1ON C1OUT C1OE C1POL C1R C1CH1 C1CH0 0000 -000 0000 0-00
108h CM2CON0 C2ON C2OUT C2OE C2POL C2R C2CH1 C2CH0 0000 -000 0000 0-00
109h CM2CON1 MC1OUT MC2OUT C1RSEL C2RSEL T1GSS C2SYNC 0000 --10 0000 0--0
10Ah PCLATH Write Buffer for the upper 5 bits of the Program Counter ---0 0000 ---0 0000
10Bh INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF(1) 0000 000x 0000 000u
10Ch EEDAT EEDAT7 EEDAT6 EEDAT5 EEDAT4 EEDAT3 EEDAT2 EEDAT1 EEDAT0 0000 0000 0000 0000
10Dh EEADR EEADR7 EEADR6 EEADR5 EEADR4 EEADR3 EEADR2 EEADR1 EEADR0 0000 0000 0000 0000
10Eh EEDATH EEDATH5 EEDATH4 EEDATH3 EEDATH2 EEDATH1 EEDATH0 --00 0000 --00 0000
10Fh EEADRH EEADRH4(2) EEADRH3 EEADRH2 EEADRH1 EEADRH0 ---- 0000 ---0 0000
Legend: = Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: MCLR and WDT Reset does not affect the previous value data latch. The RBIF bit will be cleared upon Reset but will set again if the
mismatch exists.
2: PIC16F886/PIC16F887 only.
3: See Table 14-5 for Reset value for specific condition.
Bank 3
180h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx xxxx xxxx
181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
182h PCL Program Counters (PC) Least Significant Byte 0000 0000 0000 0000
183h STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 000q quuu(3)
184h FSR Indirect Data Memory Address Pointer xxxx xxxx uuuu uuuu
185h SRCON SR1 SR0 C1SEN C2REN PULSS PULSR FVREN 0000 00-0 0000 00-0
186h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
187h BAUDCTL ABDOVF RCIDL SCKP BRG16 WUE ABDEN 01-0 0-00 01-0 0-00
188h ANSEL ANS7(2) ANS6(2) ANS5(2) ANS4 ANS3 ANS2 ANS1 ANS0 1111 1111 1111 1111
189h ANSELH ANS13 ANS12 ANS11 ANS10 ANS9 ANS8 --11 1111 1111 1111
18Ah PCLATH Write Buffer for the upper 5 bits of the Program Counter ---0 0000 ---0 0000
18Bh INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF(1) 0000 000x 0000 000u
18Ch EECON1 EEPGD WRERR WREN WR RD x--- x000 ---- q000
18Dh EECON2 EEPROM Control Register 2 (not a physical register) ---- ---- ---- ----
Legend: = Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: MCLR and WDT Reset does not affect the previous value data latch. The RBIF bit will be cleared upon Reset but will set again if the
mismatch exists.
2: PIC16F884/PIC16F887 only.
3: See Table 14-5 for Reset value for specific condition.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7 IRP: Register Bank Select bit (used for indirect addressing)
1 = Bank 2, 3 (100h-1FFh)
0 = Bank 0, 1 (00h-FFh)
bit 6-5 RP<1:0>: Register Bank Select bits (used for direct addressing)
00 = Bank 0 (00h-7Fh)
01 = Bank 1 (80h-FFh)
10 = Bank 2 (100h-17Fh)
11 = Bank 3 (180h-1FFh)
bit 4 TO: Time-out bit
1 = After power-up, CLRWDT instruction or SLEEP instruction
0 = A WDT time-out occurred
bit 3 PD: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
bit 2 Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1 DC: Digit Carry/Borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions)(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 C: Carry/Borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)(1)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the twos complement of the second
operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order bit of the
source register.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: BOREN<1:0> = 01 in the Configuration Word Register 1 for this bit to control the BOR.
Data
Memory
7Fh 1FFh
Bank 0 Bank 1 Bank 2 Bank 3
Note: For memory map detail, see Figures 2-2 and 2-3.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and
interrupt-on-change if available. The corresponding TRIS bit must be set to Input mode in order to allow
external control of the voltage on the pin.
2: Not implemented on PIC16F883/886.
D Q
WR CK Q I/O Pin
PORTA
VSS
-
+ VTRG
D Q
WR CK Q
TRISA IULP
0 1
RD
TRISA Analog(1) VSS
Input Mode
ULPWUE
RD
PORTA
To Comparator
To A/D Converter
WR Data Bus
CK Q
PORTA VROE
CVREF
VDD
I/O Pin D Q
D Q WR CK Q
PORTA
WR CK
TRISA Q VSS
I/O Pin
Analog(1)
Input Mode D Q
RD
TRISA WR CK
TRISA Q VSS
RD Analog(1)
PORTA RD Input Mode
TRISA
To Comparator
RD
PORTA
To A/D Converter
To Comparator (VREF-)
WR CK 0 I/O Pin
PORTA Q
D Q
I/O Pin WR CK
TRISA Q VSS
D Q
WR CK
TRISA Q VSS RD
TRISA
Analog(1)
RD Input Mode
TRISA
RD
PORTA
RD
PORTA To Timer0
To Comparator (VREF+)
RD
PORTA RD
PORTA
To SS Input
To A/D Converter
Note 1: ANSEL determines Analog Input mode. Note 1: With I/O option.
WR CK Q
PORTA
I/O Pin
D Q
WR CK Q
TRISA VSS
INTOSC
RD Mode
TRISA
RD
PORTA
CLKIN
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and
interrupt-on-change if available. The corresponding TRIS bit must be set to Input mode in order to allow
external control of the voltage on the pin.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
only. WR CK Q Q D
IOCB
EN Q3
3.4.4.3 RB2/AN8/P1B(1)
RD
Figure 3-9 shows the diagram for this pin. This pin is IOCB Q D
configurable to function as one of the following:
EN
a general purpose I/O Interrupt-on-
Change
an analog input for the ADC
a PWM output(1) RD PORTB
Note 1: P1B is available on PIC16F882/883/886
only. RB0/INT
RB3/PGM
3.4.4.4 RB3/AN9/PGM/C12IN2- To A/D Converter
Figure 3-9 shows the diagram for this pin. This pin is
configurable to function as one of the following: To Comparator (RB1, RB3)
3.4.4.6 RB5/AN13/T1G
Figure 3-10 shows the diagram for this pin. This pin is
configurable to function as one of the following:
a general purpose I/O
an analog input for the ADC
a Timer1 gate input
3.4.4.7 RB6/ICSPCLK
Figure 3-10 shows the diagram for this pin. This pin is
configurable to function as one of the following:
a general purpose I/O
In-Circuit Serial Programming clock
3.4.4.8 RB7/ICSPDAT
Figure 3-10 shows the diagram for this pin. This pin is
configurable to function as one of the following:
a general purpose I/O
In-Circuit Serial Programming data
RD CCP1OUT Enable
WPUB VDD
D Q CCP1OUT
0
11
WR CK
PORTB Q
1
00 I/O Pin
D Q
WR CK VSS
TRISB Q
RD
TRISB Analog(1)
Input Mode
RD
PORTB
D Q
Q D ICSP(2)
WR CK Q
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
To Timer1 T1G(3)
To A/D Converter
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
I/O Pin
D Q 0
1
I/O Pin
D Q
WR CK
TRISC Q VSS WR CK
TRISC Q VSS
RD
TRISC RD
TRISC
RD
PORTC RD
PORTC
To Enhanced CCP1
To Timer1 clock input
3.5.2 RC1/T1OSI/CCP2
Figure 3-12 shows the diagram for this pin. This pin is
configurable to function as one of the following:
a general purpose I/O
a Timer1 oscillator input
a Capture input and Compare/PWM output for
Comparator C2
CCP2CON VDD
D Q
WR CK Q CCP2 1
0
PORTC
0
1 I/O Pin
D Q
WR CK
TRISC Q VSS
T1OSCEN
RD
TRISC
RD
PORTC
To CCP2
RD RD
TRISC TRISC
RD RD
PORTC PORTC
To SSPSR
3.5.5 RC4/SDI/SDA
Figure 3-15 shows the diagram for this pin. This pin is
configurable to function as one of the following:
a general purpose I/O
a SPI data I/O
an I2C data I/O
SSPEN
VDD
D Q
SDI/SDA
1
0
WR CK Q
PORTC
0
1
I/O Pin
D Q
WR CK Q
TRISC VSS
RD
TRISC
RD
PORTC
To SSPSR
FIGURE 3-17: BLOCK DIAGRAM OF RC6 FIGURE 3-18: BLOCK DIAGRAM OF RC7
SPEN SPEN
TXEN SYNC
Data Bus
SYNC
EUSART VDD
Data Bus CK 1 D Q EUSART
0
DT
EUSART 1
0
WR CK Q
TX 0
1 PORTC
VDD
D Q 0
1
1
0 I/O Pin
WR CK Q D Q
PORTC
0
1 WR CK Q
I/O Pin TRISC VSS
D Q
RD
WR CK Q
VSS TRISC
TRISC
RD RD
TRISC PORTC
EUSART RX/DT
RD
PORTC
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
WR CK Q CCP1 1
0
PORTD
3.6.2 RD5/P1B(1)
Figure 3-20 shows the diagram for this pin. This pin is 0
1 I/O Pin
D Q
configurable to function as one of the following:
WR CK
a general purpose I/O TRISD Q VSS
a PWM output
RD
Note 1: RD5/P1B is available on PIC16F884/887 TRISD
only. See RB2/AN8/P1B for this function
on PIC16F882/883/886. RD
PORTD
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
3.7.3 RE2/AN7(1)
This pin is configurable to function as one of the
following:
a general purpose I/O
an analog input for the ADC
Note 1: RE2/AN7 is available on PIC16F884/887
only.
VDD
D Q
WR CK
PORTE Q
I/O Pin
D Q
WR CK
TRISE Q VSS
Analog(1)
RD Input Mode
TRISE
RD
PORTE
To A/D Converter
FOSC<2:0>
(Configuration Word Register 1)
External Oscillator SCS<0>
(OSCCON Register)
OSC2
Sleep
LP, XT, HS, RC, RCIO, EC
OSC1
MUX
IRCF<2:0>
(OSCCON Register) System Clock
(CPU and Peripherals)
8 MHz
111 INTOSC
Internal Oscillator 4 MHz
110
2 MHz
101
Postscaler
1 MHz
MUX
HFINTOSC 100
500 kHz
8 MHz 011
250 kHz
010
125 kHz
001
LFINTOSC 31 kHz
000
31 kHz
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Bit resets to 0 with Two-Speed Start-up and LP, XT or HS selected as the Oscillator mode or Fail-Safe
mode is enabled.
OSC1/CLKIN
PIC MCU
C1 To Internal
OSC1/CLKIN Logic
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
HFINTOSC
Start-up Time 2-cycle Sync Running
LFINTOSC
IRCF <2:0> 0 0
System Clock
HFINTOSC
2-cycle Sync Running
LFINTOSC
IRCF <2:0> 0 0
System Clock
LFINTOSC HFINTOSC
LFINTOSC turns off unless WDT or FSCM is enabled
LFINTOSC
Start-up Time 2-cycle Sync Running
HFINTOSC
IRCF <2:0> =0 0
System Clock
HFINTOSC
TOST
OSC2
Program Counter PC - N PC PC + 1
System Clock
Sample Clock
System Oscillator
Clock Failure
Output
Note: 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.
FOSC/4
Data Bus
0
8
1
Sync
1 2 Tcy TMR0
T0CKI 0
pin 0
T0SE T0CS Set Flag bit T0IF
8-bit
on Overflow
Prescaler PSA
1
8
WDTE PSA
SWDTEN
PS<2:0> 1
WDT
16-bit Time-out
Prescaler 0
16
31 kHz Watchdog
INTOSC Timer PSA
WDTPS<3:0>
Note 1: T0SE, T0CS, PSA, PS<2:0> are bits in the OPTION register.
2: SWDTEN and WDTPS<3:0> are bits in the WDTCON register.
3: WDTE bit is in the Configuration Word Register1.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: A dedicated 16-bit WDT postscaler is available. See Section 14.5 Watchdog Timer (WDT) for more
information.
TMR1GE
T1GINV
TMR1ON
Set flag bit
TMR1IF on To C2 Comparator Module
Overflow TMR1(2) Timer1 Clock
Synchronized
EN 0 clock input
TMR1H TMR1L
1
Oscillator
(1) T1SYNC
T1OSO/T1CKI 1
Prescaler Synchronize(3)
1, 2, 4, 8 det
0
T1OSI 2
T1CKPS<1:0>
TMR1CS
T1G 1
INTOSC
Without CLKOUT SYNCC2OUT(4) 0
T1OSCEN FOSC/4
Internal T1GSS
Clock
Note 1: ST Buffer is low power type when using LP osc, or high speed type when using T1CKI.
2: Timer1 register increments on rising edge.
3: Synchronize does not operate while in Sleep.
4: SYNCC2OUT is synchronized when the C2SYNC bit of the CM2CON1 register is set.
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: T1GINV bit inverts the Timer1 gate logic, regardless of source.
2: TMR1GE bit must be set to use either T1G pin or C2OUT, as selected by the T1GSS bit of the CM2CON1
register, as a Timer1 gate source.
Sets Flag
TMR2
bit TMR2IF
Output
Prescaler Reset
FOSC/4 TMR2
1:1, 1:4, 1:16
2 Postscaler
Comparator
EQ 1:1 to 1:16
T2CKPS<1:0>
PR2 4
TOUTPS<3:0>
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
C1CH<1:0>
2 C1POL To
D Q Data Bus
Q1
C12IN0- 0 EN
RD_CM1CON0
C12IN1- 1
MUX Set C1IF
C12IN2- D Q
2
Q3*RD_CM1CON0
EN
C12IN3- 3 To PWM Logic
CL
Reset
C1ON(1)
C1R
C1VIN- -
C1IN+ 0 C1 C1OUT
MUX C1VIN+
+
FixedRef 1 C1OUT (to SR Latch)
0
MUX C1POL
CVREF 1 C1VREF
C1RSEL
Note 1: When C1ON = 0, the C1 comparator will produce a 0 output to the XOR Gate.
2: Q1 and Q3 are phases of the four-phase system clock (FOSC).
3: Q1 is held high during Sleep mode.
C2POL To
D Q Data Bus
Q1
EN
RD_CM2CON0
C2CH<1:0> Set C2IF
2 D Q
Q3*RD_CM2CON0
EN
C12IN0- 0 C2ON(1)
CL
C12IN1- 1 Reset
MUX C2VIN-
C12IN2- 2 C2 C2OUT
C2VIN+
C12IN3- 3 C2SYNC
C2POL 0
C2R SYNCC2OUT
MUX
D Q 1 To Timer1 Gate, SR Latch,
C2IN+ 0 PWM Logic, and other
MUX From Timer1
Clock peripherals
FixedRef 1
0
MUX
CVREF 1 C2VREF
C2RSEL
Note 1: When C2ON = 0, the C2 comparator will produce a 0 output to the XOR Gate.
2: Q1 and Q3 are phases of the four-phase system clock (FOSC).
3: Q1 is held high during Sleep mode.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Comparator output requires the following three conditions: C1OE = 1, C1ON = 1 and corresponding port
TRIS bit = 0.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Comparator output requires the following three conditions: C2OE = 1, C2ON = 1 and corresponding port
TRIS bit = 0.
VDD
VT 0.6V RIC
Rs < 10K
To ADC Input
AIN
CPIN ILEAKAGE(1)
VA VT 0.6V 500 nA
5 pF
Vss
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
SR0
C1OE
PULSS Pulse
Gen(2)
0
C1OUT (from comparator) MUX
S Q 1
C1OUT pin(3)
C1SEN
SR
Latch(1) C2OE
SYNCC2OUT (from comparator)
C2REN R Q 1
MUX
0 C2OUT pin(3)
Note 1: The CxOUT bit in the CMxCON0 register will always reflect the actual comparator output (not the level on
the pin), regardless of the SR latch operation.
2: To enable an SR Latch output to the pin, the appropriate CxOE and TRIS bits must be properly
configured.
Independent from Comparator operation This allows the comparator to detect a zero-crossing
while not consuming additional CVREF module current.
Two 16-level voltage ranges
Output clamped to VSS Note: Depending on the application, additional
Ratiometric with VDD components may be required for a zero
cross circuit. Reference TB3013, Using
Fixed Reference (0.6V)
the ESD Parasitic Diodes on Mixed Signal
The VRCON register (Register 8-5) controls the Microcontrollers (DS93013), for more
voltage reference module shown in Figure 8-8. information.
The voltage source is selectable through both ends of
the 16 connection resistor ladder network. Bit VRSS of 8.10.4 OUTPUT RATIOMETRIC TO VDD
the VRCON register selects either the internal or The comparator voltage reference is VDD derived and
external voltage source. therefore, the CVREF output changes with fluctuations in
The PIC16F882/883/884/886/887 allows the CVREF VDD. The tested absolute accuracy of the Comparator
signal to be output to the RA2 pin of PORTA under Voltage Reference can be found in Section 17.0
certain configurations only. For more details, see Electrical Specifications.
Figure 8-9.
8.10.5 FIXED VOLTAGE REFERENCE
8.10.1 INDEPENDENT OPERATION The fixed voltage reference is independent of VDD, with
The comparator voltage reference is independent of a nominal output voltage of 0.6V. This reference can be
the comparator configuration. Setting the VREN bit of enabled by setting the FVREN bit of the SRCON
the VRCON register will enable the voltage reference. register to 1. This reference is always enabled when
the HFINTOSC oscillator is active.
8.10.2 OUTPUT VOLTAGE SELECTION
8.10.6 FIXED VOLTAGE REFERENCE
The CVREF voltage reference has 2 ranges with 16
voltage levels in each range. Range selection is STABILIZATION PERIOD
controlled by the VRR bit of the VRCON register. The When the fixed voltage reference module is enabled, it
16 levels are set with the VR<3:0> bits of the VRCON will require some time for the reference and its amplifier
register. circuits to stabilize. The user program must include a
The CVREF output voltage is determined by the following small delay routine to allow the module to settle. See
equations: Section 17.0 Electrical Specifications for the
minimum delay requirement.
EQUATION 8-1: CVREF OUTPUT VOLTAGE 8.10.7 VOLTAGE REFERENCE
V RR = 1 (low range): SELECTION
CVREF = (VR<3:0>/24) V LADDER Multiplexers on the output of the voltage reference
module enable selection of either the CVREF or fixed
V RR = 0 (high range):
voltage reference for use by the comparators.
CV REF = (VLADDER/4) + (VR<3:0> VLADDER/32)
Setting the C1RSEL bit of the CM2CON1 register
V LADDER = V DD or ([VREF+] - [VREF-]) or VREF+ enables current to flow in the CVREF voltage divider
and selects the CVREF voltage for use by C1. Clearing
the C1RSEL bit selects the fixed voltage for use by C1.
The full range of VSS to VDD cannot be realized due to
the construction of the module. See Figure 8-8. Setting the C2RSEL bit of the CM2CON1 register
enables current to flow in the CVREF voltage divider
and selects the CVREF voltage for use by C2. Clearing
the C2RSEL bit selects the fixed voltage for use by C2.
When both the C1RSEL and C2RSEL bits are cleared,
current flow in the CVREF voltage divider is disabled
minimizing the power drain of the voltage reference
peripheral.
16 Stages
VREF+
VRSS = 1 8R R R R R
VRSS = 0
VDD 8R VRR
Analog
MUX
VREF-
VRSS = 1
15
CVREF
VRSS = 0
To Comparators
and ADC Module 0
VR<3:0>
VROE
4
VREN
CVREF C1RSEL
C2RSEL FVREN
Sleep
HFINTOSC enable
EN
FixedRef 0.6V Fixed Voltage
To Comparators Reference
and ADC Module
VREF+
AVDD 1 AVDD 1
0 0
VRSS VCFG0
CVREF
Comparator ADC
Voltage Voltage
VROE
Reference Reference
VCFG1
VRSS
0
0 AVSS 1
AVSS 1 VCFG1
VREF-
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
TABLE 8-3: SUMMARY OF REGISTERS ASSOCIATED WITH THE COMPARATOR AND VOLTAGE
REFERENCE MODULES
Register on
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Page
ANSEL ANS7 ANS6 ANS5 ANS4 ANS3 ANS2 ANS1 ANS0 42
ANSELH ANS13 ANS12 ANS11 ANS10 ANS9 ANS8 50
CM1CON0 C1ON C1OUT C1OE C1POL C1R C1CH1 C1CH0 93
CM2CON0 C2ON C2OUT C2OE C2POL C2R C2CH1 C2CH0 94
CM2CON1 MC1OUT MC2OUT C1RSEL C2RSEL T1GSS C2SYNC 96
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 33
PIE2 OSFIE C2IE C1IE EEIE BCLIE ULPWUIE CCP2IE 35
PIR2 OSFIF C2IF C1IF EEIF BCLIF ULPWUIF CCP2IF 37
PORTA RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0 41
PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 50
SRCON SR1 SR0 C1SEN C2SEN PULSS PULSR FVREN 98
TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 41
TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 50
VRCON VREN VROE VRR VRSS VR3 VR2 VR1 VR0 102
Legend: x = unknown, u = unchanged, = unimplemented, read as 0. Shaded cells are not used for comparator.
VCFG1 = 0
AVSS
VREF- VCFG1 = 1
AVDD
VCFG0 = 0
VREF+ VCFG0 = 1
AN0 0000
AN1 0001
AN2 0010
AN3 0011
AN4 0100
AN5 0101
AN6 0110
AN7 0111
ADC
AN8 1000
GO/DONE 10
AN9 1001
AN10 1010
0 = Left Justify
ADFM
AN11 1011 1 = Right Justify
AN12 1100 ADON 10
AN13 1101
VSS ADRESH ADRESL
CVREF 1110
FixedRef 1111
CHS<3:0>
TCY to TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Conversion Starts
Holding Capacitor is Disconnected from Analog Input (typically 100 ns)
9.1.5 INTERRUPTS
The ADC module allows for the ability to generate an
interrupt upon completion of an Analog-to-Digital
conversion. The ADC interrupt flag is the ADIF bit in the
PIR1 register. The ADC interrupt enable is the ADIE bit
in the PIE1 register. The ADIF bit must be cleared in
software.
Note: The ADIF bit is set at the completion of
every conversion, regardless of whether
or not the ADC interrupt is enabled.
This interrupt can be generated while the device is
operating or while in Sleep. If the device is in Sleep, the
interrupt will wake-up the device. Upon waking from
Sleep, the next instruction following the SLEEP
instruction is always executed. If the user is attempting
to wake-up from Sleep and resume in-line code
execution, the global interrupt must be disabled. If the
global interrupt is enabled, execution will switch to the
Interrupt Service Routine.
Please see Section 14.3 Interrupts for more
information.
ADRESH ADRESL
(ADFM = 0) MSB LSB
bit 7 bit 0 bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
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
1
V AP PLIE D 1 -------------------------- = V CHOLD ;[1] VCHOLD charged to within 1/2 lsb
n + 1
2 1
TC
----------
RC ;[2] VCHOLD charge response to VAPPLIED
V AP P LI ED 1 e = V CHOLD
Tc
---------
1
V AP P LIED 1 e = V A P PLIE D 1 --------------------------
RC
;combining [1] and [2]
n+1
2 1
T C = C HOLD R IC + R SS + R S ln(1/2047)
= 10pF 1k + 7k + 10k ln(0.0004885)
= 1.37 s
Therefore:
T ACQ = 2S + 1.37 S + 50C- 25C 0.05S /C
= 4.67 S
Note 1: The reference voltage (VREF) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
VA CPIN I LEAKAGE(1)
VT = 0.6V CHOLD = 10 pF
5 pF 500 nA
VSS/VREF-
6V
5V RSS
Legend: CPIN = Input Capacitance VDD 4V
VT = Threshold Voltage 3V
I LEAKAGE = Leakage current at the pin due to 2V
various junctions
RIC = Interconnect Resistance 5 6 7 8 9 10 11
SS = Sampling Switch Sampling Switch
CHOLD = Sample/Hold Capacitance (k)
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
ADC Output Code
1 LSB ideal
3FBh
Full-Scale
004h Transition
003h
002h
001h
000h Analog Input Voltage
1 LSB ideal
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7-0 EEDAT<7:0>: 8 Least Significant Address bits to Write to or Read from data EEPROM or Read from program memory
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7-0 EEADR<7:0>: 8 Least Significant Address bits for EEPROM Read/Write Operation(1) or Read from program memory
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
S = Bit can only be set
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
MOVLW AAh ;
MOVWF EECON2 ;Write AAh
BSF EECON1, WR ;Set WR bit to begin write
BSF INTCON, GIE ;Enable INTs.
;
;First instruction after BSF EECON1,RD executes normally
NOP
NOP ;Any instructions here are ignored as program
;memory is read in second cycle after BSF EECON1,RD
;
BANKSEL EEDAT ;
MOVF EEDAT, W ;W = LS Byte of Program Memory
MOVWF LOWPMBYTE ;
MOVF EEDATH, W ;W = MS Byte of Program EEDAT
MOVWF HIGHPMBYTE ;
BCF STATUS, RP1 ;Bank 0
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 Data INSTR (PC) INSTR (PC + 1) EEDATH,EEDAT INSTR (PC + 3) INSTR (PC + 4)
RD bit
EEDATH
EEDAT
Register
EERHLT
14 14 14 14
Program Memory
14 14 14 14
Program Memory
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
FIGURE 11-3: SIMPLIFIED PWM BLOCK When TMR2 is equal to PR2, the following three events
DIAGRAM occur on the next increment cycle:
CCPxCON<5:4>
TMR2 is cleared
Duty Cycle Registers The CCPx pin is set. (Exception: If the PWM duty
CCPRxL
cycle = 0%, the pin will not be set.)
The PWM duty cycle is latched from CCPRxL into
CCPRxH.
(1) S
TMR2
TRIS
Comparator
Clear Timer2,
toggle CCPx pin and
latch duty cycle
PR2
CCPRxL:CCPxCON<5:4>
Duty Cycle Ratio = -----------------------------------------------------------------------
4 PR2 + 1
FIGURE 11-5: EXAMPLE SIMPLIFIED BLOCK DIAGRAM OF THE ENHANCED PWM MODE
DC1B<1:0> P1M<1:0> CCP1M<3:0>
Duty Cycle Registers
2 4
CCPR1L
CCP1/P1A CCP1/P1A
TRISn
CCPR1H (Slave)
P1B P1B
Output TRISn
Comparator R Q
Controller
P1C P1C
TMR2 (1)
S TRISn
P1D P1D
Comparator
Clear Timer2, TRISn
toggle PWM pin and
latch duty cycle
PR2 PWM1CON
Note 1: The 8-bit timer TMR2 register is concatenated with the 2-bit internal Q clock, or 2 bits of the prescaler to create the 10-bit
time base.
Note 1: The TRIS register value for each PWM output must be configured appropriately.
2: Clearing the CCPxCON register will relinquish ECCP control of all PWM output pins.
3: Any pin not used by an Enhanced PWM mode is available for alternate pin functions.
TABLE 11-5: EXAMPLE PIN ASSIGNMENTS FOR VARIOUS PWM ENHANCED MODES
ECCP Mode P1M<1:0> CCP1/P1A P1B P1C P1D
Single 00 Yes(1) Yes(1) Yes(1) Yes(1)
Half-Bridge 10 Yes Yes No No
Full-Bridge, Forward 01 Yes Yes Yes Yes
Full-Bridge, Reverse 11 Yes Yes Yes Yes
Note 1: Pulse Steering enables outputs in Single mode.
P1A Active
P1D Modulated
P1A Inactive
P1D Inactive
Relationships:
Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
Pulse Width = TOSC * (CCPR1L<7:0>:CCP1CON<5:4>) * (TMR2 Prescale Value)
Delay = 4 * TOSC * (PWM1CON<6:0>)
Note 1: Dead-band delay is programmed using the PWM1CON register (Section 11.6.6 Programmable Dead-Band Delay
Mode).
Pulse PR2+1
P1M<1:0> Signal 0
Width
Period
P1A Modulated
Delay(1) Delay(1)
10 (Half-Bridge) P1B Modulated
P1A Active
P1D Modulated
P1A Inactive
P1D Inactive
Relationships:
Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
Pulse Width = TOSC * (CCPR1L<7:0>:CCP1CON<5:4>) * (TMR2 Prescale Value)
Delay = 4 * TOSC * (PWM1CON<6:0>)
Note 1: Dead-band delay is programmed using the PWM1CON register (Section 11.6.6 Programmable Dead-Band Delay
Mode).
FET
Driver +
P1A
-
Load
FET
Driver
+
P1B
-
V+
FET FET
Driver Driver
P1A
Load
FET FET
Driver Driver
P1B
FET QA QC FET
Driver Driver
P1A
Load
P1B
FET FET
Driver Driver
P1C
QB QD
V-
P1D
P1B(2)
P1C(2)
P1D(2)
(1) (1)
Reverse Mode
Period
Pulse Width
P1A(2)
P1B(2)
P1C(2)
P1D(2)
(1) (1)
Note 1: At this time, the TMR2 register is equal to the PR2 register.
2: Output signal is shown as active-high.
P1A (Active-High)
P1B (Active-High)
Pulse Width
P1C (Active-High)
(2)
P1D (Active-High)
Pulse Width
Note 1: The direction bit P1M1 of the CCP1CON register is written any time during the PWM cycle.
2: When changing directions, the P1A and P1C signals switch before the end of the current PWM cycle. The
modulated P1B and P1D signals are inactive at this time. The length of this time is (1/Fosc) TMR2 prescale
value.
P1A
P1B
PW
P1C
P1D PW
TON
External Switch C
TOFF
External Switch D
ECCPAS<2:0>
PSSAC<0>
1
P1A_DRV
111 0
110
101 PSSAC<1>
100 P1A
TRISx
INT
011
From Comparator C2
010
PSSBD<0>
1
From Comparator C1 001 P1B_DRV
0
000 PRSEN
PSSBD<1>
R S P1B
TRISx
From Data Bus ECCPASE
D Q
Write to ECCPASE
PSSAC<0>
1
P1C_DRV
0
PSSAC<1>
P1C
TRISx
PSSBD<0>
1
P1D_DRV
0
PSSBD<1>
P1D
TRISx
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Shutdown Event
ECCPASE bit
PWM Activity
PWM Period
ECCPASE
Cleared by
Start of Shutdown Shutdown Firmware PWM
PWM Period Event Occurs Event Clears Resumes
Shutdown Event
ECCPASE bit
PWM Activity
PWM Period
FET
Driver +
P1A V
-
Load
FET
Driver
+
P1B V
-
V-
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: The PWM Steering mode is available only when the CCP1CON register bits CCP1M<3:2> = 11 and
P1M<1:0> = 00.
PORT Data
0
TRIS
STRB
PORT Data 0
TRIS
STRC
1 P1C pin
CCP1M1
PORT Data 0
TRIS
STRD
PORT Data 0
TRIS
PWM Period
PWM
STRn
P1n = PWM
PWM
STRn
P1n = PWM
TXEN
TRMT SPEN
Baud Rate Generator FOSC
n
TX9
BRG16 n
+1 Multiplier x4 x16 x64
TX9D
SYNC 1 X 0 0 0
SPBRGH SPBRG BRGH X 1 1 0 0
BRG16 X 1 0 1 0
BRG16
+1 n
Multiplier x4 x16 x64
SYNC 1 X 0 0 0
SPBRGH SPBRG BRGH X 1 1 0 0 FIFO
FERR RX9D RCREG Register
BRG16 X 1 0 1 0
8
Data Bus
RCIF Interrupt
RCIE
Write to TXREG
Word 1
BRG Output
(Shift Clock)
TX/CK
pin Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXIF bit
(Transmit Buffer 1 TCY
Reg. Empty Flag)
Word 1
TRMT bit
Transmit Shift Reg
(Transmit Shift
Reg. Empty Flag)
Write to TXREG
Word 1 Word 2
BRG Output
(Shift Clock)
TX/CK
pin Start bit bit 0 bit 1 bit 7/8 Stop bit Start bit bit 0
TXIF bit 1 TCY Word 1 Word 2
(Transmit Buffer
Reg. Empty Flag) 1 TCY
CREN = 1 Immediately after all data bits and the Stop bit have
been received, the character in the RSR is transferred
SYNC = 0
to the EUSART receive FIFO and the RCIF interrupt
SPEN = 1 flag bit of the PIR1 register is set. The top character in
All other EUSART control bits are assumed to be in the FIFO is transferred out of the FIFO by reading the
their default state. RCREG register.
Setting the CREN bit of the RCSTA register enables the Note: If the receive FIFO is overrun, no additional
receiver circuitry of the EUSART. Clearing the SYNC bit characters will be received until the overrun
of the TXSTA register configures the EUSART for asyn- condition is cleared. See Section 12.1.2.5
chronous operation. Setting the SPEN bit of the RCSTA Receive Overrun Error for more
register enables the EUSART and automatically config- information on overrun errors.
ures the RX/DT I/O pin as an input. If the RX/DT pin is
shared with an analog peripheral the analog I/O function 12.1.2.3 Receive Interrupts
must be disabled by clearing the corresponding ANSEL
The RCIF interrupt flag bit of the PIR1 register is set
bit.
whenever the EUSART receiver is enabled and there is
Note: When the SPEN bit is set the TX/CK I/O an unread character in the receive FIFO. The RCIF
pin is automatically configured as an interrupt flag bit is read-only, it cannot be set or cleared
output, regardless of the state of the by software.
corresponding TRIS bit and whether or RCIF interrupts are enabled by setting all of the
not the EUSART transmitter is enabled. following bits:
The PORT latch is disconnected from the
output driver so it is not possible to use the RCIE interrupt enable bit of the PIE1 register
TX/CK pin as a general purpose output. PEIE peripheral interrupt enable bit of the
INTCON register
GIE global interrupt enable bit of the INTCON
register
The RCIF interrupt flag bit will be set when there is an
unread character in the FIFO, regardless of the state of
interrupt enable bits.
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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
BAUD FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300 0.16 207 300 0.00 191 300 0.16 103 300 0.16 51
1200 1202 0.16 51 1200 0.00 47 1202 0.16 25 1202 0.16 12
2400 2404 0.16 25 2400 0.00 23 2404 0.16 12
9600 9600 0.00 5
10417 10417 0.00 5 10417 0.00 2
19.2k 19.20k 0.00 2
57.6k 57.60k 0.00 0
115.2k
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 11.0592 MHz FOSC = 8.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300
1200
2400 2404 0.16 207
9600 9615 0.16 129 9600 0.00 119 9600 0.00 71 9615 0.16 51
10417 10417 0.00 119 10378 -0.37 110 10473 0.53 65 10417 0.00 47
19.2k 19.23k 0.16 64 19.20k 0.00 59 19.20k 0.00 35 19231 0.16 25
57.6k 56.82k -1.36 21 57.60k 0.00 19 57.60k 0.00 11 55556 -3.55 8
115.2k 113.64k -1.36 10 115.2k 0.00 9 115.2k 0.00 5
BAUD FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300 0.16 207
1200 1202 0.16 207 1200 0.00 191 1202 0.16 103 1202 0.16 51
2400 2404 0.16 103 2400 0.00 95 2404 0.16 51 2404 0.16 25
9600 9615 0.16 25 9600 0.00 23 9615 0.16 12
10417 10417 0.00 23 10473 0.53 21 10417 0.00 11 10417 0.00 5
19.2k 19.23k 0.16 12 19.2k 0.00 11
57.6k 57.60k 0.00 3
115.2k 115.2k 0.00 1
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 11.0592 MHz FOSC = 8.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300.0 -0.01 4166 300.0 0.00 3839 300.0 0.00 2303 299.9 -0.02 1666
1200 1200 -0.03 1041 1200 0.00 959 1200 0.00 575 1199 -0.08 416
2400 2399 -0.03 520 2400 0.00 479 2400 0.00 287 2404 0.16 207
9600 9615 0.16 129 9600 0.00 119 9600 0.00 71 9615 0.16 51
10417 10417 0.00 119 10378 -0.37 110 10473 0.53 65 10417 0.00 47
19.2k 19.23k 0.16 64 19.20k 0.00 59 19.20k 0.00 35 19.23k 0.16 25
57.6k 56.818 -1.36 21 57.60k 0.00 19 57.60k 0.00 11 55556 -3.55 8
115.2k 113.636 -1.36 10 115.2k 0.00 9 115.2k 0.00 5
BAUD FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300.1 0.04 832 300.0 0.00 767 299.8 -0.108 416 300.5 0.16 207
1200 1202 0.16 207 1200 0.00 191 1202 0.16 103 1202 0.16 51
2400 2404 0.16 103 2400 0.00 95 2404 0.16 51 2404 0.16 25
9600 9615 0.16 25 9600 0.00 23 9615 0.16 12
10417 10417 0.00 23 10473 0.53 21 10417 0.00 11 10417 0.00 5
19.2k 19.23k 0.16 12 19.20k 0.00 11
57.6k 57.60k 0.00 3
115.2k 115.2k 0.00 1
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 11.0592 MHz FOSC = 8.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300.0 0.00 16665 300.0 0.00 15359 300.0 0.00 9215 300.0 0.00 6666
1200 1200 -0.01 4166 1200 0.00 3839 1200 0.00 2303 1200 -0.02 1666
2400 2400 0.02 2082 2400 0.00 1919 2400 0.00 1151 2401 0.04 832
9600 9597 -0.03 520 9600 0.00 479 9600 0.00 287 9615 0.16 207
10417 10417 0.00 479 10425 0.08 441 10433 0.16 264 10417 0 191
19.2k 19.23k 0.16 259 19.20k 0.00 239 19.20k 0.00 143 19.23k 0.16 103
57.6k 57.47k -0.22 86 57.60k 0.00 79 57.60k 0.00 47 57.14k -0.79 34
115.2k 116.3k 0.94 42 115.2k 0.00 39 115.2k 0.00 23 117.6k 2.12 16
BAUD FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 300.0 0.01 3332 300.0 0.00 3071 299.9 -0.02 1666 300.1 0.04 832
1200 1200 0.04 832 1200 0.00 767 1199 -0.08 416 1202 0.16 207
2400 2398 0.08 416 2400 0.00 383 2404 0.16 207 2404 0.16 103
9600 9615 0.16 103 9600 0.00 95 9615 0.16 51 9615 0.16 25
10417 10417 0.00 95 10473 0.53 87 10417 0.00 47 10417 0.00 23
19.2k 19.23k 0.16 51 19.20k 0.00 47 19.23k 0.16 25 19.23k 0.16 12
57.6k 58.82k 2.12 16 57.60k 0.00 15 55.56k -3.55 8
115.2k 111.1k -3.55 8 115.2k 0.00 7
BRG Clock
RCIDL
RCIF bit
(Interrupt)
Read
RCREG
Note 1: The ABD sequence requires the EUSART module to be configured in Asynchronous mode
RCIF
Cleared due to User Read of RCREG
Note 1: The EUSART remains in Idle while the WUE bit is set.
Note 1: 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.
2: The EUSART remains in Idle while the WUE bit is set.
Write to TXREG
Dummy Write
BRG Output
(Shift Clock)
RX/DT
pin bit 0 bit 1 bit 2 bit 7 bit 0 bit 1 bit 7
Word 1 Word 2
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
1 1
TXEN bit
Note: Sync Master mode, SPBRG = 0, continuous transmission of two 8-bit words.
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
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 0
RCIF bit
(Interrupt)
Read
RXREG
Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7 GCEN: General Call Enable bit (in I2C Slave mode only)
1 = Enable interrupt when a general call address (0000h) is received in the SSPSR
0 = General call address disabled
bit 6 ACKSTAT: Acknowledge Status bit (in I2C Master mode only)
In Master Transmit mode:
1 = Acknowledge was not received from slave
0 = Acknowledge was received from slave
bit 5 ACKDT: Acknowledge Data bit (in I2C Master mode only)
In Master Receive mode:
Value transmitted when the user initiates an Acknowledge sequence at the end of a receive
1 = Not Acknowledge
0 = Acknowledge
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 RCEN: Receive Enable bit (in I2C Master mode only)
1 = Enables Receive mode for I2C
0 = Receive idle
bit 2 PEN: Stop Condition Enable bit (in I2C Master mode only)
SCK 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 Enabled 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 SEN: Start Condition Enabled bit (in I2C Master mode only)
In Master mode:
1 = Initiate Start condition on SDA and SCL pins. Automatically cleared by hardware.
0 = Start condition Idle
In Slave mode:
1 = Clock stretching is enabled for both slave transmit and slave receive (stretch enabled)
0 = Clock stretching is disabled
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).
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
4 Clock
SCK Modes
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Input
Sample
(SMP = 1)
SSPIF
Next Q4 Cycle
SSPSR to after Q2
SSPBUF
SS
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SDI bit 0
(SMP = 0) bit 7 bit 7
Input
Sample
(SMP = 0)
SSPIF
Next Q4 Cycle
SSPSR to after Q2
SSPBUF
SS
Optional
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SDI
(SMP = 0) bit 7 bit 0
Input
Sample
(SMP = 0)
SSPIF
Next Q4 Cycle
SSPSR to after Q2
SSPBUF
SS
Required
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Write to
SSPBUF
SDI
(SMP = 0)
bit 7 bit 0
Input
Sample
(SMP = 0)
SSPIF
Next Q4 Cycle
after Q2
SSPSR to
SSPBUF
Register on
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Page
Internal
13.4.1 SLAVE MODE
Data Bus
In Slave mode, the SCL and SDA pins must be
Read Write configured as inputs (TRISC<4:3> set). The MSSP
module will override the input state with the output data
RC3/SCK/SCL
SSPBUF Reg when required (slave-transmitter).
When an address is matched, or the data transfer after
Shift
Clock an address match is received, the hardware
automatically will generate the Acknowledge (ACK)
SSPSR Reg
pulse and load the SSPBUF register with the received
RC4/ MSb LSb value currently in the SSPSR register.
SDI/
SDA If either or both of the following conditions are true, the
Match Detect Addr Match MSSP module will not give this ACK pulse:
a) The buffer full bit BF (SSPCON register) was set
SSPMSK Reg
before the transfer was received.
b) The overflow bit SSPOV (SSPCON register)
was set before the transfer was received.
SSPADD Reg
In this event, the SSPSR register value is not loaded
into the SSPBUF, but bit SSPIF of the PIR1 register is
Start and Set, Reset
S, P bits set. The BF bit is cleared by reading the SSPBUF
Stop bit Detect
(SSPSTAT Reg) register, while bit SSPOV is cleared through software.
The SCL clock input must have a minimum high and
Note: I/O pins have diode protection to VDD and VSS.
low for proper operation. The high and low times of the
I2C specification, as well as the requirement of the
MSSP module, are shown in timing parameter #100
The MSSP module has these six registers for I2C
and parameter #101.
operation:
MSSP Control Register 1 (SSPCON)
MSSP Control Register 2 (SSPCON2)
MSSP STATUS register (SSPSTAT)
Serial Receive/Transmit Buffer (SSPBUF)
MSSP Shift Register (SSPSR) Not directly
accessible
MSSP Address register (SSPADD)
MSSP Mask register (SSPMSK)
Receiving Address R/W = 0 Receiving Data ACK Receiving Data Not ACK
ACK
SDA A7 A6 A5 A4 A3 A2 A1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SCL S 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 P
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
Data in SCL held low
Sampled while CPU
responds to SSPIF
SSPIF
BF
Cleared in software From SSP Interrupt
SSPBUF is written in software Service Routine
CKP
FIGURE 13-9: SLAVE MODE GENERAL CALL ADDRESS SEQUENCE (7 OR 10-BIT ADDRESS)
SCL
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S
SSPIF
BF
Cleared in software
SSPBUF is read
SSPOV 0
GCEN 1
Internal SSPM<3:0>
Data Bus SSPADD<6:0>
Read Write
SSPBUF Baud
Rate
Generator
SDA Shift
Clock Arbitrate/WCOL Detect
SDA In Clock
SSPSR
(hold off clock source)
MSb LSb
Receive Enable
Acknowledge
Generate
SCL
SSPM<3:0> SSPADD<6:0>
SDA DX DX-1
BRG decrements on
Q2 and Q4 cycles
BRG
03h 02h 01h 00h (hold off) 03h 02h
Value
SCL
TBRG
S
Set S (SSPSTAT<3>)
Write to SSPCON2
SDA = 1,
occurs here, At completion of Start bit,
SDA = 1, SCL = 1
hardware clear RSEN bit
SCL (no change) and set SSPIF
1st bit
SDA
Falling edge of ninth clock Write to SSPBUF occurs here
End of Xmit
TBRG
SCL TBRG
Sr = Repeated Start
BF
PEN
R/W
I 2C MASTER MODE WAVEFORM (TRANSMISSION, 7 OR 10-BIT ADDRESS)
DS41291G-page 203
PIC16F882/883/884/886/887
FIGURE 13-16:
DS41291G-page 204
Write to SSPCON2<4>
to start Acknowledge sequence
SDA = ACKDT (SSPCON2<5>) = 0
Write to SSPCON2<0> (SEN = 1)
Begin Start Condition ACK from Master Set ACKEN start Acknowledge sequence
Master configured as a receiver SDA = ACKDT = 0 SDA = ACKDT = 1
SEN = 0 by programming SSPCON2<3>, (RCEN = 1)
PEN bit = 1
Write to SSPBUF occurs here RCEN cleared RCEN = 1 start RCEN cleared
automatically next receive automatically written here
Start XMIT ACK from Slave
Transmit Address to Slave R/W = 1 Receiving Data from Slave Receiving Data from Slave
SDA A7 A6 A5 A4 A3 A2 A1 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK
Bus Master
ACK is not sent terminates
transfer
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
SCL S P
Data shifted in on falling edge of CLK Set SSPIF at end
of receive Set SSPIF interrupt
Set SSPIF interrupt at end of Acknow-
at end of receive Set SSPIF interrupt ledge sequence
at end of Acknowledge
SSPIF sequence
Set P bit
SDA = 0, SCL = 1 Cleared in software Cleared in software Cleared in software Cleared in software Cleared in (SSPSTAT<4>)
while CPU software and SSPIF
responds to SSPIF
PIC16F882/883/884/886/887
BF
Last bit is shifted into SSPSR and
contents are unloaded into SSPBUF
SSPOV
ACKEN
I 2C MASTER MODE WAVEFORM (RECEPTION, 7-BIT ADDRESS)
TBRG TBRG
SDA D0 ACK
SCL 8 9
SSPIF
SDA ACK
P
TBRG TBRG TBRG
BRG overflow,
Release SCL,
If SCL = 1, load BRG with
SSPADD<6:0>, and start count BRG overflow occurs,
to measure high time interval Release SCL, Slave device holds SCL low
SCL = 1, BRG starts counting
clock high interval
SCL
SDA
SDA
BCLIF
SDA
SCL
Set SEN, enable Start SEN cleared automatically because of bus collision.
condition if SDA = 1, SCL = 1. SSP module reset into Idle state.
SEN
SDA sampled low before
Start condition. Set BCLIF.
S bit and SSPIF set because
BCLIF SDA = 0, SCL = 1.
SSPIF and BCLIF are
cleared in software.
SSPIF
SDA = 0, SCL = 1
TBRG TBRG
SDA
SSPIF 0 0
FIGURE 13-23: BRG RESET DUE TO SDA ARBITRATION DURING START CONDITION
SDA = 0, SCL = 1
Set S Set SSPIF
Less than TBRG
TBRG
SCL S
SCL pulled low after BRG
time-out
SEN
Set SEN, enable Start
sequence if SDA = 1, SCL = 1
BCLIF 0
SSPIF
SDA = 0, SCL = 1 Interrupts cleared
Set SSPIF in software
SDA
SCL
RSEN
BCLIF
Cleared in software
S 0
SSPIF 0
SDA
SCL
S 0
SSPIF
PEN
BCLIF
P 0
SSPIF 0
SDA
Assert SDA SCL goes low before SDA goes high,
set BCLIF
SCL
PEN
BCLIF
P 0
SSPIF 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: When SSPCON bits SSPM<3:0> = 1001, any reads or writes to the SSPADD SFR address are accessed
through the SSPMSK register.
2: In all other SSP modes, this bit has no effect.
Note 1: Enabling Brown-out Reset does not automatically enable Power-up Timer.
2: The entire data EEPROM will be erased when the code protection is turned off.
3: The entire program memory will be erased when the code protection is turned off.
4: When MCLR is asserted in INTOSC or RC mode, the internal clock oscillator is disabled.
WRT<1:0> BOR4V
bit 13 bit 8
bit 7 bit 0
External
Reset
MCLR/VPP pin
Sleep
WDT WDT
Module Time-out
Reset
VDD Rise
Detect
Power-on Reset
VDD
Brown-out(1)
Reset BOREN
SBOREN S
OST/PWRT
OST
Chip_Reset
10-bit Ripple Counter R Q
OSC1/
CLKI pin
PWRT
LFINTOSC 11-bit Ripple Counter
Enable PWRT
Enable OST
Internal
Reset 64 ms(1)
VDD
VBOR
Internal < 64 ms
Reset 64 ms(1)
VDD
VBOR
Internal
Reset 64 ms(1)
XT, HS, LP TPWRT + 1024 TOSC TPWRT + 1024 TOSC 1024 TOSC
1024 TOSC 1024 TOSC
LP, T1OSCIN = 1 TPWRT TPWRT
RC, EC, INTOSC TPWRT TPWRT
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
IOC-RB0
IOCB0
IOC-RB1
IOCB1
IOC-RB2 BCLIF
IOCB2 BCLIE
IOC-RB3 SSPIF
IOCB3 SSPIE
IOC-RB4 TXIF
IOCB4 TXIE
IOC-RB5 RCIF
IOCB5 RCIE Wake-up (If in Sleep mode)(1)
T0IF
IOC-RB6 TMR2IF T0IE
Interrupt to CPU
IOCB6 TMR2IE INTF
INTE
IOC-RB7 TMR1IF RBIF
IOCB7 TMR1IE
RBIE
C1IF
C1IE PEIE
C2IF GIE
C2IE
ADIF
ADIE
EEIF
EEIE
Note 1: Some peripherals depend upon the
OSFIF system clock for operation. Since the
OSFIE system clock is suspended during
Sleep, these peripherals will not wake
CCP1IF the part from Sleep. See Section 14.6.1
CCP1IE
Wake-up from Sleep.
CCP2IF
CCP2IE
ULPWUIF
ULPWUIE
Q1 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 flag (5) Interrupt Latency (2)
(INTCON<1>)
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
PC PC PC + 1 PC + 1 0004h 0005h
Instruction
Fetched Inst (PC) Inst (PC + 1) Inst (0004h) Inst (0005h)
Prescaler(1)
1
16-bit WDT Prescaler
PSA
PS<2:0>
31 kHz
WDTPS<3:0>
LFINTOSC Clock
0 1
PSA
Note 1: This is the shared Timer0/WDT prescaler. See Section 5.1.3 Software Programmable Prescaler for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: If WDTE Configuration bit = 1, then WDT is always enabled, irrespective of this control bit. If WDTE
Configuration bit = 0, then it is possible to turn WDT on/off with this control bit.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
CLKOUT(4) TOST(2)
INT pin
INTF flag
(INTCON<1>) Interrupt Latency (3)
GIE bit
(INTCON<7>) Processor in
Sleep
Instruction Flow
PC PC PC + 1 PC + 2 PC + 2 PC + 2 0004h 0005h
Instruction Inst(PC + 1) Inst(PC + 2) Inst(0004h) Inst(0005h)
Fetched Inst(PC) = Sleep
Instruction Sleep Inst(PC + 1) Dummy Cycle Dummy Cycle
Executed Inst(PC 1) Inst(0004h)
Any instruction that specifies a file register as part of k = 8-bit immediate value
the instruction performs a Read-Modify-Write (RMW)
operation. The register is read, the data is modified, CALL and GOTO instructions only
and the result is stored according to either the instruc- 13 11 10 0
tion, or the destination designator d. A read operation OPCODE k (literal)
is performed on a register even if the instruction writes
to that register. k = 11-bit immediate value
Before Instruction
W = 0x07
After Instruction
W = value of k8
C=0 Wf
C=1 Wf
DC = 0 W<3:0> f<3:0>
DC = 1 W<3:0> f<3:0>
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.
5.5
5.0
4.5
VDD (V)
4.0
3.5
3.0
2.5
2.0
0 8 10 20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
FIGURE 17-2: HFINTOSC FREQUENCY ACCURACY OVER DEVICE VDD AND TEMPERATURE
125
5%
85
Temperature (C)
2%
60
25 1%
VDD (V)
Param Conditions
Device Characteristics Min. Typ Max. Units
No. VDD Note
(1, 2)
D010 Supply Current (IDD) 13 19 A 2.0 FOSC = 32 kHz
22 30 A 3.0 LP Oscillator mode
33 60 A 5.0
D011* 180 250 A 2.0 FOSC = 1 MHz
290 400 A 3.0 XT Oscillator mode
490 650 A 5.0
D012 280 380 A 2.0 FOSC = 4 MHz
480 670 A 3.0 XT Oscillator mode
0.9 1.4 mA 5.0
D013* 170 295 A 2.0 FOSC = 1 MHz
280 480 A 3.0 EC Oscillator mode
470 690 A 5.0
D014 290 450 A 2.0 FOSC = 4 MHz
490 720 A 3.0 EC Oscillator mode
0.85 1.3 mA 5.0
D015 8 20 A 2.0 FOSC = 31 kHz
16 40 A 3.0 LFINTOSC mode
31 65 A 5.0
D016* 416 520 A 2.0 FOSC = 4 MHz
640 840 A 3.0 HFINTOSC mode
1.13 1.6 mA 5.0
D017 0.65 0.9 mA 2.0 FOSC = 8 MHz
1.01 1.3 mA 3.0 HFINTOSC mode
1.86 2.3 mA 5.0
D018 340 580 A 2.0 FOSC = 4 MHz
550 900 A 3.0 EXTRC mode(3)
0.92 1.4 mA 5.0
D019 3.8 4.7 mA 4.5 FOSC = 20 MHz
4.0 4.8 mA 5.0 HS Oscillator mode
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave,
from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O
pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have
an impact on the current consumption.
3: 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
Param Conditions
Device Characteristics Min. Typ Max. Units
No. VDD Note
D020 Power-down Base 0.05 1.2 A 2.0 WDT, BOR, Comparators, VREF and
Current(IPD)(2) 0.15 1.5 A 3.0 T1OSC disabled
0.35 1.8 A 5.0
150 500 nA 3.0 -40C TA +25C
D021 1.0 2.2 A 2.0 WDT Current(1)
2.0 4.0 A 3.0
3.0 7.0 A 5.0
D022 42 60 A 3.0 BOR Current(1)
85 122 A 5.0
D023 32 45 A 2.0 Comparator Current(1), both
60 78 A 3.0 comparators enabled
120 160 A 5.0
D024 30 36 A 2.0 CVREF Current(1) (high range)
45 55 A 3.0
75 95 A 5.0
D025* 39 47 A 2.0 CVREF Current(1) (low range)
59 72 A 3.0
98 124 A 5.0
D026 2.0 5.0 A 2.0 T1OSC Current(1), 32.768 kHz
2.5 5.5 A 3.0
3.0 7.0 A 5.0
D027 0.30 1.6 A 3.0 A/D Current(1), no conversion in
0.36 1.9 A 5.0 progress
D028 90 125 A 3.0 VP6 Reference Current
125 162 A 5.0
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The peripheral current is the sum of the base IDD or IPD and the additional current consumed when this
peripheral is enabled. The peripheral current can be determined by subtracting the base IDD or IPD
current from this limit. Max values should be used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is
measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD.
Param Conditions
Device Characteristics Min. Typ Max. Units
No. VDD Note
D020E Power-down Base 0.05 9 A 2.0 WDT, BOR, Comparators, VREF and
Current (IPD)(2) 0.15 11 A 3.0 T1OSC disabled
0.35 15 A 5.0
D021E 1 28 A 2.0 WDT Current(1)
2 30 A 3.0
3 35 A 5.0
D022E 42 65 A 3.0 BOR Current(1)
85 127 A 5.0
D023E 32 45 A 2.0 Comparator Current(1), both
60 78 A 3.0 comparators enabled
120 160 A 5.0
D024E 30 70 A 2.0 CVREF Current(1) (high range)
45 90 A 3.0
75 120 A 5.0
D025E* 39 91 A 2.0 CVREF Current(1) (low range)
59 117 A 3.0
98 156 A 5.0
D026E 3.5 18 A 2.0 T1OSC Current(1), 32.768 kHz
4.0 21 A 3.0
5.0 24 A 5.0
D027E 0.30 12 A 3.0 A/D Current(1), no conversion in
0.36 16 A 5.0 progress
D028E 90 130 A 3.0 VP6 Reference Current
125 170 A 5.0
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The peripheral current is the sum of the base IDD or IPD and the additional current consumed when this
peripheral is enabled. The peripheral current can be determined by subtracting the base IDD or IPD
current from this limit. Max values should be used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is
measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD.
Param
Sym. Characteristic Min. Typ Max. Units Conditions
No.
VIL Input Low Voltage
I/O Port:
D030 with TTL buffer Vss 0.8 V 4.5V VDD 5.5V
D030A Vss 0.15 VDD V 2.0V VDD 4.5V
D031 with Schmitt Trigger buf- Vss 0.2 VDD V 2.0V VDD 5.5V
fer
D032 MCLR, OSC1 (RC mode)(1) VSS 0.2 VDD V
D033 OSC1 (XT and LP modes) VSS 0.3 V
D033A OSC1 (HS mode) VSS 0.3 VDD V
VIH Input High Voltage
I/O ports:
D040 with TTL buffer 2.0 VDD V 4.5V VDD 5.5V
D040A 0.25 VDD + 0.8 VDD V 2.0V VDD 4.5V
D041 with Schmitt Trigger buffer 0.8 VDD VDD V 2.0V VDD 5.5V
D042 MCLR 0.8 VDD VDD V
D043 OSC1 (XT and LP modes) 1.6 VDD V
D043A OSC1 (HS mode) 0.7 VDD VDD V
D043B OSC1 (RC mode) 0.9 VDD VDD V (Note 1)
IIL Input Leakage Current(2)
D060 I/O ports 0.1 1 A VSS VPIN VDD,
Pin at high-impedance
D061 MCLR(3) 0.1 5 A VSS VPIN VDD
D063 OSC1 0.1 5 A VSS VPIN VDD, XT, HS and
LP oscillator configuration
D070* IPUR PORTB Weak Pull-up Cur- 50 250 400 A VDD = 5.0V, VPIN = VSS
rent
VOL Output Low Voltage(5)
D080 I/O ports 0.6 V IOL = 8.5 mA, VDD = 4.5V
(Ind.)
VOH Output High Voltage(5)
D090 I/O ports VDD 0.7 V IOH = -3.0 mA, VDD = 4.5V
(Ind.)
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
Note 1: In RC oscillator configuration, the OSC1/CLKIN pin is a Schmitt Trigger input. It is not recommended to use an
external clock in RC mode.
2: Negative current is defined as current sourced by the pin.
3: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels
represent normal operating conditions. Higher leakage current may be measured at different input voltages.
4: See Section 10.3.1 Using the Data EEPROM for additional information.
5: Including OSC2 in CLKOUT mode.
Param
Sym. Characteristic Min. Typ Max. Units Conditions
No.
D100 IULP Ultra Low-Power Wake-Up 200 nA See Application Note AN879,
Current Using the Microchip Ultra
Low-Power Wake-up Module
(DS00879)
Capacitive Loading Specs
on Output Pins
D101* COSC2 OSC2 pin 15 pF In XT, HS and LP modes when
external clock is used to drive
OSC1
D101A CIO All I/O pins 50 pF
*
Data EEPROM Memory
D120 ED Byte Endurance 100K 1M E/W -40C TA +85C
D120A ED Byte Endurance 10K 100K E/W +85C TA +125C
D121 VDRW VDD for Read/Write VMIN 5.5 V Using EECON1 to read/write
VMIN = Minimum operating
voltage
D122 TDEW Erase/Write Cycle Time 5 6 ms
D123 TRETD Characteristic Retention 40 Year Provided no other
specifications are violated
D124 TREF Number of Total Erase/Write 1M 10M E/W -40C TA +85C
Cycles before Refresh(4)
Program Flash Memory
D130 EP Cell Endurance 10K 100K E/W -40C TA +85C
D130A ED Cell Endurance 1K 10K E/W +85C TA +125C
D131 VPR VDD for Read VMIN 5.5 V VMIN = Minimum operating
voltage
D132 VPEW VDD for Row Erase/Write VMIN 5.5 V
VDD for Bulk Erase Opera- 4.5 5.5 V
tions
D133 TPEW Erase/Write cycle time 2 2.5 ms
D134 TRETD Characteristic Retention 40 Year Provided no other
specifications are violated
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
Note 1: In RC oscillator configuration, the OSC1/CLKIN pin is a Schmitt Trigger input. It is not recommended to use an
external clock in RC mode.
2: Negative current is defined as current sourced by the pin.
3: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels
represent normal operating conditions. Higher leakage current may be measured at different input voltages.
4: See Section 10.3.1 Using the Data EEPROM for additional information.
5: Including OSC2 in CLKOUT mode.
1. TppS2ppS
2. TppS
T
F Frequency T Time
Lowercase letters (pp) and their meanings:
pp
cc CCP1 osc OSC1
ck CLKOUT rd RD
cs CS rw RD or WR
di SDI sc SCK
do SDO ss SS
dt Data in t0 T0CKI
io I/O PORT t1 T1CKI
mc MCLR wr WR
Uppercase letters and their meanings:
S
F Fall P Period
H High R Rise
I Invalid (High-impedance) V Valid
L Low Z High-impedance
Load Condition
Pin CL
VSS
Q4 Q1 Q2 Q3 Q4 Q1
OSC1/CLKIN
OS02
OS04 OS04
OS03
OSC2/CLKOUT
(LP,XT,HS Modes)
OSC2/CLKOUT
(CLKOUT Mode)
FOSC
OS11 OS12
OS20
CLKOUT OS21
OS19 OS16 OS18
OS13 OS17
I/O pin
(Input)
OS15 OS14
I/O pin Old Value New Value
(Output)
OS18, OS19
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
VDD
VBOR + VHYST
VBOR
37
Reset
(due to BOR) 33*
T0CKI
40 41
42
T1CKI
45 46
47 49
TMR0 or
TMR1
CCP1
(Capture mode)
CC01 CC02
CC03
Param
Symbol Characteristics Min. Typ. Max. Units Comments
No.
VR01 VROUT VR voltage output 0.5 0.6 0.7 V
VR02* TSTABLE Settling Time 10 100* s
* These parameters are characterized but not tested.
Param
Sym. Characteristic Min. Typ Max. Units Conditions
No.
AD130* TAD A/D Clock Period 1.6 9.0 s TOSC-based, VREF 3.0V
3.0 9.0 s TOSC-based, VREF full range
A/D Internal RC ADCS<1:0> = 11 (ADRC mode)
Oscillator Period 3.0 6.0 9.0 s At VDD = 2.5V
1.6 4.0 6.0 s At VDD = 5.0V
AD131 TCNV Conversion Time 11 TAD Set GO/DONE bit to new data in A/D
(not including Result register
Acquisition Time)(1)
AD132* TACQ Acquisition Time 11.5 s
AD133* TAMP Amplifier Settling Time 5 s
AD134 TGO Q4 to A/D Clock Start TOSC/2
BSF ADCON0, GO
1 TCY
AD134 (TOSC/2(1))
AD131
Q4
AD130
A/D CLK
A/D Data 9 8 7 6 3 2 1 0
ADIF 1 TCY
GO DONE
Sampling Stopped
Sample AD132
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
BSF ADCON0, GO
AD134 (TOSC/2 + TCY(1)) 1 TCY
AD131
Q4
AD130
A/D CLK
A/D Data 9 8 7 6 3 2 1 0
ADIF 1 TCY
GO DONE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
RC6/TX/CK
pin 121 121
RC7/RX/DT
pin
120
122
Note: Refer to Figure 17-3 for load conditions.
RC6/TX/CK
pin 125
RC7/RX/DT
pin
126
SS
70
SCK
(CKP = 0)
71 72
78 79
SCK
(CKP = 1)
79 78
80
75, 76
SS
81
SCK
(CKP = 0)
71 72
79
73
SCK
(CKP = 1)
80
78
75, 76
SS
70
SCK
(CKP = 0) 83
71 72
78 79
SCK
(CKP = 1)
79 78
80
75, 76 77
74
73
82
SS
70
SCK
83
(CKP = 0)
71 72
SCK
(CKP = 1)
80
75, 76 77
SDI
MSb In bit 6 - - - -1 LSb In
74
SCL
91 93
90 92
SDA
Start Stop
Condition Condition
90* TSU:STA Start condition 100 kHz mode 4700 ns Only relevant for Repeated
Setup time 400 kHz mode 600 Start condition
91* THD:STA Start condition 100 kHz mode 4000 ns After this period, the first
Hold time 400 kHz mode 600 clock pulse is generated
92* TSU:STO Stop condition 100 kHz mode 4700 ns
Setup time 400 kHz mode 600
93 THD:STO Stop condition 100 kHz mode 4000 ns
Hold time 400 kHz mode 600
* These parameters are characterized but not tested.
SDA
Out
FIGURE 18-2: MAXIMUM IDD vs. FOSC OVER VDD (EC MODE)
6.0
4.0
4V
IDD (mA)
3.0
3V
2.0
2V
1.0
0.0
1 MHz 2 MHz 4 MHz 6 MHz 8 MHz 10 MHz 12 MHz 14 MHz 16 MHz 18 MHz 20 MHz
VDD (V)
5.0
Typical: Statistical Mean @25C
4.5
Maximum: Mean (Worst-case Temp) + 3
5.5V
(-40C to 125C)
4.0 5V
4.5V
3.5
3.0
IDD (mA)
2.5
3V 3.5V 4V 4.5V 5V 5.5V
0.567660978 0.6909750.8211857610.9883470541.0462473761.119615457
2.0
1.1610564131.4069334781.6664380432.0030751092.1193190652.268818804
4V 2.883088587 3.03554863 3.23775
1.5 3.5V 3.74139 3.967407543
3V
1.0
0.5
0.0
4 MHz 10 MHz 16 MHz 20 Mhz
FOSC
FIGURE 18-4: MAXIMUM IDD vs. FOSC OVER VDD (HS MODE)
HS Mode
5.5
5.0 Typical:
3V Statistical 3.5V
Mean @25C4V 4.5V 5V 5.5V 5.5V
Maximum: Mean (Worst-case Temp) + 3
0.8868608641.0693043161.2645617521.4868166111.5076394231.520959608 5V
(-40C1.6176371031.9623642592.3355493582.7630868222.8139211682.849632041
to 125C) 4.5V
4.5
3.8375797553.9157601913.967889512
4.0 4.685048474 4.78069621
3.5
IDD (mA)
3.0
2.5
4V
2.0 3.5V
3V
1.5
1.0
0.5
0.0
4 MHz 10 MHz 16 MHz 20 MHz
FOSC
1,200
2 2.5 3 3.5 4 4.5 5 5.5
Typical: Statistical Mean @25C
Typical: Statistical Mean @25C
Maximum: 180.1774 235.0683
Mean (Worst Case Temp) + 3 289.9592
337.753 385.547 436.866 488.184 554.8964
Maximum: Mean (Worst-case Temp)577.923
(-40C to283.7333
125C) + 3 674.6106 783.831 893.052 1033.15
382.484 481.2347
1,000
(-40C to 125C)
Vdd
2 2.5 3 3.5 4 4.5 5 5.5
800 244.8837 320.7132 396.5426 461.707 526.8719 587.642 648.412 724.0755
375.529 522.3721 669.2152 822.619 976.0232 1163.67 1351.32
IDD (uA)
600 4 MHz
400
1 MHz
200
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 18-6: MAXIMUM IDD vs. VDD OVER FOSC (XT MODE)
XT Mode
1,800
Typical: Statistical Mean @25C
1,600
Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
1,400
1,200
1,000
IDD (uA)
4 MHz
800
600
1 MHz
400
200
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
1,800
1,200
4 MHz
1,000
IDD (uA)
800
1 MHz
600
400
200
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
2,000
1,800 Typical:
Typical:Statistical
StatisticalMean
Mean@25C
@25C
Maximum:Mean
Maximum: Mean(Worst-case
(Worst CaseTemp)
Temp)+ +33
(-40C to 125C)
1,600 (-40C to 125C)
1,400
4 MHz
1,200
IDD (uA)
1,000
800
1 MHz
600
400
200
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
80
Typical: Statistical Mean @25C
70 Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
60
50
Maximum
IDD (A)
40
30
Typical
20
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
80
Typical: Statistical Mean @25C
Maximum: Mean (Worst-case Temp) + 3
70
(-40C to 125C)
60
50
IDD (uA)
32 kHz Maximum
40
30 32 kHz Typical
20
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
1,500
4V
IDD (uA)
1,000 3V
2V
500
2V 3V 4V 5V 5.5V
0
125 kHz 25 kHz 500 kHz 1 MHz 2 MHz 4 MHz 8 MHz
VDD (V)
FIGURE 18-12: MAXIMUM IDD vs. FOSC OVER VDD (HFINTOSC MODE)
HFINTOSC
3,000
Typical: Statistical Mean @25C 5.5V
Maximum: Mean (Worst-case Temp) + 3
2,500 (-40C to 125C)
5V
2,000
4V
IDD (uA)
1,500
3V
1,000
2V
500
0
125 kHz 250 kHz 500 kHz 1 MHz 2 MHz 4 MHz 8 MHz
VDD (V)
0.45
Typical: Statistical Mean @25C
0.40 Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
0.35
0.30
0.25
IPD (uA)
0.20
0.15
0.10
0.05
0.00
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 18-14: MAXIMUM IPD vs. VDD (SLEEP MODE, ALL PERIPHERALS DISABLED)
Maximum
(Sleep Mode all Peripherals Disabled)
18
Typical: Statistical Mean @25C
16 Maximum: Mean +
Maximum: Mean 3
(Worst-case Temp) + 3
(-40C to 125C)
14
Max. 125C
12
10
IPD (A)
Max. 85C
2
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
180
Typical: Statistical Mean @25C
160
Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
140
120
Maximum
100
IPD (uA)
80
Typical
60
Typical Max
31.9 40 43.9
45.6 60.8
59.3 20 77.7
73.0 95.8
86.7 113.8
0
100.4 131.8
114.1 149.9 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
127.7
VDD (V)
160
120
100
Maximum
IPD (A)
80
Typical
60
40
20
0
2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
3.0
2.5 Typical:Typical
Statistical Mean @25C Max 125C
Max 85C
2 1.007 2.140 27.702
2.5 1.146 2.711 29.079
3 1.285 3.282 30.08
2.0 3.5 1.449 3.899 31.347
4 1.612 4.515 32.238
4.5 1.924 5.401 33.129
5 2.237 6.288 34.02
IPD (uA)
1.0
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
40.0
Maximum:
Maximum: Mean
Mean +3
+ 3
35.0
Max. 125C
30.0
25.0
IPD (uA)
20.0
15.0
10.0
Max. 85C
5.0
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
32
28 Max. (125C)
26 Max. (85C)
24
Time (ms)
22
20
Typical
18
16
14
12 Minimum
10
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
30
26
Maximum
24
22
Time (ms)
20
Typical
18
16
14 Minimum
12
10
-40C 25C 85C 125C
Temperature (C)
Max. 85C
60
Typical
40
FIGURE 18-22: CVREF IPD vs. VDD OVER TEMPERATURE (LOW RANGE)
low Range
180
Typical: Statistical Mean @25C
160 Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
140
Max. 125C
120
100
IPD (uA)
Max. 85C
80
Typical
60
40
20
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
160
140
120
100
Typical
IPD (uA)
80
60
40
20
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 18-24: MAXIMUM VP6 REFERENCE IPD vs. VDD OVER TEMPERATURE
180
160
140
Max 125C
120
Max 85C
IPD (uA)
100
80
60
40
20
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
30
Typical: Statistical Mean @25C
Maximum: Mean (Worst-case Temp) + 3
25 (-40C to 125C)
Max. 125C
20
IPD (uA)
15
Typ 25C Max 85C Max 125C
2 2.022 4.98 17.54
2.5 2.247 5.23 19.02
10 3 2.472 5.49 20.29
3.5 2.453 5.79 21.50
Max. 85C
4 2.433 6.08 22.45
4.5 2.711 6.54 23.30
5 5 2.989 7.00 24.00
5.5 3.112 7.34 Typ. 25C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
0.8
Max. 125C
0.6
0.4
0.2
Min. -40C
0.1
0.0
5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
IOL (mA)
0.45
0.25
VOL (V)
Typ. 25C
0.20
0.10
0.05
0.00
5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
IOL (mA)
3.5
3.0
Max. -40C
Typ. 25C
2.5
Min. 125C
2.0
VOH (V)
1.5
0.5
0.0
0.0 -0.5 -1.0 -1.5 -2.0 -2.5 -3.0 -3.5 -4.0
IOH (mA)
5.5
5.0
Max. -40C
Typ. 25C
4.5
VOH (V)
Min. 125C
4.0
3.0
0.0 -0.5 -1.0 -1.5 -2.0 -2.5 -3.0 -3.5 -4.0 -4.5 -5.0
IOH (mA)
FIGURE 18-30: TTL INPUT THRESHOLD VIN vs. VDD OVER TEMPERATURE
(TTL Input, -40C TO 125C)
1.7
Max. -40C
1.3
Typ. 25C
VIN (V)
1.1
Min. 125C
0.9
0.7
0.5
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
4.0
VIH Max. 125C
Typical: Statistical Mean @25C
3.5 Maximum: Mean (Worst-case Temp) + 3
(-40C to 125C)
VIH Min. -40C
3.0
2.5
VIN (V)
2.0
VIL Max. -40C
1.0
0.5
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
900
800
Max. (125C)
700
Response Time (nS)
300
0
2.0 2.5 4.0 5.5
VDD (Volts)
500
400
Response Time (nS)
300
0
2.0 2.5 4.0 5.5
VDD (Volts)
FIGURE 18-34: LFINTOSC FREQUENCY vs. VDD OVER TEMPERATURE (31 kHz)
LFINTOSC 31Khz
45,000
40,000
Max. -40C
35,000
Typ. 25C
30,000
Frequency (Hz)
25,000
Min. 125C
15,000
10,000
Typical: Statistical Mean @25C
5,000 Maximum: Mean (Worst-case) + 3
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
6
85C
Time (s)
25C
4
-40C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 18-36: TYPICAL HFINTOSC START-UP TIMES vs. VDD OVER TEMPERATURE
16
25C
10
-40C
Time (s)
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
25
15
Time (s)
85C
25C
10
-40C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 18-38: MINIMUM HFINTOSC START-UP TIMES vs. VDD OVER TEMPERATURE
-40C to +85C
10
7
85C
6
Time (s)
25C
5
-40C
4
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
2
Change from Calibration (%)
-1
-2
-3
-4
-5
VDD (V)
FIGURE 18-40: TYPICAL HFINTOSC FREQUENCY CHANGE OVER DEVICE VDD (85C)
3
Change from Calibration (%)
-1
-2
-3
-4
-5
VDD (V)
2
Change from Calibration (%)
-1
-2
-3
-4
-5
VDD (V)
3
Change from Calibration (%)
-1
-2
-3
-4
-5
VDD (V)
0.65
0.64
0.63
0.62
0.61
VP6 (V)
0.60
0.59
Typical
0.58
0.57
0.56
0.55
2 3 4 5 5.5
VDD (V)
FIGURE 18-44: VP6 DRIFT OVER TEMPERATURE NORMALIZED AT 25C (VDD 5V)
2
Change from Nominal in %
-1
-2
-40 0 25 85 125
Temperature in Degrees C
2
Change from Nominal in %
-1
-2
-40 0 25 85 125
Temperature in Degrees C
35
30 Parts=118
25
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
40
35
Parts=118
30
Number of Parts
25
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
40
35 Parts=118
30
Number of Parts
25
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
30
Parts=118
25
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
30
25 Parts=118
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
35
30 Parts=118
25
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
30
25
Parts=118
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
30
25
Parts=118
Number of Parts
20
15
10
0
0.500
0.510
0.520
0.530
0.540
0.550
0.560
0.570
0.580
0.590
0.600
0.610
0.620
0.630
0.640
0.650
0.660
0.670
0.680
0.690
0.700
Voltage (V)
PIC16F883
-I/P e3
1231220
XXXXXXXXXXXXXXXXXXXX PIC16F886/SO e3
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
YYWWNNN 1231220
PIC16F883
-I/SS e3
1231220
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
* Standard PICmicro device marking consists of Microchip part number, year code, week code and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
PIN 1 PIN 1
XXXXXXXX 16F886
XXXXXXXX /ML e3
YYWWNNN 1231220
XXXXXXXXXXXXXXXXXX PIC16F885
XXXXXXXXXXXXXXXXXX -I/P e3
XXXXXXXXXXXXXXXXXX
YYWWNNN 1231220
PIN 1 PIN 1
XXXXXXXXXXX PIC16F887
XXXXXXXXXXX -I/ML e3
XXXXXXXXXXX
YYWWNNN 1231220
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
* Standard PICmicro device marking consists of Microchip part number, year code, week code and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
XXXXXXXXXX PIC16F887
XXXXXXXXXX -I/PT e3
XXXXXXXXXX
YYWWNNN 1231220
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
* Standard PICmicro device marking consists of Microchip part number, year code, week code and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
/HDG6NLQQ\3ODVWLF'XDO,Q/LQH63PLO%RG\>63',3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
N
NOTE 1
E1
1 2 3
A A2
L c
A1 b1
b e eB
8QLWV ,1&+(6
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI3LQV 1
3LWFK H %6&
7RSWR6HDWLQJ3ODQH $
0ROGHG3DFNDJH7KLFNQHVV $
%DVHWR6HDWLQJ3ODQH $
6KRXOGHUWR6KRXOGHU:LGWK (
0ROGHG3DFNDJH:LGWK (
2YHUDOO/HQJWK '
7LSWR6HDWLQJ3ODQH /
/HDG7KLFNQHVV F
8SSHU/HDG:LGWK E
/RZHU/HDG:LGWK E
2YHUDOO5RZ6SDFLQJ H%
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
6LJQLILFDQW&KDUDFWHULVWLF
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
/HDG3ODVWLF6KULQN6PDOO2XWOLQH66PP%RG\>6623@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
N
E
E1
1 2
b
NOTE 1
e
c
A A2
A1
L1 L
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI3LQV 1
3LWFK H %6&
2YHUDOO+HLJKW $
0ROGHG3DFNDJH7KLFNQHVV $
6WDQGRII $
2YHUDOO:LGWK (
0ROGHG3DFNDJH:LGWK (
2YHUDOO/HQJWK '
)RRW/HQJWK /
)RRWSULQW / 5()
/HDG7KLFNQHVV F
)RRW$QJOH
/HDG:LGWK E
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
/HDG3ODVWLF4XDG)ODW1R/HDG3DFNDJH0/[PP%RG\>4)1@
ZLWKPP&RQWDFW/HQJWK
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
/HDG3ODVWLF'XDO,Q/LQH3PLO%RG\>3',3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
NOTE 1
E1
1 2 3
A A2
L c
b1
A1
b e eB
8QLWV ,1&+(6
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI3LQV 1
3LWFK H %6&
7RSWR6HDWLQJ3ODQH $
0ROGHG3DFNDJH7KLFNQHVV $
%DVHWR6HDWLQJ3ODQH $
6KRXOGHUWR6KRXOGHU:LGWK (
0ROGHG3DFNDJH:LGWK (
2YHUDOO/HQJWK '
7LSWR6HDWLQJ3ODQH /
/HDG7KLFNQHVV F
8SSHU/HDG:LGWK E
/RZHU/HDG:LGWK E
2YHUDOO5RZ6SDFLQJ H%
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
6LJQLILFDQW&KDUDFWHULVWLF
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
/HDG3ODVWLF4XDG)ODW1R/HDG3DFNDJH0/[PP%RG\>4)1@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D D2
EXPOSED
PAD
E2
b
2 2
1 1
N N K
NOTE 1 L
A3 A1
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI3LQV 1
3LWFK H %6&
2YHUDOO+HLJKW $
6WDQGRII $
&RQWDFW7KLFNQHVV $ 5()
2YHUDOO:LGWK ( %6&
([SRVHG3DG:LGWK (
2YHUDOO/HQJWK ' %6&
([SRVHG3DG/HQJWK '
&RQWDFW:LGWK E
&RQWDFW/HQJWK /
&RQWDFWWR([SRVHG3DG .
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
3DFNDJHLVVDZVLQJXODWHG
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
/HDG3ODVWLF4XDG)ODW1R/HDG3DFNDJH0/[PP%RG\>4)1@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
/HDG3ODVWLF7KLQ4XDG)ODWSDFN37[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
D1
E
e
E1
N
b
NOTE 1 1 2 3
NOTE 2
A
c
A1 A2
L L1
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI/HDGV 1
/HDG3LWFK H %6&
2YHUDOO+HLJKW $
0ROGHG3DFNDJH7KLFNQHVV $
6WDQGRII $
)RRW/HQJWK /
)RRWSULQW / 5()
)RRW$QJOH
2YHUDOO:LGWK ( %6&
2YHUDOO/HQJWK ' %6&
0ROGHG3DFNDJH:LGWK ( %6&
0ROGHG3DFNDJH/HQJWK ' %6&
/HDG7KLFNQHVV F
/HDG:LGWK E
0ROG'UDIW$QJOH7RS
0ROG'UDIW$QJOH%RWWRP
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
&KDPIHUVDWFRUQHUVDUHRSWLRQDOVL]HPD\YDU\
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Revision B (7/2006)
Pin Diagrams (44-Pin QFN drawing); Revised Table
2-1, Addr. 1DH (CCP2CON); Section 3.0, 3.1; Section
3.4.4.6; Table 3; Table 3-1 (ANSEL); Table 3-3
(CCP2CON); Register 3-1; Register 3.2; Register 3-3;
Register 3-4; Register 3-9; Register 3-10; Register
3-11; Register 3-12; Register 3-14; Table 3-5 (ANSEL);
Figure 3-5; Figure 3-11; Figure 8-2; Figure 8-3; Figure
9-1; Register 9-1; Section 9.1.4; Example 10-4; Figure
11-5; Table 11-5 (P1M); Section 11.5.2; Section 11.5.7,
Number 4; Table 11-7 (CCP2CON); Section 12.3.1
(Para. 3); Figure 12-6 (Title); Sections 14.2, 14.3 and
14.4 DC Characteristics (Max); Table 14-4 (OSCCON);
Section 14.3 (TMR0); Section 14.3.2 (TMR0).
Revision C
Section 19.0 Packaging Information: Replaced
package drawings and added note.
Added PIC16F882 part number.
Replaced PICmicro with PIC.
Revision D
Replaced Package Drawings (Rev. AM); Replaced
Development Support Section; Revised Product ID
Section.
Revision E (01/2008)
Added Char Data; Removed Preliminary status;
Revised Device Table (PIC16F882, I/O); Revised the
following: Pin Diagram 44 TQFP, pin 30; Table 5, I/O
RA7; Table 1-1, RA1 and RA4; Section 2.2.1; Register
2-3, INTCON; Example 3-1; Section 3.2.2; Example
3-2; Figure 6-1; Section 6.2.2; Section 6.6; Section
8.10.3; Table 9-1; Equation 11-1; Added Figure 11-14
and renumbered remaining Figures; Register 11-3;
Register 13-3; Section 14.0; Section 14.1; Section
14.9; Section 14.10; Section 17.0; Updated Package
Drawings.
Revision F (04/2009)
Revised Product ID: Removed F (std. voltage range)
from part numbers; Revised Figure 6-1: Timer1 Block
Diagram; Revised Figure 8-3, Comparator C2 Block
Diagram; Added note to Section 8.10.3; Revised
Section 8.10.7.
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
Package:(2) ML = Quad Flat No Leads (QFN) Note 1: Tape and Reel identifier only appears in the
P = Plastic DIP catalog part number description. This
PT = Plastic Thin-Quad Flatpack (TQFP) identifier is used for ordering purposes and is
SO = Plastic Small Outline (SOIC) (7.50 mm) not printed on the device package. Check
SP = Skinny Plastic DIP with your Microchip Sales Office for package
SS = Plastic Shrink Small Outline availability with the Tape and Reel option.
2: For other small form-factor package
availability and marking information, please
Pattern: QTP, SQTP, Code or Special Requirements visit www.microchip.com/packaging or
(blank otherwise) contact your local sales office.
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.
QUALITY MANAGEMENT SYSTEM Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
CERTIFIED BY DNV Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Companys quality system processes and procedures
are for its PIC MCUs and dsPIC DSCs, KEELOQ code hopping
== ISO/TS 16949 == devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchips quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.