Vous êtes sur la page 1sur 22

PIC16F882/883/884/886/887

Data Sheet
28/40/44-Pin, Enhanced Flash-Based 8-Bit
CMOS Microcontrollers with
nanoWatt Technology

© 2007 Microchip Technology Inc. Preliminary DS41291D


Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.

• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.

• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s 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 Microchip’s 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.

Information contained in this publication regarding device Trademarks


applications and the like is provided only for your convenience
The Microchip name and logo, the Microchip logo, Accuron,
and may be superseded by updates. It is your responsibility to dsPIC, KEELOQ, KEELOQ logo, microID, MPLAB, PIC,
ensure that your application meets with your specifications.
PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and
MICROCHIP MAKES NO REPRESENTATIONS OR SmartShunt are registered trademarks of Microchip
WARRANTIES OF ANY KIND WHETHER EXPRESS OR Technology Incorporated in the U.S.A. and other countries.
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION, AmpLab, FilterLab, Linear Active Thermistor, Migratable
INCLUDING BUT NOT LIMITED TO ITS CONDITION, Memory, MXDEV, MXLAB, PS logo, SEEVAL, SmartSensor
QUALITY, PERFORMANCE, MERCHANTABILITY OR and The Embedded Control Solutions Company are
FITNESS FOR PURPOSE. Microchip disclaims all liability registered trademarks of Microchip Technology Incorporated
arising from this information and its use. Use of Microchip in the U.S.A.
devices in life support and/or safety applications is entirely at Analog-for-the-Digital Age, Application Maestro, CodeGuard,
the buyer’s risk, and the buyer agrees to defend, indemnify and dsPICDEM, dsPICDEM.net, dsPICworks, ECAN,
hold harmless Microchip from any and all damages, claims, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
suits, or expenses resulting from such use. No licenses are In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi,
conveyed, implicitly or otherwise, under any Microchip MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit,
intellectual property rights. PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB,
rfPICDEM, Select Mode, Smart Serial, SmartTel, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2007, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.

Microchip received ISO/TS-16949:2002 certification for its worldwide


headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona, Gresham, Oregon and Mountain View, California. The
Company’s quality system processes and procedures are for its PIC®
MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial
EEPROMs, microperipherals, nonvolatile memory and analog
products. In addition, Microchip’s quality system for the design and
manufacture of development systems is ISO 9001:2000 certified.

DS41291D-page ii Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with
nanoWatt Technology
High-Performance RISC CPU: Peripheral Features:
• Only 35 instructions to learn: • 24/35 I/O pins with individual direction control:
- All single-cycle instructions except branches - High current source/sink for direct LED drive
• Operating speed: - Interrupt-on-Change pin
- DC – 20 MHz oscillator/clock input - Individually programmable weak pull-ups
- DC – 200 ns instruction cycle - Ultra Low-Power Wake-up (ULPWU)
• Interrupt capability • Analog Comparator module with:
• 8-level deep hardware stack - Two analog comparators
• Direct, Indirect and Relative Addressing modes - Programmable on-chip voltage reference
(CVREF) module (% of VDD)
Special Microcontroller Features: - Fixed voltage reference (0.6V)
• Precision Internal Oscillator: - Comparator inputs and outputs externally
- Factory calibrated to ±1% accessible
- Software selectable frequency range of - SR Latch mode
8 MHz to 31 kHz - External Timer1 Gate (count enable)
- Software tunable • A/D Converter:
- Two-Speed Start-up mode - 10-bit resolution and 11/14 channels
- Crystal fail detect for critical applications • Timer0: 8-bit timer/counter with 8-bit
- Clock mode switching during operation for programmable prescaler
power savings • Enhanced Timer1:
• Power-Saving Sleep mode - 16-bit timer/counter with prescaler
• Wide operating voltage range (2.0V-5.5V) - External Gate Input mode
• Industrial and Extended Temperature range - Dedicated low-power 32 kHz oscillator
• Power-on Reset (POR) • Timer2: 8-bit timer/counter with 8-bit period
• Power-up Timer (PWRT) and Oscillator Start-up register, prescaler and postscaler
Timer (OST) • Enhanced Capture, Compare, PWM+ module:
• Brown-out Reset (BOR) with software control - 16-bit Capture, max. resolution 12.5 ns
option - Compare, max. resolution 200 ns
• Enhanced low-current Watchdog Timer (WDT) - 10-bit PWM with 1, 2 or 4 output channels,
with on-chip oscillator (software selectable programmable “dead time”, max. frequency
nominal 268 seconds with full prescaler) with 20 kHz
software enable - PWM output steering control
• Multiplexed Master Clear with pull-up/input pin • Capture, Compare, PWM module:
• Programmable code protection - 16-bit Capture, max. resolution 12.5 ns
• High Endurance Flash/EEPROM cell: - 16-bit Compare, max. resolution 200 ns
- 100,000 write Flash endurance - 10-bit PWM, max. frequency 20 kHz
- 1,000,000 write EEPROM endurance • Enhanced USART module:
- Flash/Data EEPROM retention: > 40 years - Supports RS-485, RS-232, and LIN 2.0
• Program memory Read/Write during run time - Auto-Baud Detect
• In-Circuit Debugger (on board) - Auto-Wake-Up on Start bit
• In-Circuit Serial ProgrammingTM (ICSPTM) via two
Low-Power Features: pins
• Master Synchronous Serial Port (MSSP) module
• Standby Current: supporting 3-wire SPI (all 4 modes) and I2C™
- 50 nA @ 2.0V, typical Master and Slave Modes with I2C address mask
• Operating Current:
- 11 μA @ 32 kHz, 2.0V, typical
- 220 μA @ 4 MHz, 2.0V, typical
• Watchdog Timer Current:
- 1 μA @ 2.0V, typical

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 1


