PIC16F877A
The PIC16F877A is an electronic component from Microchip Technology. View the full PIC16F877A datasheet below including pinout, electrical characteristics, absolute maximum ratings.
Manufacturer
Microchip Technology
Overview
Part: PIC16F873A/874A/876A/877A — Microchip Type: Enhanced Flash Microcontroller Description: High-performance RISC microcontroller with up to 8K x 14 words Flash program memory, 368 x 8 bytes Data RAM, 256 x 8 bytes EEPROM, operating at DC - 20 MHz, featuring integrated peripherals like A/D converter, CCP modules, and serial communication interfaces.
Operating Conditions:
- Supply voltage: 2.0V to 5.5V
- Operating temperature: Commercial and Industrial ranges
- Operating speed: DC - 20 MHz clock input
Absolute Maximum Ratings:
Key Specs:
- Program Memory: Up to 8K x 14 words Flash
- Data Memory (RAM): Up to 368 x 8 bytes
- EEPROM Data Memory: Up to 256 x 8 bytes
- Instruction Set: 35 single-word instructions
- Instruction Cycle: DC - 200 ns
- A/D Converter: 10-bit, up to 8-channel
- Capture/Compare/PWM Modules: 2 (16-bit Capture, 16-bit Compare, 10-bit PWM)
- Data EEPROM Erase/Write Cycles: 1,000,000 typical
- Flash Program Memory Erase/Write Cycles: 100,000 typical
Features:
- Three 8-bit/16-bit Timers (Timer0, Timer1, Timer2)
- Synchronous Serial Port (SSP) with SPI (Master) and I2C (Master/Slave)
- Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)
- Parallel Slave Port (PSP) (40/44-pin only)
- Brown-out detection circuitry for Brown-out Reset (BOR)
- In-Circuit Serial Programming (ICSP) and In-Circuit Debug (ICD)
- Watchdog Timer (WDT)
- Power saving Sleep mode
Applications:
Package:
- 28-pin PDIP
- 28-pin SOIC
- 28-pin SSOP
- 28-pin QFN
- 40-pin PDIP
- 44-pin PLCC
- 44-pin TQFP
- 44-pin QFN
Features
- Timer0: 8-bit timer/counter with 8-bit prescaler
- Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external crystal/clock
- Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
- Two Capture, Compare, PWM modules
- -Capture is 16-bit, max. resolution is 12.5 ns
- -Compare is 16-bit, max. resolution is 200 ns
- -PWM max. resolution is 10-bit
- Synchronous Serial Port (SSP) with SPI (Master mode) and I 2 C™ (Master/Slave)
- Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection
- Parallel Slave Port (PSP) - 8 bits wide with external RD, WR and CS controls (40/44-pin only)
- Brown-out detection circuitry for Brown-out Reset (BOR)
Pin Configuration
PIC16F877A Pinout
28-Pin PDIP/SOIC/SSOP
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | MCLR/VPP | I | Master Clear (Reset) / Programming Voltage |
| 2 | RA0/AN0 | I/O | Port A, Bit 0 / Analog Input 0 |
| 3 | RA1/AN1 | I/O | Port A, Bit 1 / Analog Input 1 |
| 4 | RA2/AN2/VREF−/CVREF | I/O | Port A, Bit 2 / Analog Input 2 / Negative Voltage Reference / Comparator Voltage Reference |
| 5 | RA3/AN3/VREF+ | I/O | Port A, Bit 3 / Analog Input 3 / Positive Voltage Reference |
| 6 | RA4/T0CKI/C1OUT | I/O | Port A, Bit 4 / Timer0 Clock Input / Comparator 1 Output |
| 7 | RA5/AN4/SS/C2OUT | I/O | Port A, Bit 5 / Analog Input 4 / Slave Select / Comparator 2 Output |
| 8 | VSS | P | Ground |
| 9 | OSC1/CLKI | I | Oscillator 1 / Clock Input |
| 10 | OSC2/CLKO | O | Oscillator 2 / Clock Output |
| 11 | RC0/T1OSO/T1CKI | I/O | Port C, Bit 0 / Timer1 Oscillator Output / Timer1 Clock Input |
| 12 | RC1/T1OSI/CCP2 | I/O | Port C, Bit 1 / Timer1 Oscillator Input / Capture/Compare/PWM 2 |
| 13 | RC2/CCP1 | I/O | Port C, Bit 2 / Capture/Compare/PWM 1 |
| 14 | RC3/SCK/SCL | I/O | Port C, Bit 3 / SPI Clock / I²C Clock |
| 15 | RC4/SDI/SDA | I/O | Port C, Bit 4 / SPI Data In / I²C Data |
| 16 | RC5/SDO | I/O | Port C, Bit 5 / SPI Data Out |
| 17 | RC6/TX/CK | I/O | Port C, Bit 6 / USART Transmit / USART Clock |
| 18 | RC7/RX/DT | I/O | Port C, Bit 7 / USART Receive / USART Data |
| 19 | VSS | P | Ground |
| 20 | VDD | P | Power Supply (+5V) |
| 21 | RB0/INT | I/O | Port B, Bit 0 / External Interrupt |
| 22 | RB1 | I/O | Port B, Bit 1 |
| 23 | RB2 | I/O | Port B, Bit 2 |
| 24 | RB3/PGM | I/O | Port B, Bit 3 / Programming Mode |
| 25 | RB4 | I/O | Port B, Bit 4 |
| 26 | RB5 | I/O | Port B, Bit 5 |
| 27 | RB6/PGC | I/O | Port B, Bit 6 / Programming Clock |
| 28 | RB7/PGD | I/O | Port B, Bit 7 / Programming Data |
Notes
- Package: 28-pin PDIP, SOIC, or SSOP (all share identical pinout)
- Power pins: VSS (pins 8, 19) = Ground; VDD (pin 20) = +5V
- MCLR: Pin 1 requires pull-up resistor and decoupling capacitor; VPP used during in-circuit programming
- Oscillator: Pins 9–10 for external crystal or clock input
- Port A: 6 I/O pins with analog input capability (AN0–AN4) and voltage reference inputs
- Port B: 8 I/O pins; RB0 has external interrupt capability; RB3, RB6, RB7 used for ICSP programming
- Port C: 8 I/O pins with multiple peripheral functions (USART, SPI, I²C, Timer1, Comparators, CCP)
- Analog features: 5 analog input channels (AN0–AN4), 2 voltage reference pins (VREF+, VREF−), 2 comparator outputs (C1OUT, C2OUT)
Electrical Characteristics
PIC16LF873A/874A/876A/877A (Industrial)
| PIC16LF873A/874A/876A/877A (Industrial) | PIC16LF873A/874A/876A/877A (Industrial) | PIC16LF873A/874A/876A/877A (Industrial) | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial |
|---|---|---|---|---|---|---|---|
| PIC16F873A/874A/876A/877A (Industrial, Extended) | PIC16F873A/874A/876A/877A (Industrial, Extended) | PIC16F873A/874A/876A/877A (Industrial, Extended) | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial -40°C T A +125°C for extended | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial -40°C T A +125°C for extended | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial -40°C T A +125°C for extended | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial -40°C T A +125°C for extended | Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C T A +85°C for industrial -40°C T A +125°C for extended |
| Param No. | Symbol | Characteristic/ Device | Min | Typ† | Max | Units | Conditions |
| D001 | VDD | Supply Voltage | Supply Voltage | Supply Voltage | Supply Voltage | Supply Voltage | Supply Voltage |
| D001 | VDD | 16LF87XA | 2.0 | - | 5.5 | V | All configurations (DC to 10 MHz) |
| D001 D001A | 16F87XA | 4.0 VBOR | - | 5.5 5.5 | V V | All configurations BOR enabled, FMAX = 14 MHz (7) | |
| D002 | VDR | RAM Data Retention Voltage (1) | - | 1.5 | - | V | |
| D003 | VPOR | VDD Start Voltage to ensure internal Power-on Reset signal | - | VSS | - | V | See Section 14.5 'Power-on Reset (POR)' for details |
| D004 | SVDD | VDD Rise Rate to ensure internal Power-on Reset signal | 0.05 | - | - | V/ms | See Section 14.5 'Power-on Reset (POR)' for details |
| D005 | VBOR | Brown-out Reset Voltage | 3.65 | 4.0 | 4.35 | V | BODEN bit in configuration word enabled |
Legend: Rows with standard voltage device data only are shaded for improved readability.
- † Data in 'Typ' column is at 5V, 25°C, unless otherwise stated. These parameters are for design guidance only and are not tested.
Note
- 1: This is the limit to which VDD can be lowered without losing RAM data.
- 2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin loading, switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption.
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 enabled/disabled as specified.
- 3: 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 and VSS.
- 4: For RC osc configuration, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in k .
- 5: Timer1 oscillator (when enabled) adds approximately 20 A to the specification. This value is from characterization and is for design guidance only. This is not tested.
- 6: The current is the additional current consumed when this peripheral is enabled. This current should be added to the base IDD or IPD measurement.
- 7: When BOR is enabled, the device will operate correctly until the VBOR voltage trip point is reached.
Absolute Maximum Ratings
| Ambient temperature under bias.................................................................................................................-55 | to +125°C |
|---|---|
| Storage temperature .............................................................................................................................. -65°C to | +150°C |
| Voltage on any pin with respect to VSS (except VDD, MCLR. and RA4) ......................................... -0.3V to | (VDD + 0.3V) |
| Voltage on VDD with respect to VSS ............................................................................................................ | -0.3 to +7.5V |
| Voltage on MCLR with respect to VSS (Note 2) .................................................................................................0 | to +14V |
| Voltage on RA4 with respect to Vss..................................................................................................................0 | to +8.5V |
| Total power dissipation (Note 1) ...............................................................................................................................1.0W | |
| Maximum current out of VSS pin ...........................................................................................................................300 | mA |
| Maximum current into VDD pin ..............................................................................................................................250 | mA |
| Input clamp current, I IK (V I < 0 or VI > VDD) | 20 mA |
| Output clamp current, I OK (VO < 0 or VO > VDD) | 20 mA |
| Maximum output current sunk by any I/O pin..........................................................................................................25 | mA |
| Maximum output current sourced by any I/O pin ....................................................................................................25 | mA |
| Maximum current sunk by PORTA, PORTB and PORTE (combined) (Note 3) ....................................................200 | mA |
| Maximum current sourced by PORTA, PORTB and PORTE (combined) (Note 3) ...............................................200 | mA |
| Maximum current sunk by PORTC and PORTD (combined) (Note 3) .................................................................200 | mA |
| Maximum current sourced by PORTC and PORTD (combined) (Note 3) ............................................................200 | mA |
Note 1: Power dissipation is calculated as follows: Pdis = VDD x {IDD - IOH} + {(VDD - VOH) x IOH} + (VOl x IOL)
2: Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may cause latch-up. Thus, a series resistor of 50-100 should be used when applying a 'low' level to the MCLR pin rather than pulling this pin directly to VSS.
- 3: PORTD and PORTE are not implemented on PIC16F873A/876A devices.
† 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 to maximum rating conditions for extended periods may affect device reliability.
FIGURE 17-1: PIC16F87XA VOLTAGE-FREQUENCY GRAPH (INDUSTRIAL, EXTENDED)
FIGURE 17-2: PIC16LF87XA VOLTAGE-FREQUENCY GRAPH (INDUSTRIAL)
Related Variants
The following components are covered by the same datasheet.
| Part Number | Manufacturer | Package |
|---|---|---|
| PIC16F877 | Microchip Technology | — |
| PIC16F877A-I/P | Microchip Technology | 40-DIP (0.600", 15.24mm) |
Get structured datasheet data via API
Get started free