PIC16F87X 28/40-Pin 8-Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet: Pin Diagram PIC16F873 PIC16F876 PDIP PIC16F874 PIC16F877 MCLR/VPP 1 40 RB7/PGD RA0/AN0 2 39 RB6/PGC Microcontroller Core Features: RA1/AN1 3 38 RB5 RA2/AN2/VREF- 4 37 RB4 High performance RISC CPU RA3/AN3/VREF+ RB3/PGM 5 36 RA4/T0CKI RB2 6 35 Only 35 single word instructions to learn RA5/AN4/SS 7 34 RB1 All single cycle instructions except for program RE0/RD/AN5 8 33 RB0/INT branches which are two cycle RE1/WR/AN6 VDD 9 32 RE2/CS/AN7 10 31 VSS Operating speed: DC - 20 MHz clock input VDD 11 30 RD7/PSP7 DC - 200 ns instruction cycle VSS 12 29 RD6/PSP6 Up to 8K x 14 words of FLASH Program Memory, OSC1/CLKIN 28 RD5/PSP5 13 OSC2/CLKOUT RD4/PSP4 Up to 368 x 8 bytes of Data Memory (RAM) 14 27 RC0/T1OSO/T1CKI RC7/RX/DT 15 26 Up to 256 x 8 bytes of EEPROM Data Memory RC1/T1OSI/CCP2 16 25 RC6/TX/CK Pinout compatible to the PIC16C73B/74B/76/77 RC2/CCP1 17 24 RC5/SDO Interrupt capability (up to 14 sources) RC3/SCK/SCL 18 23 RC4/SDI/SDA RD0/PSP0 RD3/PSP3 19 22 Eight level deep hardware stack RD1/PSP1 20 21 RD2/PSP2 Direct, indirect and relative addressing modes Power-on Reset (POR) Power-up Timer (PWRT) and Peripheral Features: Oscillator Start-up Timer (OST) Watchdog Timer (WDT) with its own on-chip RC Timer0: 8-bit timer/counter with 8-bit prescaler oscillator for reliable operation Timer1: 16-bit timer/counter with prescaler, Programmable code protection can be incremented during SLEEP via external Power saving SLEEP mode crystal/clock Selectable oscillator options Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler Low power, high speed CMOS FLASH/EEPROM technology Two Capture, Compare, PWM modules Fully static design - Capture is 16-bit, max. resolution is 12.5 ns In-Circuit Serial Programming (ICSP)via two - Compare is 16-bit, max. resolution is 200 ns pins - PWM max. resolution is 10-bit Single 5V In-Circuit Serial Programming capability 10-bit multi-channel Analog-to-Digital converter In-Circuit Debugging via two pins Synchronous Serial Port (SSP) with SPI (Master 2 Processor read/write access to program memory mode) and I C (Master/Slave) Wide operating voltage range: 2.0V to 5.5V Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address High Sink/Source Current: 25 mA detection Commercial, Industrial and Extended temperature Parallel Slave Port (PSP) 8-bits wide, with ranges external RD, WR and CS controls (40/44-pin only) Low-power consumption: Brown-out detection circuitry for - < 0.6 mA typical 3V, 4 MHz Brown-out Reset (BOR) -20 A typical 3V, 32 kHz -< 1 A typical standby current 1998-2013 Microchip Technology Inc. DS30292D-page 1 PIC16F877/874PIC16F87X Pin Diagrams PDIP, SOIC 1 28 RB7/PGD MCLR/VPP 27 2 RB6/PGC RA0/AN0 3 26 RB5 RA1/AN1 RB4 RA2/AN2/VREF- 4 25 5 24 RB3/PGM RA3/AN3/VREF+ 23 RB2 RA4/T0CKI 6 RA5/AN4/SS 7 22 RB1 8 21 RB0/INT VSS 9 VDD OSC1/CLKIN 20 10 19 VSS OSC2/CLKOUT 11 18 RC7/RX/DT RC0/T1OSO/T1CKI RC6/TX/CK RC1/T1OSI/CCP2 12 17 16 RC5/SDO RC2/CCP1 13 RC4/SDI/SDA RC3/SCK/SCL 14 15 PLCC RA4/T0CKI 39 RB3/PGM 7 RA5/AN4/SS 38 RB2 8 RE0/RD/AN5 37 RB1 9 RE1/WR/AN6 36 RB0/INT 10 RE2/CS/AN7 35 VDD 11 PIC16F877 VDD 34 VSS 12 PIC16F874 VSS 33 RD7/PSP7 13 OSC1/CLKIN 32 RD6/PSP6 14 OSC2/CLKOUT 31 RD5/PSP5 15 RC0/T1OSO/T1CK1 30 RD4/PSP4 16 NC 29 RC7/RX/DT 17 QFP NC 1 33 RC7/RX/DT RC0/T1OSO/T1CKI 32 RD4/PSP4 2 OSC2/CLKOUT 31 RD5/PSP5 3 30 OSC1/CLKIN RD6/PSP6 4 VSS 29 RD7/PSP7 5 PIC16F877 28 VDD VSS 6 PIC16F874 RE2/AN7/CS 27 VDD 7 RE1/AN6/WR 26 RB0/INT 8 RE0/AN5/RD RB1 9 25 RA5/AN4/SS 24 RB2 10 23 11 RA4/T0CKI RB3/PGM DS30292D-page 2 1998-2013 Microchip Technology Inc. NC 44 12 RC6/TX/CK NC 13 43 RC5/SDO RB4 42 14 RC4/SDI/SDA RB5 41 15 RD3/PSP3 RB6/PGC 40 16 RD2/PSP2 RB7/PGD 39 17 RD1/PSP1 PIC16F876/873 MCLR/VPP 38 18 RD0/PSP0 RA0/AN0 19 37 RC3/SCK/SCL RA1/AN1 36 RC2/CCP1 20 RA2/AN2/VREF- 35 RC1/T1OSI/CCP2 21 RA3/AN3/VREF+ 22 34 NC RC1/T1OSI/CCP2 18 6 RA3/AN3/VREF+ RC2/CCP1 19 5 RA2/AN2/VREF- RC3/SCK/SCL 4 RA1/AN1 20 RD0/PSP0 3 21 RA0/AN0 RD1/PSP1 22 2 MCLR/VPP RD2/PSP2 1 NC 23 RD3/PSP3 44 24 RB7/PGD RC4/SDI/SDA 25 43 RB6/PGC RC5/SDO 26 42 RB5 RC6/TX/CK 27 41 RB4 NC 28 40 NC