PIC16F882/883/884/886/887

Program
Data Memory
Memory 10-bit A/D ECCP/ Timers
Device I/O EUSART MSSP Comparators
Flash SRAM EEPROM (ch) CCP 8/16-bit
(words) (bytes) (bytes)
PIC16F882 2048 128 128 28 11 1/1 1 1 2 2/1
PIC16F883 4096 256 256 24 11 1/1 1 1 2 2/1
PIC16F884 4096 256 256 35 14 1/1 1 1 2 2/1
PIC16F886 8192 368 256 24 11 1/1 1 1 2 2/1
PIC16F887 8192 368 256 35 14 1/1 1 1 2 2/1

DS41291D-page 2 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
Pin Diagrams – PIC16F882/883/886, 28-Pin PDIP, SOIC, SSOP
28-pin PDIP, SOIC, SSOP

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

TABLE 1: PIC16F882/883/886 28-PIN SUMMARY (PDIP, SOIC, SSOP)


I/O Pin Analog Comparators Timers ECCP EUSART MSSP Interrupt Pull-up Basic
RA0 2 AN0/ULPWU C12IN0- — — — — — — —
RA1 3 AN1 C12IN1- — — — — — — —
RA2 4 AN2 C2IN+ — — — — — — VREF-/CVREF
RA3 5 AN3 C1IN+ — — — — — — VREF+
RA4 6 — C1OUT T0CKI — — — — — —
RA5 7 AN4 C2OUT — — — SS — — —
RA6 10 — — — — — — — — OSC2/CLKOUT
RA7 9 — — — — — — — — OSC1/CLKIN
RB0 21 AN12 — — — — — IOC/INT Y —
RB1 22 AN10 C12IN3- — P1C — — IOC Y —
RB2 23 AN8 — — P1B — — IOC Y —
RB3 24 AN9 C12IN2- — — — — IOC Y PGM
RB4 25 AN11 — — P1D — — IOC Y —
RB5 26 AN13 — T1G — — — IOC Y —
RB6 27 — — — — — — IOC Y ICSPCLK
RB7 28 — — — — — — IOC Y ICSPDAT
RC0 11 — — T1OSO/T1CKI — — — — — —
RC1 12 — — T1OSI CCP2 — — — — —
RC2 13 — — — CCP1/P1A — — — — —
RC3 14 — — — — — SCK/SCL — — —
RC4 15 — — — — — SDI/SDA — — —
RC5 16 — — — — — SDO — — —
RC6 17 — — — — TX/CK — — — —
RC7 18 — — — — RX/DT — — — —
RE3 1 — — — — — — — Y(1) MCLR/VPP
— 20 — — — — — — — — VDD
— 8 — — — — — — — — VSS
— 19 — — — — — — — — VSS
Note 1: Pull-up activated only with external MCLR configuration.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 3


PIC16F882/883/884/886/887
Pin Diagrams – PIC16F882/883/886, 28-Pin QFN

28-pin QFN

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

RC4/SDI/SDA

