What is a pic microcontroller? The PIC microcontroller is a low-cost ‘ computer on a chip’ manufactured by Microchip. They allow electronic designers and hobbyists to impart intelligence and logic to a single chip for special purpose applications and products. The PIC microcontroller programming is done using the popular software ‘Mikro C’. This powerful yet easy to program into a 40-pin package is upwards compatible with the PIC16C5X, PIC12CXXX, and PIC16C7X devices.
How to program a microcontroller? Which is the program for microcontrollers? These are the commonly asked questions by microcontroller beginners. Here we are going to explore the world of microcontroller, microcontroller programming, and embedded systems with PIC16F877A. It has five ports- port A, port B, port C, port D, and port E.
An embedded system design is easy with the help of embedded C programming. Let’s start studying microcontrollers and embedded C programming for microcontroller PIC using Mikro C Pro. This article deals with the basic connection diagram and a LED blinking program for the PIC microcontroller.
Why PIC is used/ Why PIC is Popular?
- High speed
- High-performance RISC (Reduced Instruction Set Computer) CPU
- Instruction Set simplicity
- Integration of operation features
- Programmable timer options
- Interrupt control
- EPROM/OTP/ROM options
- Inbuilt modules
- Low power consumption
- Wide operating voltage range: 2.5 to 6 volt
- Programmable code protection mode
- Power-saving sleep mode
PIC16F877A Features
- High-performance CPU
- Only 35 instructions
- All are single cycle instruction excluding program branches.
- The operating speed is DC to 20 MHz.
- 8Kx14 words of flash memory
- 368×8 bytes of data memory
- 256×8 bytes of EEPROM data memory
- Interrupt compatibility
- Power-on reset
- Power up timer and oscillator start-up timer
- Watchdog timer with its own chip RC oscillator for reliable operation
- Programmable code protection power-saving SLEEP mode
- Low power, high-speed CMOS FLASH/EEPROM technology
- In-circuit serial programming capability via two pins
- Processor read-write access to program memory
- Single 5v in-circuit serial programming capability
- In-circuit debugging via two pins
- Wide operating voltage range
- High sink or source current
- Low power consumption
Basic connection diagram of PIC Microcontroller
To start a microcontroller project you need to configure the PIC as follows (Basic requirements)

(LED connected at the 7th pin of Port B is just an example)
Components required
- Power supply
- PIC16F877A microcontroller
- Resistors ¼ watt (1kΩ x 2)
- Capacitors (22pF x 2)
- An electrolytic capacitor (1µF)
- Push-button switch (for resetting the PIC)
- Crystal (4MHz)
- LED
Example Program [LED Blinking]
The program codes are well commented on for better understanding.
[cc lang=”C”]void main()
{
TRISB=0X00; //Initializing PORT B as output port
while(1) //Infinite loop
{
PORTB=0XFF; //Setting all bits of PORT B as HIGH
delay_ms(100); //Calling inbuilt delay program
PORTB=0X00; // Setting all bits of PORT B as LOW
delay_ms(100); //Calling inbuilt delay program
}
}[/cc]
Conclusion
This article will give you a brief idea about PIC microcontrollers and their work. We have discussed two popular PIC and their features. later on, we’ve also provided a sample code that could be a perfect starter for you with the PIC microcontroller.
Leave a Reply