Microcontrollers integrate processing, memory, and peripheral functions into a single compact device. One of the most widely used microcontrollers in the PIC family is the PIC16F877A, developed by Microchip Technology. This article will discuss the PIC16F877A microcontroller overview, pinout, ordering model types, basic circuit design, specifications, features, alternatives, etc.

The PIC16F877A is an 8-bit microcontroller developed by Microchip Technology and belongs to the PIC16F87X family. It integrates a processor, memory, input/output pins, and multiple peripheral modules on a single chip, allowing it to control and manage electronic systems efficiently. The device uses a high-performance RISC architecture with a simple instruction set, enabling fast execution and easy programming.
The microcontroller provides 8K × 14 words of Flash program memory, 368 bytes of SRAM, and 256 bytes of EEPROM for reliable data storage. It operates at clock speeds of up to 20 MHz and offers 33 programmable I/O pins for flexible hardware connections. The PIC16F877A also includes built-in features such as a 10-bit ADC with 8 channels, timers, serial communication modules (USART), and SPI/I²C support, which enhance its processing and control capabilities.
If you are interested in purchasing the PIC16F877A, feel free to contact us for pricing and availability.


| Pin No. | Pin Name | Description |
| 1 | MCLR/VPP | Master Clear (Reset) and programming voltage input |
| 2 | RA0/AN0 | Analog input channel 0 / Port A bit 0 |
| 3 | RA1/AN1 | Analog input channel 1 / Port A bit 1 |
| 4 | RA2/AN2/VREF- / CVREF | Analog input 2 / A/D negative reference / comparator reference |
| 5 | RA3/AN3/VREF+ | Analog input 3 / A/D positive reference |
| 6 | RA4/T0CKI/C1OUT | Timer0 clock input / comparator output |
| 7 | RA5/AN4/SS/C2OUT | Analog input 4 / SPI slave select / comparator output |
| 8 | RE0/RD/AN5 | Analog input 5 / Parallel slave port read |
| 9 | RE1/WR/AN6 | Analog input 6 / Parallel slave port write |
| 10 | RE2/CS/AN7 | Analog input 7 / Parallel slave port chip select |
| 11 | VDD | Positive power supply |
| 12 | VSS | Ground |
| 13 | OSC1/CLKI | Oscillator input / external clock input |
| 14 | OSC2/CLKO | Oscillator output |
| 15 | RC0/T1OSO/T1CKI | Timer1 oscillator output / Timer1 clock input |
| 16 | RC1/T1OSI/CCP2 | Timer1 oscillator input / CCP2 module |
| 17 | RC2/CCP1 | Capture/Compare/PWM module 1 |
| 18 | RC3/SCK/SCL | SPI clock / I²C clock |
| 19 | RD0/PSP0 | Parallel Slave Port data bit 0 |
| 20 | RD1/PSP1 | Parallel Slave Port data bit 1 |
| 21 | RD2/PSP2 | Parallel Slave Port data bit 2 |
| 22 | RD3/PSP3 | Parallel Slave Port data bit 3 |
| 23 | RD4/PSP4 | Parallel Slave Port data bit 4 |
| 24 | RC4/SDI/SDA | SPI data input / I²C data |
| 25 | RC5/SDO | SPI data output |
| 26 | RC6/TX/CK | USART transmit / synchronous clock |
| 27 | RC7/RX/DT | USART receive / data |
| 28 | RD5/PSP5 | Parallel Slave Port data bit 5 |
| 29 | RD6/PSP6 | Parallel Slave Port data bit 6 |
| 30 | RD7/PSP7 | Parallel Slave Port data bit 7 |
| 31 | VSS | Ground |
| 32 | VDD | Positive power supply |
| 33 | RB0/INT | External interrupt input |
| 34 | RB1 | Digital I/O port |
| 35 | RB2 | Digital I/O port |
| 36 | RB3/PGM | Low-voltage programming input |
| 37 | RB4 | Digital I/O port |
| 38 | RB5 | Digital I/O port |
| 39 | RB6/PGC | Programming clock |
| 40 | RB7/PGD | Programming data |
| Ordering Model | Package Type | Pin Count | Operating Temperature | Program Memory | SRAM | EEPROM | I/O Pins |
| PIC16F877A-I/P | PDIP (Plastic Dual Inline Package) | 40 | −40°C to +85°C (Industrial) | 8K × 14 Words | 368 B | 256 B | 33 |
| PIC16F877A-I/PT | TQFP (Thin Quad Flat Package) | 44 | −40°C to +85°C (Industrial) | 8K × 14 Words | 368 B | 256 B | 33 |
| PIC16F877A-E/P | PDIP (Plastic Dual Inline Package) | 40 | −40°C to +125°C (Extended) | 8K × 14 Words | 368 B | 256 B | 33 |
| PIC16F877A-E/PT | TQFP (Thin Quad Flat Package) | 44 | −40°C to +125°C (Extended) | 8K × 14 Words | 368 B | 256 B | 33 |
• PIC16F887
• PIC16F886
• PIC16F876A
• PIC16F874A
• PIC16F1937
• PIC16F1789
• PIC18F4520
• PIC18F4620
• PIC16F18877