RC6/TX/CK
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/P1A/CCP1
RC3/SCK/SCL

RC5/SDO

DS41291D-page 4 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 2: PIC16F882/883/886 28-PIN SUMMARY (QFN)
I/O Pin Analog Comparators Timers ECCP EUSART MSSP Interrupt Pull-up Basic
RA0 27 AN0/ULPWU C12IN0- — — — — — — —
RA1 28 AN1 C12IN1- — — — — — — —
RA2 1 AN2 C2IN+ — — — — — — VREF-/CVREF
RA3 2 AN3 C1IN+ — — — — — — VREF+
RA4 3 — C1OUT T0CKI — — — — — —
RA5 4 AN4 C2OUT — — — SS — — —
RA6 7 — — — — — — — — OSC2/CLKOUT
RA7 6 — — — — — — — — OSC1/CLKIN
RB0 18 AN12 — — — — — IOC/INT Y —
RB1 19 AN10 C12IN3- — P1C — — IOC Y —
RB2 20 AN8 — — P1B — — IOC Y —
RB3 21 AN9 C12IN2- — — — — IOC Y PGM
RB4 22 AN11 — — P1D — — IOC Y —
RB5 23 AN13 — T1G — — — IOC Y —
RB6 24 — — — — — — IOC Y ICSPCLK
RB7 25 — — — — — — IOC Y ICSPDAT
RC0 8 — — T1OSO/T1CKI — — — — — —
RC1 9 — — T1OSI CCP2 — — — — —
RC2 10 — — — CCP1/P1A — — — — —
RC3 11 — — — — — SCK/SCL — — —
RC4 12 — — — — — SDI/SDA — — —
RC5 13 — — — — — SDO — — —
RC6 14 — — — — TX/CK — — — —
RC7 15 — — — — RX/DT — — — —
RE3 26 — — — — — — — Y(1) MCLR/VPP
— 17 — — — — — — — — VDD
— 5 — — — — — — — — VSS
— 16 — — — — — — — — VSS
Note 1: Pull-up activated only with external MCLR configuration.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 5


PIC16F882/883/884/886/887
Pin Diagrams – PIC16F884/887, 40-Pin PDIP
40-pin PDIP

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

DS41291D-page 6 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 3: PIC16F884/887 40-PIN SUMMARY (PDIP)
I/O Pin Analog Comparators Timers ECCP EUSART MSSP Interrupt Pull-up Basic
RA0 2 AN0/ULPWU C12IN0- — — — — — — —
RA1 3 AN1 C12IN1- — — — — — — —
RA2 4 AN2 C2IN+ — — — — — — VREF-/CVREF
RA3 5 AN3 C1IN+ — — — — — — VREF+
RA4 6 — C1OUT T0CKI — — — — — —
RA5 7 AN4 C2OUT — — — SS — — —
RA6 14 — — — — — — — — OSC2/CLKOUT
RA7 13 — — — — — — — — OSC1/CLKIN
RB0 33 AN12 — — — — — IOC/INT Y —
RB1 34 AN10 C12IN3- — — — — IOC Y —
RB2 35 AN8 — — — — — IOC Y —
RB3 36 AN9 C12IN2- — — — — IOC Y PGM
RB4 37 AN11 — — — — — IOC Y —
RB5 38 AN13 — T1G — — — IOC Y —
RB6 39 — — — — — — IOC Y ICSPCLK
RB7 40 — — — — — — IOC Y ICSPDAT
RC0 15 — — T1OSO/T1CKI — — — — — —
RC1 16 — — T1OSI CCP2 — — — — —
RC2 17 — — — CCP1/P1A — — — — —
RC3 18 — — — — — SCK/SCL — — —
RC4 23 — — — — — SDI/SDA — — —
RC5 24 — — — — — SDO — — —
RC6 25 — — — — TX/CK — — — —
RC7 26 — — — — RX/DT — — — —
RD0 19 — — — — — — — — —
RD1 20 — — — — — — — — —
RD2 21 — — — — — — — — —
RD3 22 — — — — — — — — —
RD4 27 — — — — — — — — —
RD5 28 — — — P1B — — — — —
RD6 29 — — — P1C — — — — —
RD7 30 — — — P1D — — — — —
RE0 8 AN5 — — — — — — — —
RE1 9 AN6 — — — — — — — —
RE2 10 AN7 — — — — — — — —
RE3 1 — — — — — — — Y(1) MCLR/VPP
— 11 — — — — — — — — VDD
— 32 — — — — — — — — VDD
— 12 — — — — — — — — VSS
— 31 — — — — — — — — VSS
Note 1: Pull-up activated only with external MCLR configuration.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 7


