The PIC16F877A is a popular 8-bit PIC microcontroller by Microchip with 14KB flash, 368B RAM, 256B EEPROM, 33 I/O pins, 8 ADC channels, UART, SPI, and I2C. Widely used in academic and industrial embedded systems.
| Pin | Name | Function | Type |
|---|---|---|---|
| 1 | MCLR/VPP | Master clear reset / programming | I/O |
| 2 | RA0/AN0 | Port A0, ADC channel 0 | ADC |
| 3 | RA1/AN1 | Port A1, ADC channel 1 | ADC |
| 4 | RA2/AN2/VREF- | Port A2, ADC ch 2, Vref- | ADC |
| 5 | RA3/AN3/VREF+ | Port A3, ADC ch 3, Vref+ | ADC |
| 6 | RA4/T0CKI | Port A4, Timer0 clock | I/O |
| 7 | RA5/AN4/SS | Port A5, ADC ch 4, SPI SS | ADC |
| 8 | RE0/AN5/RD | Port E0, ADC ch 5, data | ADC |
| 9 | RE1/AN6/WR | Port E1, ADC ch 6, write | ADC |
| 10 | RE2/AN7/CS | Port E2, ADC ch 7, chip sel | ADC |
| 11 | VDD | Positive supply | PWR |
| 12 | VSS | Ground | GND |
| 13 | OSC1/CLKIN | Crystal / clock input | I/O |
| 14 | OSC2/CLKOUT | Crystal / clock output | I/O |
| 15 | RC0/T1OSO | Port C0, Timer1 osc out | I/O |
| 16 | RC1/T1OSI | Port C1, Timer1 osc in | I/O |
| 17 | RC2/CCP1 | Port C2, CCP1 capture/PWM | I/O |
| 18 | RC3/SCK/SCL | SPI clock / I2C clock | BUS |
| 23 | RC4/SDI/SDA | SPI data in / I2C SDA | BUS |
| 24 | RC5/SDO | SPI data out | BUS |
| 25 | RC6/TX/CK | UART TX, sync clock | BUS |
| 26 | RC7/RX/DT | UART RX, sync data | BUS |
| 33 | RD0/PSP0 | Port D0 | I/O |
| 34 | RD1/PSP1 | Port D1 | I/O |
| 39 | RB0/INT | Port B0, external interrupt | I/O |
| 40 | VDD | Positive supply | PWR |