Phone

    00852-6915 1330

PIC16F877a Microcontroller: Pinout, Datasheet, Features [FAQ]

  • Contents

PIC16F877a is a PIC Microcontroller.

PIC16F877a can be write-erase as many times as possible because it uses FLASH memory technology. It has a total number of 40 pins and there are 33 pins for input and output. PIC16F877A is used in many pic microcontroller projects.

This post will introduce you to the basic information about PIC16F877a PIC Microcontroller. You will learn some common descriptions, including:

A Basic Introduction to PIC16F877A

Catalog

PIC16F877a Pinout

PIC16F877a Applications

PIC16F877a Features

PIC16F877a Advantage

PIC16F877a Circuit

PIC16F877a Parameters

PIC16F877a Manufacturer

PIC16F877a Documents

How to Program PIC16F877a

Component Datasheet

FAQ

PIC16F877a Pinout

pic16f877a microcontroller pinout

Pin Number

Pin Name

Description

1

MCLR/Vpp

MCLR is used during programming, mostly connected to programmer like PicKit

2

RA0/AN0

Analog pin 0 or 0th pin of PORTA

3

RA1/AN1

Analog pin 1 or 1st pin of PORTA

4

RA2/AN2/Vref-

Analog pin 2 or 2nd pin of PORTA

5

RA3/AN3/Vref+

Analog pin 3 or 3rd pin of PORTA

6

RA4/T0CKI/C1out

4th pin of PORTA

7

RA5/AN4/SS/C2out

Analog pin 4 or 5th pin of PORTA

8

RE0/RD/AN5

Analog pin 5 or 0th pin of PORTE

9

RE1/WR/AN6

Analog pin 6 or 1st pin of PORTE

10

RE2/CS/AN7

7th pin of PORTE

11

Vdd

Ground pin of MCU

12

Vss

Positive pin of MCU (+5V)

13

OSC1/CLKI

External Oscillator/clock input pin

14

OSC2/CLKO

External Oscillator/clock output pin

15

RC0/T1OSO/T1CKI

0th pin of PORT C

16

RC1/T1OSI/CCP2

1st pin of POCTC or Timer/PWM pin

17

RC2/CCP1

2nd pin of POCTC or Timer/PWM pin

18

RC3/SCK/SCL

3rd pin of POCTC

19

RD0/PSP0

0th pin of POCTD

20

RD1/PSPI

1st pin of POCTD

21

RD2/PSP2

2nd pin of POCTD

22

RD3/PSP3

3rd pin of POCTD

23

RC4/SDI/SDA

4th pin of POCTC or Serial Data in pin

24

RC5/SDO

5th pin of POCTC or Serial Data Out pin

25

RC6/Tx/CK

6th pin of POCTC or Transmitter pin of Microcontroller

26

RC7/Rx/DT

7th pin of POCTC or Receiver pin of Microcontroller

27

RD4/PSP4

4th pin of POCTD

28

RD5/PSP5

5th pin of POCTD

29

RD6/PSP6

6th pin of POCTD

30

RD7/PSP7

7th pin of POCTD

31

Vss

Positive pin of MCU (+5V)

32

Vdd

Ground pin of MCU

33

RB0/INT

0th pin of POCTB or External Interrupt pin

34

RB1

1st pin of POCTB

35

RB2

2nd pin of POCTB

36

RB3/PGM

3rd pin of POCTB or connected to programmer

37

RB4

4th pin of POCTB

38

RB5

5th pin of POCTB

39

RB6/PGC

6th pin of POCTB or connected to programmer

40

RB7/PGD

7th pin of POCTB or connected to programmer


PIC16F877a Applications

PIC16F877A is used in many pic microcontroller projects. PIC16F877A also have much application in digital electronics circuits. PIC16f877a finds its applications in a huge number of devices. It is used in remote sensors, security and safety devices, home automation and many industrial instruments.


PIC16F877a Features

  • 8K of Code space
  • 256 Bytes of EEPROM
  • 384 bytes SRAM
  • 8-level deep hardware stack
  • Up to 20 MHz clock
  • 1 16-bit, 2 8-bit timers
  • Syncronous Serial Port – SPI and I2C
  • USART
  • 8 channel, 10-bit ADC
  • Brown-Out Reset
  • 2 Analog Comparators
  • Capture, Compare, PWM module

PIC16F877a Advantage

pic16f877a microcontrollerPIC16F877a Microcontroller

PIC16F877a finds its applications in a huge number of devices. It is used in remote sensors, security and safety devices, home automation and many industrial instruments. An EEPROM is also featured in it which makes it possible to store some of the information permanently like transmitter codes and receiver frequencies and some other related data. The cost of this controller is low and its handling is also easy. It is flexible and can be used in areas where microcontrollers have never been used before as in microprocessor applications and timer functions etc.


PIC16F877a Circuit

pic16f877a microcontroller circuit

  • Design this circuit in proteus. Connect the pins with the source, ground and oscillator as explained in the pin description section.
  • Connect 8MHz oscillator with OSCI and OSC2 through two 22 pico farad capacitors.
  • Provide 5 volt to Reset pin through 10k ohm resistor. Resistor is not shown in simulation, but you should connect resistor while making circuit practically.
  • An LED is connected on pin 33 RB0, a resistor is used to limit the current and to prevent the LED from burning up. Write and compile the program in mikro C pro.
  • Burn the microcontroller with the hex file by double clicking on the controller in proteus and run the circuit successfully. best way to learn any microcontroller is to check its data sheet.
  • Pic kit3 is a famous programmer used to upload code to microchip chips, How to program using Pic kit3 is a good source to read.