PIC16F882/883/884/886/887
Pin Diagrams – PIC16F884/887, 44-Pin QFN

44-pin QFN

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+
RA0/AN0/ULPWU/C12IN0-
RB4/AN11

RA2/AN2/VREF-/CVREF/C2IN+
RB5/AN13/T1G
NC

RB6/ICSPCLK

RE3/MCLR/VPP

DS41291D-page 8 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 4: PIC16F884/887 44-PIN SUMMARY (QFN)
I/O Pin Analog Comparators Timers ECCP EUSART MSSP Interrupt Pull-up Basic
RA0 19 AN0/ULPWU C12IN0- — — — — — — —
RA1 20 AN1 C12IN1- — — — — — — —
RA2 21 AN2 C2IN+ — — — — — — VREF-/CVREF
RA3 22 AN3 C1IN+ — — — — — — VREF+
RA4 23 — C1OUT T0CKI — — — — — —
RA5 24 AN4 C2OUT — — — SS — — —
RA6 33 — — — — — — — — OSC2/CLKOUT
RA7 32 — — — — — — — — OSC1/CLKIN
RB0 9 AN12 — — — — — IOC/INT Y —
RB1 10 AN10 C12IN3- — — — — IOC Y —
RB2 11 AN8 — — — — — IOC Y —
RB3 12 AN9 C12IN2- — — — — IOC Y PGM
RB4 14 AN11 — — — — — IOC Y —
RB5 15 AN13 — T1G — — — IOC Y —
RB6 16 — — — — — — IOC Y ICSPCLK
RB7 17 — — — — — — IOC Y ICSPDAT
RC0 34 — — T1OSO/T1CKI — — — — — —
RC1 35 — — T1OSI CCP2 — — — — —
RC2 36 — — — CCP1/P1A — — — — —
RC3 37 — — — — — SCK/SCL — — —
RC4 42 — — — — — SDI/SDA — — —
RC5 43 — — — — — SDO — — —
RC6 44 — — — — TX/CK — — — —
RC7 1 — — — — RX/DT — — — —
RD0 38 — — — — — — — — —
RD1 39 — — — — — — — — —
RD2 40 — — — — — — — — —
RD3 41 — — — — — — — — —
RD4 2 — — — — — — — — —
RD5 3 — — — P1B — — — — —
RD6 4 — — — P1C — — — — —
RD7 5 — — — P1D — — — — —
RE0 25 AN5 — — — — — — — —
RE1 26 AN6 — — — — — — — —
RE2 27 AN7 — — — — — — — —
RE3 18 — — — — — — — Y(1) MCLR/VPP
— 7 — — — — — — — — VDD
— 8 — — — — — — — — VDD
— 28 — — — — — — — — VDD
— 6 — — — — — — — — VSS
— 30 — — — — — — — — VSS
— 31 — — — — — — — — VSS
— 13 — — — — — — — — NC (no connect)
— 29 — — — — — — — — NC (no connect)
Note 1: Pull-up activated only with external MCLR configuration.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 9


PIC16F882/883/884/886/887
Pin Diagrams – PIC16F884/887, 44-Pin TQFP

44-pin TQFP

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
RB6/ICSPCLK
NC
NC

RE3/MCLR/VPP

RA1/AN1/C12IN1-

RA3/AN3//VREF+/C1IN+
RB7/ICSPDAT
RB4/AN11

RA0/AN0/ULPWU/C12IN0-

RA2/AN2/VREF-/CVREF/C2IN+
RB5/AN13/T1G

