PIC microcontroller Beginner's guide: Basic connection circuit

What is a pic microcontroller? The PIC microcontroller is a low cost 'computers on a chip' manufactured by Microchip. They allow electronic designers and hobbyists 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 microcontroller?
Which is the program for microcontroller? 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 is 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 about microcontroller and embedded C programming for microcontroller PIC using Mikro C Pro. This article deals with the basic connection diagram and a LED blinking program of 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 operation 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 for program branches.
  • Operating speed is DC to 20 MHz.
  • 8Kx14 word of flash memory
  • 368x8 bytes of data memory
  • 256x8 bytes of EEPROM data memory
  • Interrupt compatibility
  • Power on reset
  • Power up timer and oscillator start up timer
  • Watch dog 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)
PIC connection diagram
(LED connected at the 7th pin of Port B is just for an example)

Components required

  1. Power supply
  2. PIC16F877A microcontroller
  3. Resistors ¼ watt (1kΩ x 2)
  4. Capacitors (22pF x 2)
  5. Electrolytic capacitor (1µF)
  6. Push button switch (for resetting the PIC)
  7. Crystal (4MHz)
  8. LED
Also Read:

Example Program [LED Blinking]

The program codes are well commented for better understanding.


PIC Simulation Video


Watch this interactive video to know more about PIC programming.

PIC Pinout

Ads


10 comments:

  1. Thank you sir, I'm a circuit hobbyist and interested to study PIC microcontroller. This article really impressed me

    ReplyDelete
    Replies
    1. Hi Mathew,
      Keep visiting CircuitsGallery for Microcontroller projects and tutorials

      Delete
  2. Nice circuit, I found the better circuit here

    ReplyDelete
    Replies
    1. Thanks, Please like our facebook page and subscribe via mail to get latest PIC circuits

      Delete
  3. Sir,
    I am a 3rd year engineering student, I have a doubt, Which is easy to learn 8051 microcontroller or PIC. Please answer me sir

    ReplyDelete
    Replies
    1. Hi Jacob,
      In our experience PIC microcontroller is much simpler than 8051. Comparing to 8051, PIC has many advantages. For example PIC has internal Analog to Digital Converter (ADC) where as 8051 need an extra IC for Analog to Digital conversion. Hence we recommend you to learn PIC microcontroller. Keep visiting Circuits Gallery for "Getting started with PIC"

      Delete
  4. Thank you Sir,
    Hope you will post many circuits related to PIC microcontroller

    ReplyDelete
    Replies
    1. Hi David,
      Sure, We will post further PIC tutorials as soon as possible. Keep visiting and subscribe to get new post in your inbox

      Delete
  5. Murugesan.kJanuary 01, 2013

    i need more details about pic controller how initialize the pin as input and output ....

    ReplyDelete
    Replies
    1. Hi Murugesan.k,
      In the above program ve have declared port B as 'Output Port'.

      TRISB=0x00 comment used for initializing the pin as Output pins

      TRISB=0xFF comment used for initializing the pin as Input pins.
      Keep visiting circuitsgallery for more PIC circuits

      Delete

 

Copyright © 2011 CircuitsGallery| ToS | Privacy Policy |

Contact Us | Write For Us | Advertise on Circuits Gallery | About Us