PIC16F877
8-bit Flash MicrocontrollerThe PIC16F877 is a 8-bit flash microcontroller from Microchip Technology. View the full PIC16F877 datasheet below including key specifications, electrical characteristics, absolute maximum ratings.
Official PIC16F877 datasheet (PDF) — the source this page was extracted from.
Manufacturer
Microchip TechnologyCategory
Microcontrollers (MCU)PIC16F877 Key Specifications
| Parameter | Value |
|---|---|
| ADC | 10-bit, 8 channels |
| Timers | Two 8-bit (Timer0, Timer2), one 16-bit (Timer1) |
| I/O Pins | 33 |
| Data SRAM | 368 bytes |
| Comparators | 2 |
| Data EEPROM | 256 bytes |
| Program Memory | 8K x 14 words Flash (14.3 KB) |
| Supply Voltage | 2.0V to 5.5V (PIC16F87XA: 4.0V to 5.5V; PIC16LF87XA: 2.0V to 5.5V) |
| CCP/PWM Modules | 2 (PWM max 10-bit resolution) |
| Flash Endurance | 100,000 erase/write cycles typical |
| Instruction Set | 35 single-word instructions |
| EEPROM Endurance | 1,000,000 erase/write cycles typical |
| EEPROM Retention | >40 years |
| Instruction Cycle | 200 ns (DC - 20 MHz) |
| Operating Frequency | DC to 20 MHz clock input |
| Operating Temperature | -40°C to +85°C (Industrial) |
| Communication Interfaces | USART, MSSP (SPI Master, I2C Master/Slave), Parallel Slave Port |
PIC16F877 Overview
Part: PIC16F877A (PIC16F873A/874A/876A/877A family) — Microchip Technology
Type: 8-bit Enhanced Flash Microcontroller (PIC16 mid-range RISC)
Description: 8-bit Flash MCU with up to 20 MHz clock, 8K x 14-word Flash program memory, 368 bytes RAM, 256 bytes EEPROM, 10-bit 8-channel ADC and a 2.0–5.5 V supply range.
Operating Conditions:
- Supply voltage: 2.0–5.5 V
- Operating temperature: -40 to +85 °C (industrial; extended grade -40 to +125 °C is ordering-grade dependent)
- Clock: DC–20 MHz (200 ns instruction cycle)
Absolute Maximum Ratings:
- Max supply voltage (VDD with respect to VSS): -0.3 to +7.5 V
- Max current into VDD pin: 250 mA
- Max current out of VSS pin: 300 mA
- Max current per I/O pin: 25 mA sunk or sourced
- Storage temperature: -65 to +150 °C
- Ambient temperature under bias: -55 to +125 °C
- Total power dissipation: 1.0 W
Key Specs:
- Program memory: 8K x 14-word Flash (PIC16F877A/876A), 4K words (PIC16F873A/874A)
- Data RAM: 368 bytes (876A/877A), 192 bytes (873A/874A)
- Data EEPROM: 256 bytes (876A/877A), 128 bytes (873A/874A)
- I/O pins: 33 on the 40/44-pin devices (874A/877A), 22 on the 28-pin devices (873A/876A)
- ADC: 10-bit, 8 channels on 40/44-pin devices, 5 channels on 28-pin devices
- Timers: two 8-bit and one 16-bit; 2 CCP modules (16-bit capture and compare, 10-bit PWM)
- Flash endurance: 100,000 erase/write cycles typical; EEPROM endurance 1,000,000 cycles typical, retention over 40 years
- Voltage on MCLR: 0 to +14 V; voltage on RA4: 0 to +8.5 V (absolute maximum)
Features:
- 35 single-word instructions; all single-cycle except branches
- MSSP with SPI (master) and I²C (master/slave)
- USART/SCI with 9-bit address detection
- Parallel Slave Port (40/44-pin devices only)
- Two analog comparators with programmable on-chip voltage reference
- Brown-out Reset, Power-on Reset, Watchdog Timer with its own RC oscillator
- Self-reprogrammable Flash, ICSP via two pins, In-Circuit Debug, programmable code protection
- Sleep power-saving mode
Applications:
- General-purpose embedded control
Package:
- 40-pin PDIP (PIC16F874A/877A)
- 44-pin PLCC
- 44-pin TQFP
- 44-pin QFN
- 28-pin PDIP, SOIC, SSOP and QFN (PIC16F873A/876A)
PIC16F877 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)
PIC16F877 Pin Configuration
In Capture mode, the RC2/CCP1 pin should be configured as an input by setting the TRISC<2> bit.
Note: If the RC2/CCP1 pin is configured as an output, a write to the port can cause a Capture condition.
PIC16F877 Electrical Characteristics
PIC16LF873A/874A/876A/877A (Industrial)
| PIC16LF873A/874A/876A/877A (Industrial) - PIC16F873A/874A/876A/877A (Industrial, Extended) - Param No. | PIC16LF873A/874A/876A/877A (Industrial) - PIC16F873A/874A/876A/877A (Industrial, Extended) - Symbol | PIC16LF873A/874A/876A/877A (Industrial) - PIC16F873A/874A/876A/877A (Industrial, Extended) - Characteristic/ Device | 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 -40°C T A +125°C for extended - Min | 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 -40°C T A +125°C for extended - Typ† | 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 -40°C T A +125°C for extended - Max | 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 -40°C T A +125°C for extended - Units | 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 -40°C T A +125°C for extended - 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.
PIC16F877 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)
Variants on the same datasheet
These parts have exact links to the same datasheet. They are candidates to compare, not verified drop-in replacements; check package, pinout and electrical limits.
| Part Number | Manufacturer | Package |
|---|---|---|
| PIC16F877A | Microchip Technology | — |
| PIC16F877A-I/P | Microchip Technology | 40-DIP (0.600", 15.24mm) |
Other Microcontrollers (MCU)
- STM32F407VET6 – STMicroelectronics, ARM Cortex-M4 MCU
- STM32H563ZIT6 – STMicroelectronics, Arm Cortex-M33 32-bit MCU
- RP2040 – Raspberry Pi, Microcontroller
- STM32H743VIT6 – STMicroelectronics, Microcontroller Unit (MCU)
- NRF52840-QIAA-R7 – Nordic Semiconductor, Wireless Microcontroller
- STM32U575RIT6 – STMicroelectronics, Ultra-low-power Arm Cortex-M33 32-bit MCU
- STM32L011F4U6 – STMicroelectronics, Ultra-low-power Arm Cortex-M0+ MCU
- GD32F103C8T6 – GigaDevice, Arm Cortex-M3 32-bit MCU
All Microcontrollers (MCU) datasheetsAll Microchip Technology datasheets (600)
Ask your AI agent about the PIC16F877
Connect SheetsData to Claude, Cursor, Codex or any MCP client and your agent reads this datasheet for you: pinout, limits, register maps and design checks, with the numbers taken from the PDF.
claude mcp add --transport http sheetsdata https://mcp.sheetsdata.com/mcp
Then ask: "Can the PIC16F877 run from my 12 V rail? Check it against the datasheet limits."
Create a free account $2 of usage every month, no card needed.