DS41291D-page 10 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 5: PIC16F884/887 44-PIN SUMMARY (TQFP)
I/O Pin Analog Comparators Timers ECCP EUSART MSSP Interrupt Pull-up Basic
RA0 19 AN0/ULPWU C12IN0- — — — — — — —
RA1 20 AN1 C12IN1- — — — — — — —
RA2 21 AN2 C2IN+ — — — — — — VREF-/CVREF
RA3 22 AN3 C1IN+ — — — — — — VREF+
RA4 23 — C1OUT T0CKI — — — — — —
RA5 24 AN4 C2OUT — — — SS — — —
RA6 31 — — — — — — — — OSC2/CLKOUT
RA7 31 — — — — — — — — OSC1/CLKIN
RB0 8 AN12 — — — — — IOC/INT Y —
RB1 9 AN10 C12IN3- — — — — IOC Y —
RB2 10 AN8 — — — — — IOC Y —
RB3 11 AN9 C12IN2- — — — — IOC Y PGM
RB4 14 AN11 — — — — — IOC Y —
RB5 15 AN13 — T1G — — — IOC Y —
RB6 16 — — — — — — IOC Y ICSPCLK
RB7 17 — — — — — — IOC Y ICSPDAT
RC0 32 — — T1OSO/T1CKI — — — — — —
RC1 35 — — T1OSI CCP2 — — — — —
RC2 36 — — — CCP1/P1A — — — — —
RC3 37 — — — — — SCK/SCL — — —
RC4 42 — — — — — SDI/SDA — — —
RC5 43 — — — — — SDO — — —
RC6 44 — — — — TX/CK — — — —
RC7 1 — — — — RX/DT — — — —
RD0 38 — — — — — — — — —
RD1 39 — — — — — — — — —
RD2 40 — — — — — — — — —
RD3 41 — — — — — — — — —
RD4 2 — — — — — — — — —
RD5 3 — — — P1B — — — — —
RD6 4 — — — P1C — — — — —
RD7 5 — — — P1D — — — — —
RE0 25 AN5 — — — — — — — —
RE1 26 AN6 — — — — — — — —
RE2 27 AN7 — — — — — — — —
RE3 18 — — — — — — — Y(1) MCLR/VPP
— 7 — — — — — — — — VDD
— 28 — — — — — — — — VDD
— 6 — — — — — — — — VSS
— 13 — — — — — — — — NC (no connect)
— 29 — — — — — — — — VSS
— 34 — — — — — — — — NC (no connect)
— 33 — — — — — — — — NC (no connect)
— 12 — — — — — — — — NC (no connect)
Note 1: Pull-up activated only with external MCLR configuration.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 11


PIC16F882/883/884/886/887
Table of Contents
1.0 Device Overview ........................................................................................................................................................................ 13
2.0 Memory Organization ................................................................................................................................................................. 21
3.0 I/O Ports ..................................................................................................................................................................................... 39
4.0 Oscillator Module (With Fail-Safe Clock Monitor)....................................................................................................................... 61
5.0 Timer0 Module ........................................................................................................................................................................... 73
6.0 Timer1 Module with Gate Control............................................................................................................................................... 76
7.0 Timer2 Module ........................................................................................................................................................................... 81
8.0 Comparator Module.................................................................................................................................................................... 83
9.0 Analog-to-Digital Converter (ADC) Module ................................................................................................................................ 99
10.0 Data EEPROM and Flash Program Memory Control ............................................................................................................... 111
11.0 Enhanced Capture/Compare/PWM Module ............................................................................................................................. 123
12.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 149
13.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 175
14.0 Special Features of the CPU .................................................................................................................................................... 205
15.0 Instruction Set Summary .......................................................................................................................................................... 225
16.0 Development Support............................................................................................................................................................... 235
17.0 Electrical Specifications............................................................................................................................................................ 239
18.0 DC and AC Characteristics Graphs and Tables ....................................................................................................................... 261
19.0 Packaging Information.............................................................................................................................................................. 263
Appendix A: Data Sheet Revision History.......................................................................................................................................... 273
Appendix B: Migrating from other PIC® Devices ............................................................................................................................... 273
Index .................................................................................................................................................................................................. 275
The Microchip Web Site ..................................................................................................................................................................... 283
Customer Change Notification Service .............................................................................................................................................. 283
Customer Support .............................................................................................................................................................................. 283
Reader Response .............................................................................................................................................................................. 284
Product Identification System............................................................................................................................................................. 285

TO OUR VALUED CUSTOMERS


It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via E-
mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We wel-
come your feedback.

Most Current Data Sheet


To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).

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:
• Microchip’s 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.

Customer Notification System


Register on our web site at www.microchip.com to receive the most current information on all of our products.

DS41291D-page 12 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
1.0 DEVICE OVERVIEW
The PIC16F882/883/884/886/887 is covered by this
data sheet. The PIC16F882/883/886 is available in 28-
pin PDIP, SOIC, SSOP and QFN packages. The
PIC16F884/887 is available in a 40-pin PDIP and 44-
pin QFN and TQFP packages. Figure 1-1 shows the
block diagram of PIC16F882/883/886 and Figure 1-2
shows a block diagram of the PIC16F884/887 device.
Table 1-1 and Table 1-2 show the corresponding pinout
descriptions.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 13


