PIC16F877-04E/PQ - 8-bit MCU, 14KB Flash, 4MHz, 44-MQFP | Microchip
MPN: PIC16F877-04E/PQ ⚠ آخری بار خریداریPIC16F877-04E/PQ جائزہ
An 8-bit microcontroller (MCU) is a single-chip computer that integrates a CPU, program memory (Flash/ROM), data memory (RAM), non-volatile EEPROM, and a configurable set of peripherals (timers, ADC, USART, I/O ports, PWM, I2C/SPI). Within the semiconductor hierarchy, an MCU sits above a microprocessor (which requires external memory) and below a SoC (system-on-chip with application processor cores). The PIC16F877-04E/PQ belongs to Microchip's mid-range PIC16F877 family, which became an industry workhorse for embedded control because of its simple instruction set, deterministic timing, and rich peripheral set.
Key features of the PIC16F877-04E/PQ include 33 digital I/O pins, a 10-bit 8-channel Analog-to-Digital Converter (ADC), two 8-bit and one 16-bit timers, a USART with RS-485 support, an MSSP module (Master Synchronous Serial Port) supporting SPI and I2C (both Master and Slave), a Parallel Slave Port, a Capture/Compare/PWM module, and a watchdog timer with its own on-chip RC oscillator. The 04E speed grade denotes a 4 MHz maximum oscillator input, and the E suffix indicates the Extended (Automotive) temperature range of -40C to +125C.
The device uses a Harvard RISC architecture with separate program and data buses, providing predictable instruction execution. Its 14-bit instruction word enables most operations to complete in a single cycle, and the wide instruction encoding supports literal, register, and branch operations without dedicated move instructions.
Typical applications for the PIC16F877-04E/PQ include industrial control systems, automotive body and chassis electronics, sensor interface boards, low-power instrumentation, motor control, HVAC controls, and educational development platforms. Its 33 I/O pins comfortably support keypad scanning, LCD driving, and multi-drop communication buses.
When designing with this part, observe the brown-out reset, power-on reset, and watchdog configuration bits in the configuration word; misuse of these settings is a common cause of field returns. Also confirm that your application code fits within the 14KB Flash and 8-level hardware stack, since the PIC16F877 family lacks the extended stack and interrupt hardware of the newer PIC18 and PIC16F1xxx Enhanced mid-range families.
This page synthesizes distributor stock levels, parametric drop-in alternatives, and practical design notes that complement the manufacturer datasheet for the PIC16F877-04E/PQ.
کے لیے ڈراپ اِن متبادل PIC16F877-04E/PQ — یکساں پیکیج، پن سے پن مطابقت پذیر۔ مختلف پیکیج والے پرزے جن کے لیے PCB دوبارہ کام درکار ہو، شامل نہیں ہیں۔
اس سیریز میں مختلف ورژن
اسی سیریز کے ماڈلز جو ڈراپ اِن مطابقت رکھتے ہیں PIC16F877-04E/PQ (یکساں فارم فیکٹر اور فٹ پرنٹ) — میں مختلف Package, Timers, Core Architecture, ADC, Operating Temperature.
PIC16F877-04/PQ
✅ ڈراپ-اِنقیمت کے لیے رابطہ کریں
ڈیٹا شیٹ دیکھیں →PIC16F877-04I/PQ
✅ ڈراپ-اِنقیمت کے لیے رابطہ کریں
ڈیٹا شیٹ دیکھیں →PIC16F877-20E/PQ
✅ ڈراپ-اِن📋 حوالہ جاتی متبادل (کیٹلاگ میں نہیں)
PIC16F887-I/PQ
✅ ڈراپ-اِن📋 حوالہ جاتی متبادل (کیٹلاگ میں نہیں)
PIC16F877A-04E/PQ
✅ ڈراپ-اِن📋 حوالہ جاتی متبادل (کیٹلاگ میں نہیں)
PIC16F887-E/PQ
✅ ڈراپ-اِن📋 حوالہ جاتی متبادل (کیٹلاگ میں نہیں)
PIC16F877-04E/PQ زیادہ سے زیادہ ریٹنگز اور برقی خصوصیات
| Core Architecture | PIC (8-bit RISC, Harvard) |
| Family | PIC16F877 Series |
| Program Memory (Flash) | 14 KB (8K x 14 words) |
| Data SRAM | 368 bytes |
| Data EEPROM | 256 bytes |
| Maximum CPU Frequency | 4 MHz (200 ns instruction cycle) |
| Operating Voltage (Vdd) | 2.0 V to 5.5 V |
| I/O Pins | 33 digital I/O |
| ADC | 10-bit, 8 channels |
| Timers | 2 x 8-bit, 1 x 16-bit |
| Communication | USART (RS-485), MSSP (SPI / I2C Master & Slave), PSP |
| Capture/Compare/PWM (CCP) | 1 module (16-bit) |
| Watchdog Timer | Yes, with dedicated on-chip RC oscillator |
| Instruction Set Size | 35 single-word instructions |
| Interrupt Sources | 13 |
| پیکیج | 44-pin MQFP (10 x 10 mm), PQ suffix |
| آپریٹنگ درجہ حرارت رینج | -40 C to +125 C (E = Extended / Automotive) |
| Speed Grade Suffix | 04 = 4 MHz maximum oscillator |
| RoHS اسٹیٹس | Compliant (Pb-free MQFP) |
| ماؤنٹنگ ٹائپ | Surface Mount |
PIC16F877-04E/PQ پن کنفیگریشن
| پن 1 | MCLR/Vpp/RE3 — Master Clear (Reset) input / Programming voltage / PORTE bit 3 |
| پن 2 | RA0/AN0 — PORTA bit 0 / Analog channel 0 |
| پن 3 | RA1/AN1 — PORTA bit 1 / Analog channel 1 |
| پن 4 | RA2/AN2/Vref- — PORTA bit 2 / Analog channel 2 / ADC Vref negative |
| پن 5 | RA3/AN3/Vref+ — PORTA bit 3 / Analog channel 3 / ADC Vref positive |
| پن 6 | RA4/T0CKI — PORTA bit 4 / Timer0 clock input (open drain) |
| پن 7 | RA5/AN4/SS — PORTA bit 5 / Analog channel 4 / SPI Slave Select |
| پن 8 | RE0/RD/AN5 — PORTE bit 0 / Parallel Slave Port read / Analog channel 5 |
| پن 9 | RE1/WR/AN6 — PORTE bit 1 / Parallel Slave Port write / Analog channel 6 |
| پن 10 | RE2/CS/AN7 — PORTE bit 2 / Parallel Slave Port chip select / Analog channel 7 |
| پن 11 | Vdd — Positive supply (2.0 V to 5.5 V) |
| پن 12 | Vss — Ground |
| پن 13 | OSC1/CLKI — Crystal oscillator input / External clock input |
| پن 14 | OSC2/CLKO — Crystal oscillator output / Clock output |
| پن 15 | RC0/T1OSO/T1CKI — PORTC bit 0 / Timer1 oscillator output / Timer1 clock input |
| پن 16 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator input / CCP2 I/O |
| پن 17 | RC2/CCP1 — PORTC bit 2 / CCP1 PWM output |
| پن 18 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| پن 19 | RD0/PSP0 — PORTD bit 0 / Parallel Slave Port data bit 0 |
| پن 20 | RD1/PSP1 — PORTD bit 1 / Parallel Slave Port data bit 1 |
| پن 21 | RD2/PSP2 — PORTD bit 2 / Parallel Slave Port data bit 2 |
| پن 22 | RD3/PSP3 — PORTD bit 3 / Parallel Slave Port data bit 3 |
| پن 23 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| پن 24 | RC5/SDO — PORTC bit 5 / SPI data out |
| پن 25 | RC6/TX/CK — PORTC bit 6 / USART asynchronous transmit / synchronous clock |
| پن 26 | RC7/RX/DT — PORTC bit 7 / USART asynchronous receive / synchronous data |
| پن 27 | RD4/PSP4 — PORTD bit 4 / Parallel Slave Port data bit 4 |
| پن 28 | RD5/PSP5 — PORTD bit 5 / Parallel Slave Port data bit 5 |
| پن 29 | RD6/PSP6 — PORTD bit 6 / Parallel Slave Port data bit 6 |
| پن 30 | RD7/PSP7 — PORTD bit 7 / Parallel Slave Port data bit 7 |
| پن 31 | Vss — Ground |
| پن 32 | Vdd — Positive supply (2.0 V to 5.5 V) |
| پن 33 | RB0/INT — PORTB bit 0 / External interrupt |
| پن 34 | RB1 — PORTB bit 1 |
| پن 35 | RB2 — PORTB bit 2 |
| پن 36 | RB3/PGM — PORTB bit 3 / Low-voltage programming |
| پن 37 | RB4 — PORTB bit 4 |
| پن 38 | RB5 — PORTB bit 5 |
| پن 39 | RB6/PGC — PORTB bit 6 / ICSP clock |
| پن 40 | RB7/PGD — PORTB bit 7 / ICSP data |
| پن 41 | AVdd — Analog positive supply (separate from Vdd for noise isolation) |
| پن 42 | AVss — Analog ground (separate from Vss for noise isolation) |
| پن 43 | NC — Not connected |
| پن 44 | NC — Not connected |
عام استعمالات
PIC16F877-04E/PQ کے لیے موزوں ہے 6 ایپلیکیشنs: Industrial Sensor Hub, Automotive Body Control Module, HVAC Fan & Blower Controller, Educational / Hobby Development Board, Low-Power Instrumentation & Data Logger, Motor Control & PWM Drive.
Industrial Sensor Hub
The PIC16F877-04E/PQ is well suited as a multi-channel industrial sensor hub: its 10-bit 8-channel ADC reads thermistors, pressure transducers, and 4-20 mA loop sensors while the MSSP and USART drive simultaneous SPI and RS-485 buses. The 4 MHz CPU clock and 200 ns instruction cycle provide deterministic sample-to-output latency without DSP overhead. The -40 C to +125 C extended temperature grade supports factory-floor and outdoor enclosures without additional thermal conditioning. Place bypass capacitors on Vdd/Vss within 5 mm of the pins and route the analog AVdd/AVss pair separately to minimize digital switching noise coupling into ADC measurements, which preserves the 10-bit ENOB across the 0-5 V sensor span.
تجویز کردہ
Automotive Body Control Module
The PIC16F877-04E/PQ is a classic automotive body-electronics workhorse: 33 digital I/O drive door lock relays, courtesy lamps, mirror controls, and wiper stages, while the USART links to a body control CAN bridge. Its -40 C to +125 C extended grade meets under-hood and cabin thermal requirements. The 256-byte EEPROM retains learn-mode settings (window anti-pinch calibration, seat memory position) across battery disconnects. Use the 16-bit CCP module to generate accurate PWM dimming for instrument cluster backlights and verify brown-out reset settings (BOREN<1:0>) to survive crank-voltage sags down to 4 V without spurious resets.
تجویز کردہ
HVAC Fan & Blower Controller
In HVAC blower controllers the PIC16F877-04E/PQ reads NTC intake-air temperature on its ADC, drives a triac-fired AC motor via the 16-bit CCP PWM module, and modulates a closed-loop air-flow profile. The 35-instruction PIC16 RISC ISA makes the proportional + integral control loop easy to verify by hand. The extended -40 C to +125 C temperature range handles attic and rooftop installations. The on-chip watchdog timer with dedicated RC oscillator is invaluable for unattended service: a stalled main oscillator automatically triggers a system reset instead of a frozen blower, and zero-crossing detection on a CCP pin reduces triac EMI.
تجویز کردہ
Educational / Hobby Development Board
The PIC16F877-04E/PQ powers countless university courses, hobbyist trainers, and development boards thanks to its 35-instruction RISC ISA that beginners can fully grasp in one semester. The Parallel Slave Port provides a clean interface to an external bus analyzer or 8-bit host for teaching memory-mapped I/O. The PIC's Harvard architecture separates program and data memory, which pedagogically illustrates how single-cycle instructions work. Use the USART for PC serial console output at 9600 baud, the MSSP for SPI EEPROM labs, and the 10-bit ADC for analog sensor tutorials — all without external peripherals beyond an ICSP header.
تجویز کردہ
Low-Power Instrumentation & Data Logger
Battery-powered data loggers exploit the PIC16F877-04E/PQ's Sleep mode drawing under 1 uA with the watchdog timer active. The 256-byte EEPROM stores calibration constants and rolling log headers, while the 368-byte SRAM buffers samples between writes. The 10-bit ADC digitizes thermocouple, pressure, or process-current inputs, and the MSSP writes batches to an external SPI Flash. The 4 MHz speed grade keeps active current low. Implement a sample-on-interrupt wake pattern with TIMER1 gated by a 32.768 kHz crystal for sub-second scheduling accuracy across weeks of unattended logging on a single 3.6 V lithium primary cell.
تجویز کردہ
Motor Control & PWM Drive
For brushed DC or stepper motor control the PIC16F877-04E/PQ pairs its 16-bit CCP module with the 8-bit timer/counters to generate phase-correct PWM up to 20 kHz. Quadrature encoders feed TMR0 for direction and TMR1 for speed, while a hardware SPI link synchronizes with a companion motor-driver IC. The 33 I/O pins easily accommodate limit-switch inputs, brake-driver outputs, and a serial command interface. The Extended temperature grade suits industrial cabinet environments, and the watchdog timer recovers the controller from ESD-induced lockups on factory floors. Optimize dead-time insertion in firmware to prevent shoot-through in the H-bridge.
تجویز کردہ
تجویز کردہ پروڈکٹس کا خلاصہ
کے لیے انجینئرنگ ریفرنس ڈیٹا PIC16F877-04E/PQ — موازنہ، ڈیزائن رہنمائی، اور تعمیل کی معلومات۔
انتخاب کی گائیڈ
متبادلات کے ساتھ موازنہ
| پیرامیٹر | یہ پروڈکٹ | PIC16F877-04/PQ | PIC16F877-04I/PQ | PIC16F877-20E/PQ | PIC16F887-I/PQ | PIC16F877A-04E/PQ | PIC16F887-E/PQ |
|---|---|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm | 44-MQFP (PQ) 10x10 mm |
| Maximum CPU Frequency | 4 MHz | 4 MHz | 4 MHz | 20 MHz | 20 MHz | 4 MHz | 20 MHz |
| Flash Memory | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB |
| SRAM | 368 B | 368 B | 368 B | 368 B | 368 B | 368 B | 368 B |
| Operating Temperature | -40 C to +125 C (Extended) | 0 C to +70 C (Commercial) | -40 C to +85 C (Industrial) | -40 C to +125 C (Extended) | -40 C to +85 C (Industrial) | -40 C to +125 C (Extended) | -40 C to +125 C (Extended) |
| ADC Channels / Resolution | 8 / 10-bit | 8 / 10-bit | 8 / 10-bit | 8 / 10-bit | 14 / 10-bit | 8 / 10-bit | 14 / 10-bit |
| I/O Pins | 33 | 33 | 33 | 33 | 36 | 33 | 36 |
| Lifecycle Status | Last Time Buy (Legacy) | Last Time Buy | Last Time Buy | Last Time Buy | Active (Recommended replacement) | Last Time Buy | Active |
اہم امتیازی خصوصیات
- Extended -40 C to +125 C automotive temperature grade in the same MQFP-44 package (بمقابلہPIC16F877-04/PQ)
- Modern drop-in successor with 5x more CPU throughput (بمقابلہPIC16F887-I/PQ)
- A-silicon revision with improved brown-out and LVP (بمقابلہPIC16F877-04E/PQ vs PIC16F877A-04E/PQ)
ڈیزائن نوٹس
Estimated: at 5 V Vdd, 4 MHz clock and full I/O load the PIC16F877-04E/PQ draws approximately 5-10 mA active. Connect a 0.1 uF ceramic bypass capacitor within 5 mm of Vdd (pin 11) and another on Vdd (pin 32), plus a 10 uF bulk capacitor near the supply pin pair. For ADC accuracy, decouple AVdd (pin 41) separately through a ferrite bead and a 0.1 uF + 10 uF combination; AVss (pin 42) should return directly to the ground plane via a short, low-inductance trace to avoid reference noise coupling.
Route the quartz crystal traces between OSC1 (pin 13) and OSC2 (pin 14) as short, symmetric traces with a grounded guard ring to minimize EMI pickup. Place the two load capacitors (typically 15-33 pF) immediately adjacent to the MCU pins. If a resonator or external clock is used instead, drive OSC1 only and leave OSC2 floating. The MCLR/RE3 pin (pin 1) requires a 10 kohm pull-up to Vdd; do not connect MCLR directly to Vdd without a resistor, otherwise in-circuit serial programming (ICSP) cannot drive the line low to enter programming mode.
Three common pitfalls with the PIC16F877-04E/PQ: (1) configuration-word mistakes — set FOSC, WDTE, PWRTE, BOREN and LVP bits to match the design; a misconfigured watchdog will reset the part every few ms, and an unintended LVP pin disables RB5 as I/O. (2) ADC input impedance — the ADC requires a source impedance below 2.5 kohm for full 10-bit accuracy; add an op-amp buffer for higher-impedance sensors. (3) Stack depth — the PIC16F877 hardware stack is only 8 levels deep; deep interrupt nesting or recursive function calls overflow it silently. Use inline functions or restructure to keep call depth shallow.
The PIC16F877-04E/PQ's Parallel Slave Port (port D plus RE0/RE1/RE2) is intended for short-distance communication to a host microprocessor or FIFO. Keep PSP traces under 50 mm, source-terminate with 100 ohm resistors if the bus is longer, and place a 10 kohm pull-up on RE2/CS to prevent spurious deselect during MCU reset. For USART RS-485 communications at 115200 baud or above, add a 120 ohm termination at the bus ends and route the differential pair with controlled impedance; the USART does not include internal slew-rate limiting.
تعمیل کی معلومات
Pb-free MQFP per Microchip product page. AEC-Q100 not formally stated for PIC16F877-04E; automotive qualification pursued at system level. REACH and RoHS per EU directives as of 2026-09-21.