Hello, friends, I hope you all are enjoying your life. In today’s tutorial, we will have a detailed look at Introduction to PIC16f877A. Due to its low price and easy access, it is mostly used PIC microcontroller. You can buy this module from any electronic hope in the range of three to four dollars.
Most engineering students were asking about this important microcontroller so I am going to share a detailed post about this controller. In today’s post, we will have a detailed look at its working, pinout, operation, applications, and features. So let’s get started with Introduction to PIC16f877A.
Introduction to PIC16f877A
- The PIC16F877A belongs to the PICmicro group of the controller and is now very commonly used in different engineering starting from basic to a professional level.
- The usage of flash memory allows us to write and remove any program according to our requirements and times.
- As this module has a large space in the memory unit generally eight-kilo words and three sixty bytes of RAM which allows it to store and perform more than one function at a time.
- There are forty pinout exits in this module so it can be used in numerous electronic projects.
- There are 5 ports assembled on this module first is A, the second is B, the third is C, the fourth is D, and fifth is E.
- There are 3 timers created on this module one is sixteen-bit and the other 2 is eight-bit.
- It is compatible with serial, parallel, and I2C communication protocols.
Features of PIC16F877A
- These are some important features of PIC16F877A which are denoted here.
- It comprises of the eight-bit central process unit.
- There are fort inputs of different category exits on this module.
- Its functioning voltage is in the range of two to 5,5 volts.
- There is thirty-three inputs and output pinouts exit on this mode.
- It has an analog-to-digital converter which comprises of eight-channel of ten bits,
- Two comparators exist in this model.
- Like other controllers, it does not have any digital-to-analog converter.
- The commonly used communication protocol in this module is UART, SPI, I2C MSSP.
- It has an exterior oscillator of twenty megahertz frequency.
- It does not consist of an inner oscillator.
- It has flash memory which is programmable and has a range of fourteen-kilo byte.
- The speed of its central processing unit is five MIPS.
- The space of its random access memory is three sixty-eight bytes.
Pinout of PIC16F877A
- There are forty common pinouts of this module which are discussed here with the details.
MCLR/Vpp
- Through this pinout, we program the controller normally PicKit is used to program it.
RA0/AN0
- It is zero pinouts of Port A and also analog.
RA1/AN1
- It is the first pinout of port A and the first analog pinout.
RA2/AN2/Vref-
- It is the second pinout of port A.
RA3/AN3/Vref+
- It is the third pinout of port A.
RA4/T0CKI/C1out
- This is the fourth pinout of port A.
RE0/RD/AN5
- It is zero pinouts of Port E.
RE1/WR/AN6
- It is the first pinout of PORT E.
RE2/CS/AN7
- It is the seventh pinout of Port E.
Vdd
- At this pinout, the ground terminal is attached.
Vss
- At this pinout plus five volts are provided.
OSC1/CLKI
- At this pinout, an exterior oscillator clock is given,
RC0/T1OSO/T1CKI
- This is the zero pinouts of port C.
RC1/T1OSI/CCP2
- This is the first pinout of port C or also called pulse width modulation pinout.
RC2/CCP1
- This is the second pinout of port C.
RC3/SCK/SCL
- This is the third pinout of port c.
RD0/PSP0
- This is zero pinouts of Port D.
RD1/PSPI
- This is the first pinout of port D.
RD2/PSP2
- It is the second pinout of port D.
RD3/PSP3
- It is the third pinout of port D.
RC4/SDI/SDA
- This is a serial data input pinout.
RC5/SDO
- This is serail data ouput pinnput.
RC6/Tx/CK
- This transmitter pinout of this controller.
RC7/Rx/DT
- This is the receiver pinout of the controller.
RD4/PSP4
- This is the fourth pinout of port D.
RD5/PSP5
- This is the fifth pinout of Port D.
RD6/PSP6
- It is six pinouts of port D.
RD7/PSP7
- This is the seventh pinout of port D.
Vss
- At this pinout, positive five volts are given.
Vdd
- It is ground pinout.
RB0/INT
- This zero pinout of port B or exterior interrupt is given at this pinout.
RB1
- This is the second pinout of port B.
PIC16F877A Microcontroller Architecture
- The most common parts of PIC16F877A are the central processing unit, input and output ports, memory unit analog to digital converter, timers, serial communication protocol, etc.
- In the below figure block diagram of the PIC16F877A structure is shown.
CPU
- There are different process that occurs through the central processing unit of the controller such as arithmetic operation, logical operation. The CPU also makes pull-like arrangement between random access memory and other components of the controller.
- Arithmetic and logic operations are done by the ALU of the CPU. Different types of instruction are stored in the memory unit of CPU.
- Through the memory unit, we can define the program size of the microcontroller. There is one important part of the controller which is the control unit which operates communication buses among the central processing unit and other parts of the controller.
RAM
- The operating speed of the controller is defined by the size of the RAM. The ram comprises of registers that perform certain operations.
- The commonly used registers are of two types.
- The first one is GPR and the second is SFR.
- GPR performs general operations such as addition, subtraction, multiplication, etc. They can handle data up to eight bits.
- GPR does the read and write function through the user. For their function, they required certain types of software.
- For complicated functions, SFR registers are used and they can handle data up to sixteen bits through these registers user can read instructions and can not write.
- So the function performed by these registers are defined at the time of their creation.
ROM
- This memory unit is used for data storage, Through this memory, the size of our program is defined that it is known as program memory,
- During the operation of the controller, the program already stored in the read-only memory is executed according to every communication cycle.
EEPROM
- The EEPROM or electronically erasable read-only memory is also the category of the memory unit. In this command stores when the program gets executed.
- This memory retains the data after the power supplied to the controller is off.
Flash Memory:
- Flash memory of controller is a type of memory unit where we can read, write, and erase programs according to our requirements. Usually, ROM is used as a flash memory.
PIC Microcontroller Programming
- There are different types of programming software exist that are used for PIC controller programming. Some students and engineers are still using Assembly language for PIC controller programming but some other latest tools also exist that are used for programming.
- For programming PIC controller IDE is needed for performing programming. The compiler is a module that transformed our program in MCU reading form which is HEX files. The IPE used for converted hex will in PIC understanding language commonly used compiler is
- XC8 and IDE are MPLABX v3.35 while IPE is MPLAB IPE v3.35
PIC16F877a Ports
PIC16F877a comes with 5 ports that are listed here
Port A:
- This port comes with six inputs there Pin # 2 to Pin # 7 and noted as RA0 to RA5
Port B:
- In port B 8 pins are from Pin # 33 to Pin # 40. These pins are denoted as RB0 to RB7
Port C:
- Port C has also 8 pins there at different locations first four are Pin # 15 – Pin # 18 and the remaining four are Pin # 23 – Pin # 26.
Port D:
- It has 8 pins Pin # 19 – Pin # 22, and Pin # 27 – Pin # 30.
Port E:
- Port E comes with 3 pinouts that are Pin # 8 to Pin # 10. Mentioned as RE0 to RE2
PIC16f877A Vs PIC16f877
Features | PIC16f877A | PIC16f877 |
CPU | 8-bit PIC | 8-Bit |
Total Pins | 40 | 8-Bit |
Operating Voltage (V) | 2 to 5.5 V | 4 to 5.5 V |
Number of I/O pins | 33 | 33 |
ADC | 8ch, 10-bit |
10-bit, 8 Channel
|
Timer |
8-bit(2), 16-bit(1)
|
8bit |
Comparators | 2 | 2 |
DAC | Nil | nil |
Communication Protocol |
UART(1), SPI(1), I2C(1), MSSP(SPI/I2C)
|
UART, SPI(1), I2C MSSP(SPI/I2C) |
External Oscillator | Up to 20Mhz | up to 20 MHz |
Internal Oscillator | Nil | nil |
Program Memory | Flash | Flash |
Program Memory (KB) | 14KB | 14 KB |
CPU Speed (MIPS) | 5 MIPS | (MIPS/DMIPS) 5 |
RAM Bytes | 368 | SRAM (B) 368 |
Data EEPROM | 256 bytes | 256 Bytes |
Applications of PIC16F877A
- These are some applications of PIC16F877A.
- It used in numerous DIY projects.
- To learn different types of the controller it is the best option.
- For such projects that need numerous input and output interfaces, this controller is preferred.
- In such projects where Arduino is required, you can use this controller.
Faqs
What is PIC16F877A used for?
- PIC16F877A is used for differnt PIC projects such as digital electronics circuits it is also used in different devices such as remote sensor control, and security systems home automation systems.
What are the features of a PIC microcontroller?
- The advanced PIC controller comes with flash memory for storing instructions. Flash memory comes with a larger capacity and is erased than EPROM. PIC also comes with built-in RAM and EEPROM
Which software is used for PIC16F877A?
- Microchip PIC16F877 has 8K 14Kb flash memory that can be programmed with the use of C or assembly language. MPLAB X IDE (Integrated Development Environment) comes with assembler features and XC8 is also used which is a commonly used compiler for Microchip’s 8-bit compilers.
What is the memory of PIC16F877A?
- 368 bytes of Data Memory (RAM)
- 256 bytes EEPROM
What type of ADC is PIC16F877A?
- PIC16F877A comes with 8×10bit multiplexed ADC channels (AN0-AN7)
Why is PIC16F877A used?
- 16F877A has features that can perform different operations since comes with a larger programming memory unit which is 8k words and 368 Bytes of RAM.
Read also
So that is a detailed post about PIC16F877A if you have any further queries ask in the comments, Thanks for reading. Have a good day,