Basic operating circuit of the PIC16F877A microcontroller, including the main components required for the chip to run. The circuit contains a 5V power supply, reset circuit, oscillator circuit, and an LED output. The VDD pins are connected to +5V and the VSS pins are connected to ground, providing the power needed for the microcontroller to operate.
A 10 kΩ resistor is connected to the MCLR pin as a pull-up resistor. This keeps the microcontroller in normal operation. If the MCLR pin is pulled low, the device resets and restarts the program.
The 16 MHz crystal oscillator connected to the OSC1 and OSC2 pins, along with two 33 pF capacitors, generates the clock signal that controls the instruction speed of the PIC16F877A. An LED with a resistor is connected to one output pin to show how the microcontroller can control external components by turning the LED on or off.

| Parameter | Specification |
| CPU Architecture | 8-bit RISC architecture |
| Operating Frequency | DC – 20 MHz |
| Instruction Cycle Time | 200 ns (at 20 MHz) |
| Instruction Set | 35 instructions |
| Flash Program Memory | 8K × 14 words |
| Data RAM | 368 bytes |
| EEPROM Data Memory | 256 bytes |
| Interrupt Sources | 15 |
| I/O Pins | 33 |
| I/O Ports | PORTA, PORTB, PORTC, PORTD, PORTE |
| Timers | 3 (Timer0, Timer1, Timer2) |
| Capture/Compare/PWM Modules | 2 CCP modules |
| ADC Resolution | 10-bit |
| ADC Channels | 8 channels |
| Analog Comparators | 2 |
| Serial Communication | USART |
| SPI / I²C Support | MSSP module |
| Parallel Communication | PSP (Parallel Slave Port) |
| Operating Voltage | 2.0 V – 5.5 V |
| Watchdog Timer | Yes |
| Brown-out Reset | Yes |
| Power Saving Mode | Sleep mode |
| Programming Method | ICSP (In-Circuit Serial Programming) |
| Debugging | ICD support |
| Operating Temperature | −40°C to +85°C (Industrial) |
| Packages | 40-pin PDIP, 44-pin TQFP, 44-pin PLCC, 44-pin QFN |
The PIC16F877A uses a high-performance RISC CPU architecture designed for fast and efficient operation. It uses only 35 simple instructions, making it easier to program and understand. Most instructions execute in one clock cycle, while branch instructions take two cycles. The device supports an operating speed of up to 20 MHz, allowing quick processing in embedded systems.
The microcontroller provides several types of memory for program storage and data handling. It includes 8K × 14 words of Flash program memory, which can store the program code. It also has 368 bytes of SRAM for temporary data storage and 256 bytes of EEPROM for non-volatile data that remains stored even when power is removed.
The PIC16F877A includes built-in analog capabilities useful for sensor and measurement applications. It has a 10-bit Analog-to-Digital Converter (ADC) with up to 8 input channels, allowing the microcontroller to read analog signals from multiple sensors. The device also includes two analog comparators and a programmable voltage reference (VREF).
This microcontroller includes three timer modules used for time measurement and event counting. Timer0 is an 8-bit timer/counter with a prescaler. Timer1 is a 16-bit timer/counter that can also operate with an external crystal during sleep mode. Timer2 is another 8-bit timer with a period register, prescaler, and postscaler.
The PIC16F877A provides two CCP modules that support Capture, Compare, and PWM functions. The capture mode can measure time intervals with 16-bit resolution, while compare mode allows timed output events. The PWM mode provides 10-bit resolution, making it suitable for motor control, LED brightness control, and power regulation.
The device supports multiple communication protocols for connecting with other devices. It includes a USART module for serial communication and a MSSP module that supports both SPI and I²C protocols. These interfaces allow easy communication with sensors, displays, memory chips, and other microcontrollers.
The PIC16F877A provides 33 programmable I/O pins, which can be used to interface with external circuits. It also supports a Parallel Slave Port (PSP) in the 40/44-pin versions, allowing high-speed parallel communication with external processors or controllers.
Several special features improve reliability and flexibility. These include 100,000 erase/write cycles for Flash memory, 1,000,000 cycles for EEPROM, and data retention over 40 years. The device also supports In-Circuit Serial Programming (ICSP) and In-Circuit Debugging (ICD), allowing developers to program and debug the chip without removing it from the circuit.
The PIC16F877A is built using low-power CMOS technology, allowing efficient energy consumption. It operates within a wide voltage range of 2.0V to 5.5V and supports power-saving sleep mode. Additional features such as the Watchdog Timer (WDT) and Brown-Out Reset (BOR) help ensure stable and reliable system operation.
• Industrial automation systems
• Embedded control systems
• Robotics projects
• Motor control systems
• Home automation systems
• Sensor interfacing systems
• Data acquisition systems
• LCD display interfacing, etc.
| Feature | PIC16F877 | PIC16F877A |
| Microcontroller Family | PIC16F87X | PIC16F87XA (Improved version) |
| CPU Architecture | 8-bit RISC | 8-bit RISC |
| Operating Frequency | DC – 20 MHz | DC – 20 MHz |
| Program Memory | 8K × 14 words Flash | 8K × 14 words Flash |
| Data RAM | 368 bytes | 368 bytes |
| EEPROM Data Memory | 256 bytes | 256 bytes |
| I/O Pins | 33 | 33 |
| Timers | 3 (Timer0, Timer1, Timer2) | 3 (Timer0, Timer1, Timer2) |
| ADC Resolution | 10-bit | 10-bit |
| ADC Channels | 8 | 8 |
| CCP Modules | 2 | 2 |
| Communication Interfaces | USART, SPI, I²C | USART, SPI, I²C |
| Parallel Slave Port | Yes | Yes |
| Instruction Set | 35 instructions | 35 instructions |
| Operating Voltage | 2.0V – 5.5V | 2.0V – 5.5V |
| Flash Endurance | Lower endurance | Improved Flash endurance |
| Reliability | Standard | Improved reliability and stability |
| Status | Older version | Enhanced / updated version |

The PIC16F877A microcontroller is manufactured by Microchip Technology, a well-known semiconductor company specializing in embedded control solutions. Microchip uses advanced CMOS fabrication technology to produce reliable and energy-efficient microcontrollers with stable performance. Its manufacturing process integrates the CPU core, Flash memory, ADC, timers, communication interfaces, and I/O ports into a single chip while maintaining strict quality control and testing standards.