PIC16F882/883/884/886/887
FIGURE 1-1: PIC16F882/883/886 BLOCK DIAGRAM

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

STATUS Reg PORTC


8 RC0
RC1
RC2
3 RC3
MUX
Power-up RC4
Timer RC5
Instruction RC6
Oscillator
Decode & Start-up Timer RC7
ALU
Control
Power-on PORTE
OSC1/CLKIN Reset 8
Timing Watchdog
Generation W Reg
Timer
Brown-out RE3
OSC2/CLKOUT CCP2
Reset
Internal
Oscillator
Block
CCP2
MCLR VDD VSS

In-Circuit
Debugger
(ICD)

T1OSI Timer1
32 kHz
CCP1/P1A

SCK/SCL
SDI/SDA

T1OSO Oscillator
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 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

Note 1: PIC16F883 only.


2: PIC16F882 only.

DS41291D-page 14 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
FIGURE 1-2: PIC16F884/PIC16F887 BLOCK DIAGRAM

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

STATUS Reg PORTC


8 RC0
RC1
RC2
3 RC3
Power-up MUX
RC4
Timer RC5
Instruction RC6
Oscillator
Decode & Start-up Timer RC7
ALU
Control
Power-on PORTD
OSC1/CLKIN Reset 8 RD0
Timing Watchdog RD1
Generation W Reg RD2
Timer
RD3
OSC2/CLKOUT Brown-out CCP2
RD4
Reset
RD5
Internal RD6
Oscillator RD7
Block CCP2
PORTE
MCLR VDD VSS
RE0
In-Circuit RE1
Debugger RE2
(ICD)
RE3

T1OSI Timer1
32 kHz
CCP1/P1A

SCK/SCL
SDI/SDA

T1OSO Oscillator
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

Note 1: PIC16F884 only.

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 15


PIC16F882/883/884/886/887

TABLE 1-1: PIC16F882/883/886 PINOUT DESCRIPTION


Input Output
Name Function Description
Type Type
RA0/AN0/ULPWU/C12IN0- RA0 TTL CMOS General purpose I/O.
AN0 AN — A/D Channel 0 input.
ULPWU AN — Ultra Low-Power Wake-up input.
C12IN0- AN — Comparator C1 or C2 negative input.
RA1/AN1/C12IN1- RA1 TTL CMOS General purpose I/O. Individually enabled pull-up.
AN1 AN — A/D Channel 1 input.
C12IN1- AN — Comparator C1 or C2 negative input.
RA2/AN2/VREF-/CVREF/C2IN+ RA2 TTL CMOS General purpose I/O.
AN2 AN — A/D Channel 2.
VREF- AN — A/D Negative Voltage Reference input.
CVREF — AN Comparator Voltage Reference output.
C2IN+ AN — Comparator C2 positive input.
RA3/AN3/VREF+/C1IN+ RA3 TTL — General purpose I/O.
AN3 AN — A/D Channel 3.
VREF+ AN — Programming voltage.
C1IN+ AN — Comparator C1 positive input.
RA4/T0CKI/C1OUT RA4 TTL CMOS General purpose I/O. Individually enabled pull-up.
T0CKI ST — Timer0 clock input.
C1OUT — CMOS Comparator C1 output.
RA5/AN4/SS/C2OUT RA5 TTL CMOS General purpose I/O.
AN4 AN — A/D Channel 4.
SS ST — Slave Select input.
C2OUT — CMOS Comparator C2 output.
RA6/OSC2/CLKOUT RA6 TTL CMOS General purpose I/O.
OSC2 — XTAL Master Clear with internal pull-up.
CLKOUT — CMOS FOSC/4 output.
RA7/OSC1/CLKIN RA7 TTL CMOS General purpose I/O.
OSC1 XTAL — Crystal/Resonator.
CLKIN ST — External clock input/RC oscillator connection.
RB0/AN12/INT RB0 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN12 AN — A/D Channel 12.
INT ST — External interrupt.
RB1/AN10/P1C/C12IN3- RB1 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN10 AN — A/D Channel 10.
P1C — CMOS PWM output.
C12IN3- AN — Comparator C1 or C2 negative input.
RB2/AN8/P1B RB2 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN8 AN — A/D Channel 8.
P1B — CMOS PWM output.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
HV = High Voltage XTAL = Crystal

