This document contains device specific information.
Additional information may be found in the PIC
Mid-Range Reference Manual (DS33023), which may
be obtained from your local Microchip Sales Representative or downloaded from the Microchip website. The
Reference Manual should be considered a complementary document to this data sheet, and is highly recommended reading for a better understanding of the device
architecture and operation of the peripheral modules.
FIGURE 1-1:PIC16F873 AND PIC16F876 BLOCK DIAGRAM
®
MCU
There are four devices (PIC16F873, PIC16F874,
PIC16F876 and PIC16F877) covered by this data
sheet. The PIC16F876/873 devices come in 28-pin
packages and the PIC16F877/874 devices come in
40-pin packages. The Parallel Slave Port is not
implemented on the 28-pin devic es .
The following device bloc k diagrams are s orted by pin
number; 28-pin for Figure 1-1 and 40-pin for Figure 1-2.
The 28-pin and 40-pin pin outs are listed in Table 1-1
and Table 1-2, respectively.
OSC2/CLKOUT1010O—Oscillator crystal output. Connects to crystal or resonator in
crystal oscillator mode. In RC mode, the OSC2 pin outputs
CLKOUT which has 1/4 the frequency of OSC1, and denotes
the instruction cycle rate.
/VPP11I/PSTMaster Clear (Reset) input or programming voltage input. This
MCLR
pin is an active low RESET to the device.
PORTA is a bi-directional I/O port.
RA0/AN022I/OTTLRA0 can also be analog input0.
RA1/AN133I/OTTLRA1 can also be analog input1.
RA2/AN2/V
REF-44I/OTTLRA2 can also be analog input2 or negative analog
reference voltage.
RA3/AN3/V
REF+55I/OTTLRA3 can also be analog input3 or positive analog
reference voltage.
RA4/T0CKI66I/OSTRA4 can also be the clock input to the Timer0
module. Output is open drain type.
/AN477I/OTTLRA5 can also be analog input4 or the slave select
RA5/SS
for the synchronous serial port.
PORTB is a bi-directional I/O port. PORTB can be software
programmed for internal weak pull-up on all inputs.
RB0/INT2121I/OTTL/ST
(1)
RB0 can also be the external interrupt pin.
RB12222I/OTTL
RB22323I/OTTL
RB3/PGM2424I/OTTLRB3 can also be the low voltage programming input.
RB42525I/OTTLInterrupt-on-change pin.
RB52626I/OTTLInterrupt-on-change pin.
RB6/PGC2727I/OTTL/ST
(2)
Interrupt-on-change pin or In-Circuit Debugger pin. Serial
programming clock.
RB7/PGD2828I/OTTL/ST
(2)
Interrupt-on-change pin or In-Circuit Debugger pin. Serial
programming data.
PORTC is a bi-directional I/O port.
RC0/T1OSO/T1CKI1111I/OSTRC0 can also be the Timer1 oscillator output or Timer1
clock input.
RC1/T1OSI/CCP21212I/OSTRC1 can also be the Timer1 oscillator input or Capture2
input/Compare2 output/PWM2 output.
RC2/CCP11313I/OSTRC2 can also be the Capture1 input/Compare1 output/
PWM1 output.
RC3/SCK/SCL1414I/OSTRC3 can also be the synchronous serial clock input/output
for both SPI and I
RC4/SDI/SDA1515I/OSTRC4 can also be the SPI Data In (SPI mode) or
data I/O (I
2
C mode).
2
C modes.
RC5/SDO1616I/OSTRC5 can also be the SPI Data Out (SPI mode).
RC6/TX/CK1717I/OSTRC6 can also be the USART Asynchronous Transmit or
Synchronous Clock.
RC7/RX/DT1818I/OSTRC7 can also be the USART Asynchronous Receive or
Synchronous Data.
SS8, 198, 19P—Ground reference for logic and I/O pins.
V
DD2020P—Positive supply for logic and I/O pins.
V
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
TABLE 1-2:PIC16F874 AND PIC16F877 PINOUT DESCRIPTION
DIP
Pin Name
OSC1/CLKIN131430IST/CMOS
OSC2/CLKOUT141531O—Oscillator crystal output. Connects to crystal or resonator
/VPP1218I/PSTMaster Clear (Reset) input or programming voltage input.
MCLR
RA0/AN02319I/OTTLRA0 can also be analog input0.
RA1/AN13420I/OTTLRA1 can also be analog input1.
RA2/AN2/V
RA3/AN3/V
RA4/T0CKI6723I/OSTRA4 can also be the clock input to the Timer0 timer/
RA5/SS/
RB0/INT33368I/OTTL/ST
RB134379I/OTTL
RB2353810I /OTTL
RB3/PGM363911I/OTTLRB3 can also be the low voltage programming input.
RB4374114I/OTTLInterrupt-on-change pin.
RB5384215I/OTTLInterrupt-on-change pin.
RB6/PGC394316I/OTTL/ST
RB7/PGD404417I/OTTL/ST
Legend: I = inputO = outputI/O = input/outputP = power
Note 1: This buffer is a Schmitt Trigger input when configured as an external interrupt.
REF-4521I/OTTLRA2 can also be analog input2 or negative
REF+5622I/OTTLRA3 can also be analog input3 or positive
AN47824I/OTTLRA5 can also be analog input4 or the slave select for
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel
Slave Port mode (for interfacing to a microprocessor bus).
4: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
Note 1: This buffer is a Schmitt Trigger input when configured as an external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured as general purpose I/O and a TTL input when used in the Parallel
Slave Port mode (for interfacing to a microprocessor bus).
4: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise.
QFP
Pin#
33,34
I/O/P
Type
Buffer
Type
Description
PORTC is a bi-directional I/O port.
Timer1 clock input.
Capture2 input/Compare2 output/PWM2 output.
output/PWM1 output.
2
output for both SPI and I
2
data I/O (I
C mode).
C modes.
or Synchronous Clock.
or Synchronous Data.
PORTD is a bi-directional I/O port or parallel slave port
when interfacing to a microprocessor bus.
(3)
(3)
(3)
(3)
(3)
(3)
(3)
(3)
PORTE is a bi-directional I/O port.
(3)
RE0 can also be read control for the parallel slave
port, or analog input5.
(3)
RE1 can also be write control for the parallel slave
port, or analog input6.
(3)
RE2 can also be select control for the parallel slave
port, or analog input7.
—These pins are not internally connected. These pins