PIC16F877a Parameters

Program Memory Type

Flash

Program Memory Size (KB)

14

CPU Speed (MIPS/DMIPS)

5

SRAM (B)

368

Data EEPROM/HEF (bytes)

256

Digital Communication Peripherals

1-UART, 1-SPI, 1-I2C1-MSSP(SPI/I2C)

Capture/Compare/PWM Peripherals

2 Input Capture, 2 CCP

Timers

2 x 8-bit, 1 x 16-bit

ADC Input

8 ch, 10-bit

Number of Comparators

2

Temperature Range (°C)

-40 to 125

Operating Voltage Range (V)

2 to 5.5

Pin Count

40


PIC16F877a Manufacturer

Microchip Technology Inc. is a leading provider of microcontroller and analog semiconductors, providing low-risk product development, lower total system cost and faster time to market for thousands of diverse customer applications worldwide. Headquartered in Chandler, Arizona, Microchip offers outstanding technical support along with dependable delivery and quality.


PIC16F877a Documents

PIC Microcontroller Compiled Tips 'n Tricks Guide

PIC16F87X to PIC16F87XA Migration

PIC16F87XA-PIC16F88X Migration


How to Program PIC16F877a

  • As we have studied 5 input and output ports namely PORTA, PORTB, PORTC, PORTD and PORTE which can be digital as well as analog.
  • We will configure them according to our requirements. But in case of analog mode, the pins or the ports can only act as inputs. There is a built in A to D converter which is used in such cases. Multiplexer circuits are also used.
  • But in digital mode, there is no restriction. We can configure the ports as output or as input. This is done through programming. For PIC the preferable compiler is mikro C pro which can be downloaded from their website.
  • There is a register named as ‘TRIS’ which controls the direction of ports. For different ports there are different registers such as TRISA, TRISB etc.
  • If we set a bit of the TRIS register to 0, the corresponding port bit will act as the digital output.
  • If we set a bit of the TRIS register to 1, the corresponding port bit will act as the digital input.
  • For example to set the whole portb to output we can write the program statement as:

  TRISB=0;

  • Now the port will act as the output port and we can send any value on the output such as

  PORTB=0XFF;

  • FF represents all 1’s in binary i.e. FF=11111111, now all the pins of port b are high. If we connect LEDs at all the pins then they will all start glowing in this condition.
  • If we want to negate the values of the port b we can use the statement:

  PORTB=~PORTB;

  • Now all the pins of the port b will be low.

Component Datasheet

PIC16F877A Datasheet


FAQ

  • What is PIC16F877a?

PIC16F877a is a PIC Microcontroller and is normally used in Embedded Projects like Home Automation System, Bank Security System etc.

  • How Many Bit Microcontroller is PIC16F877a?

8

This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture into an 40- or 44-pin package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices.

  • What is the Use of PIC16F877a?

PIC16F877a is used in many pic microcontroller projects. PIC16F877a also have much application in digital electronics circuits. PIC16f877a finds its applications in a huge number of devices. It is used in remote sensors, security and safety devices, home automation and many industrial instruments.

  • How Many Timers Are in PIC16F877a?

Three timers

The PIC16F877A basically has three timer modules. These timer module terminals are also multiplexed with other functions for handling alternate functions. These three-timer modules as named as TIMER 0, TIMER 1 and TIMER 2. These modules help to perform various timer, Counter or PWM Generation.

  • How Do You Use Timer0 on PIC16F877a?

Code

  1. Calculate the Timer Count for the required delay.

  2. Set the Presaclar bits in OPTION_REG as per the delay calculations.

  3. Clear the PSAbit for using the prescalar.

  4. Select the Clock Source Internal/External using TOCS bit.

  5. Load the timer value into TMRO register.

  6. Enable the Timer0 Interrupt by setting TMR0IE bit.

  • How Do you Interrupt in PIC16F877a?
    • Multiple External Interrupts in PIC16F877A
    • Before Initializing the Interrupt first store the PORTB value into one variable.
    • Enable PORTB Change Interrupt.
    • Connect external Interrupts pins to RB4, RB5, RB6 and RB7 (PORTB. ...
    • Whenever ISR hits, you need to read PORTB value and compare with old PORTB value using XOR method.
  • How many pins does PIC16F877a have?

It has a total number of 40 pins and there are 33 pins for input and output. PIC16F877A is used in many pic microcontroller projects. PIC16F877A also have many application in digital electronics circuits. PIC16f877a finds its applications in a huge number of devices.

Kynix

Kynix was founded in 2008, specializing in the electronic components distribution business. We adhere to honesty and ethics as our business philosophy and have gradually established an excellent reputation and credibility in our international business. With the accurate quotation, excellent credit, reasonable price, reliable quality, fast delivery, and authentic service, we have won the praise of the majority of customers.

Join our mailing list!

Be the first to know about new products, special offers, and more.

Leave a Reply

We'd love to hear from you! Feel free to share your thoughts and comments below. Rest assured, your email address will remain private.

Name *
Email *
Captcha *
Rating:

Kynix

  • How to purchase

  • Order
  • Search & Inquiry
  • Shipping & Tracking
  • Payment Methods
  • Contact Us

  • Tel: 00852-6915 1330
  • Email: info@kynix.com
  • Follow Us

authentication

Kynix

© 2008-2026 kynix.com all rights reserved.