DS41291D-page 16 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 1-1: PIC16F882/883/886 PINOUT DESCRIPTION (CONTINUED)
Input Output
Name Function Description
Type Type
RB3/AN9/PGM/C12IN2- RB3 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN9 AN — A/D Channel 9.
PGM ST — Low-voltage ICSP™ Programming enable pin.
C12IN2- AN — Comparator C1 or C2 negative input.
RB4/AN11/P1D RB4 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN11 AN — A/D Channel 11.
P1D — CMOS PWM output.
RB5/AN13/T1G RB5 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN13 AN — A/D Channel 13.
T1G ST — Timer1 Gate input.
RB6/ICSPCLK RB6 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
ICSPCLK ST — Serial Programming Clock.
RB7/ICSPDAT RB7 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
ICSPDAT ST CMOS ICSP™ Data I/O.
RC0/T1OSO/T1CKI RC0 ST CMOS General purpose I/O.
T1OSO — CMOS Timer1 oscillator output.
T1CKI ST — Timer1 clock input.
RC1/T1OSI/CCP2 RC1 ST CMOS General purpose I/O.
T1OSI ST — Timer1 oscillator input.
CCP2 ST CMOS Capture/Compare/PWM2.
RC2/P1A/CCP1 RC2 ST CMOS General purpose I/O.
P1A — CMOS PWM output.
CCP1 ST CMOS Capture/Compare/PWM1.
RC3/SCK/SCL RC3 ST CMOS General purpose I/O.
SCK ST CMOS SPI clock.
SCL ST OD I2C™ clock.
RC4/SDI/SDA RC4 ST CMOS General purpose I/O.
SDI ST — SPI data input.
SDA ST OD I2C data input/output.
RC5/SDO RC5 ST CMOS General purpose I/O.
SDO — CMOS SPI data output.
RC6/TX/CK RC6 ST CMOS General purpose I/O.
TX — CMOS EUSART asynchronous transmit.
CK ST CMOS EUSART synchronous clock.
RC7/RX/DT RC7 ST CMOS General purpose I/O.
RX ST — EUSART asynchronous input.
DT ST CMOS EUSART synchronous data.
RE3/MCLR/VPP RE3 TTL — General purpose input.
MCLR ST — Master Clear with internal pull-up.
VPP HV — Programming voltage.
VSS VSS Power — Ground reference.
VDD VDD Power — Positive supply.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
HV = High Voltage XTAL = Crystal

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 17


PIC16F882/883/884/886/887

TABLE 1-2: PIC16F884/887 PINOUT DESCRIPTION


Input Output
Name Function Description
Type Type
RA0/AN0/ULPWU/C12IN0- RA0 TTL CMOS General purpose I/O.
AN0 AN — A/D Channel 0 input.
ULPWU AN — Ultra Low-Power Wake-up input.
C12IN0- AN — Comparator C1 or C2 negative input.
RA1/AN1/C12IN1- RA1 TTL CMOS General purpose I/O.
AN1 AN — A/D Channel 1 input.
C12IN1- AN — Comparator C1 or C2 negative input.
RA2/AN2/VREF-/CVREF/C2IN+ RA2 TTL CMOS General purpose I/O.
AN2 AN — A/D Channel 2.
VREF- AN — A/D Negative Voltage Reference input.
CVREF — AN Comparator Voltage Reference output.
C2IN+ AN — Comparator C2 positive input.
RA3/AN3/VREF+/C1IN+ RA3 TTL CMOS General purpose I/O.
AN3 AN — A/D Channel 3.
VREF+ AN — A/D Positive Voltage Reference input.
C1IN+ AN — Comparator C1 positive input.
RA4/T0CKI/C1OUT RA4 TTL CMOS General purpose I/O.
T0CKI ST — Timer0 clock input.
C1OUT — CMOS Comparator C1 output.
RA5/AN4/SS/C2OUT RA5 TTL CMOS General purpose I/O.
AN4 AN — A/D Channel 4.
SS ST — Slave Select input.
C2OUT — CMOS Comparator C2 output.
RA6/OSC2/CLKOUT RA6 TTL CMOS General purpose I/O.
OSC2 — XTAL Crystal/Resonator.
CLKOUT — CMOS FOSC/4 output.
RA7/OSC1/CLKIN RA7 TTL CMOS General purpose I/O.
OSC1 XTAL — Crystal/Resonator.
CLKIN ST — External clock input/RC oscillator connection.
RB0/AN12/INT RB0 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN12 AN — A/D Channel 12.
INT ST — External interrupt.
RB1/AN10/C12IN3- RB1 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN10 AN — A/D Channel 10.
C12IN3- AN — Comparator C1 or C2 negative input.
RB2/AN8 RB2 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN8 AN — A/D Channel 8.
RB3/AN9/PGM/C12IN2- RB3 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN9 AN — A/D Channel 9.
PGM ST — Low-voltage ICSP™ Programming enable pin.
C12IN2- AN — Comparator C1 or C2 negative input.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
HV = High Voltage XTAL = Crystal

DS41291D-page 18 Preliminary © 2007 Microchip Technology Inc.


PIC16F882/883/884/886/887
TABLE 1-2: PIC16F884/887 PINOUT DESCRIPTION (CONTINUED)
Input Output
Name Function Description
Type Type
RB4/AN11 RB4 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN11 AN — A/D Channel 11.
RB5/AN13/T1G RB5 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
AN13 AN — A/D Channel 13.
T1G ST — Timer1 Gate input.
RB6/ICSPCLK RB6 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
ICSPCLK ST — Serial Programming Clock.
RB7/ICSPDAT RB7 TTL CMOS General purpose I/O. Individually controlled interrupt-on-change.
Individually enabled pull-up.
ICSPDAT ST TTL ICSP™ Data I/O.
RC0/T1OSO/T1CKI RC0 ST CMOS General purpose I/O.
T1OSO — XTAL Timer1 oscillator output.
T1CKI ST — Timer1 clock input.
RC1/T1OSI/CCP2 RC1 ST CMOS General purpose I/O.
T1OSI XTAL — Timer1 oscillator input.
CCP2 ST CMOS Capture/Compare/PWM2.
RC2/P1A/CCP1 RC2 ST CMOS General purpose I/O.
P1A ST CMOS PWM output.
CCP1 — CMOS Capture/Compare/PWM1.
RC3/SCK/SCL RC3 ST CMOS General purpose I/O.
SCK ST CMOS SPI clock.
SCL ST OD I2C™ clock.
RC4/SDI/SDA RC4 ST CMOS General purpose I/O.
SDI ST — SPI data input.
SDA ST OD I2C data input/output.
RC5/SDO RC5 ST CMOS General purpose I/O.
SDO — CMOS SPI data output.
RC6/TX/CK RC6 ST CMOS General purpose I/O.
TX — CMOS EUSART asynchronous transmit.
CK ST CMOS EUSART synchronous clock.
RC7/RX/DT RC7 ST CMOS General purpose I/O.
RX ST — EUSART asynchronous input.
DT ST CMOS EUSART synchronous data.
RD0 RD0 TTL CMOS General purpose I/O.
RD1 RD1 TTL CMOS General purpose I/O.
RD2 RD2 TTL CMOS General purpose I/O.
RD3 RD3 TTL CMOS General purpose I/O.
RD4 RD4 TTL CMOS General purpose I/O.
RD5/P1B RD5 TTL CMOS General purpose I/O.
P1B — CMOS PWM output.
RD6/P1C RD6 TTL CMOS General purpose I/O.
P1C — CMOS PWM output.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
HV = High Voltage XTAL = Crystal

© 2007 Microchip Technology Inc. Preliminary DS41291D-page 19


PIC16F882/883/884/886/887
TABLE 1-2: PIC16F884/887 PINOUT DESCRIPTION (CONTINUED)
Input Output
Name Function Description
Type Type
RD7/P1D RD7 TTL CMOS General purpose I/O.
P1D AN — PWM output.
RE0/AN5 RE0 TTL CMOS General purpose I/O.
AN5 AN — A/D Channel 5.
RE1/AN6 RE1 ST CMOS General purpose I/O.
AN6 AN — A/D Channel 6.
RE2/AN7 RE2 TTL CMOS General purpose I/O.
AN7 AN — A/D Channel 7.
RE3/MCLR/VPP RE3 TTL — General purpose input.
MCLR ST — Master Clear with internal pull-up.
VPP HV — Programming voltage.
VSS VSS Power — Ground reference.
VDD VDD Power — Positive supply.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
HV = High Voltage XTAL = Crystal

DS41291D-page 20 Preliminary © 2007 Microchip Technology Inc.

Vous aimerez peut-être aussi