pic microcontroller for beginners 16

[otw_is sidebar=otw-sidebar-1]pic microcontroller for beginners,pic microcontroller,Programming of PIC microcontroller,Applications of the PIC MicrocontrollerI hope you all are doing good, I had started the series on microcontrollers and this article is the second in the series, in the first article I had discussed about the introduction to microcontrollers in general. I had discussed some basic concepts about the microcontrollers and also briefly explained commonly used peripherals of the microcontroller. In this article I will particularly discuss the PIC microcontrollers, common and popular microcontrollers of the PIC family, applications of the PIC microcontrollers and architecture of PIC microcontroller. So sit back, keep reading and enjoy learning.



Introduction of PIC Microcontrollers:

If you are the student of electrical / electronic engineering you must be aware of the term “PIC microcontroller”. PIC microcontroller is one of the most popular families of the microcontrollers and is found in variety of embedded systems.

Microcontrollers in the PIC family share most of the features with the microcontrollers of other families and also possess some unique features. As an example like the microcontrollers of other families the PIC microcontroller also has I2C serial communication bus (Inter Integrated Circuit), which is used for communication with other ICs for example the sensor, memory or I/O devices in embedded applications. Some PIC microcontrollers also has USB host controller integrated on the chip itself which enable the PIC microcontrollers to communicate to the other USB devices without the need of the USB to UART converter circuits or adapter boards. One main advantage of the on board USB host controller is that while working with the PIC microcontrollers the hardware design engineer does not needs to add the USB to UART controller in order to let the developer program the microcontroller because the microcontroller can directly be interfaced with the computer in order to program it. But one thing has to make sure that the PIC microcontroller should have USB boot loader in order to be able to be programmed via USB directly. Please note at this point that the built in USB is not unique to the PIC microcontroller, microcontrollers of other families also has built in USB host controllers.

PIC microcontrollers also has the SPI (Serial Peripheral Interface) communication bus, which is also a popular communication standard for embedded applications. PIC microcontrollers have the on chip ISP (in System Programming) due to which it can be programmed while connected in the system and without USB port. In addition to common communication interfaces the PIC microcontroller also has some other common peripherals such as interrupts, RTC reset, Power on Reset, UART (Universal Asynchronous Receiver Transmitter) and Brownout Reset. Like the most microcontrollers the PIC microcontroller also have on chip Analog to Digital Converters (ADCs), timers and in some cases also the Digital to Analog Converters (DACs).

One of the major reasons that the PIC microcontrollers are so popular is their available online support for development. An embedded firmware engineer can download the readymade libraries for the PIC microcontrollers and thus his / her task is minimized and lots of time and effort is saved. I have been asked a lot of times by the students that and you might also have noticed that the code written for microcontroller of one family cannot run on microcontroller of another family. For example the code written for the AVR microcontroller cannot run on the PIC microcontroller. The reason to this is the instruction set every family of microcontroller has its unique instruction set that is why the code written for the PIC cannot run on the AVR and vice versa. The PIC can be programmed using MPLab software and PICKIT the details of which will be discussed later in the article.

Types of PIC Microcontrollers

In this chapter I will discuss about some of the popular microcontrollers from the PIC microcontroller family. There are a large number of microcontrollers in the PIC microcontroller family each with its different features. These microcontrollers differ in their data memory, code memory, EEPROM, number of available GPIOs (General Purpose Inputs / Outputs), number of available Serial communication interfaces for example some members of the PIC microcontrollers have one UART (Universal Asynchronous Receiver Transmitter) some have two similar some members have one I2C (Inter Integrated Bus) some have two even more than two and this depends on the size of the data memory of the microcontroller. One important thing to mention here is that all the members of the PIC microcontrollers’ family are ARM (Advanced Reduced Instruction Set Computing) based which means that all the ARM tools can be used for the PIC microcontrollers.

Some of the commonly used PIC microcontrollers are listed below:

1)      PIC16F877A.

2)      PIC18F4520.

3)      PIC16F18326.

4)      PIC16F716.

5)      PIC18F67K22T.

6)      PIC18F2525.

Another important factor that contributes to the popularity of a particular microcontroller / microcontroller family is the availability of the available microcontroller development boards. The availability of the development boards reduces the development time of the application or the product by minimizing or in the best cases eliminating the hardware development of the microcontroller. So instead of getting involved in the circuit design phase of the microcontroller the developer uses the readymade development boards and start developing the API right away. In this way the developer can test the codes and eliminates the bugs un his / her code easily.


The development board of the microcontroller is the circuit board that contains all the auxiliaries necessary to run the microcontroller. Some microcontroller development boards simply contain the microcontroller and auxiliaries that are required to run the microcontroller for example the power on reset circuit, crystal, USB to UART converter and in these boards the GPIOs (General Purpose Input / Output) pins of the microcontroller are breakout on the external headers. Thus the user can use these pins to use them in their applications. On the other hand some microcontroller development boards have other modules mounted on the development board in addition to the auxiliary circuits, for example the LCDs, Push Buttons, LEDs etc. as an example consider the Arduino which is the microcontroller development board. Although the Arduino is the development board of the Atmel microcontroller it is mentioned here just for reader’s reference as it is the most popular microcontroller development board.


The development board of the PIC16F8770 microcontroller known as the PIC KICK is shown in the following figure:


Notice in the image that this development boards has on board LCD (Liquid Crystal Display) and push buttons.


Similarly consider the development board of the PIC18f4520 which is commonly known as the EASY PIC development.

This microcontroller development board as I have mentioned earlier consist of the microcontroller and the auxiliaries only and the General Purpose Input Output pins of the PIC microcontroller are broken out on the headers as shown in the image above.




Programming of PIC microcontroller:

In this chapter I will discuss the programming of the PIC microcontroller. Before diving into the discussion of programming of the PIC microcontroller in particular let us discuss the programming microcontroller in general. I had mentioned earlier that the PIC microcontrollers have on chip code memory and data memory. Thus as the name implies the code memory of the PIC microcontroller is used to store the code / program, the program is the collection of instructions that are meant to carry out a particular task and is written in C or assembly programming language. The collection of these instructions is called a Program and it collectively performs a particular task.

The program for the microcontroller is written in the programming language using the dedicated software sometimes referred to as the editor. Once the program has been written it is then compiled, as the program is written in the high level language and the computer can only understand the language of zeros and ones. This language of zeros and ones that the computer can understand is called the machine language. Thus most of you must have figured out that the compiler which is also the dedicated software and it performs the task of converting the program written in the high level language into the low level language.

The code has been written and is converted into the machine language it is now time to upload the code into the microcontroller which is done using the separate software. The HEX file which is obtained after converting the high level language program into the low level language program is fed into this software and it then uploads the code into the code memory of the microcontroller. At this point it is important to mention that now a days all three softwares are now integrated and the integrated software is referred to as the Integrated Development Environment.

Now coming back to the our PIC microcontroller obviously the process of programming the PIC microcontroller should be identical to the above mentioned process but it uses different tools to program the PIC microcontroller. The software used for programming the PIC microcontrollers is the MPLab. This software combines the editor and the compiler which means that the developer can write the program in the software and can also generate the HEX file. When you open the MPLab you create the project, select the microcontroller you want program and then write the code. Once the code is completed it is compiled to get the HEX file.

When the coding is completed and HEX file is generated it is now time to upload the code into the microcontroller. Unfortunately the MPLab is not able to upload the code into the PIC microcontroller and thus the another software is required to upload the HEX file into the PIC microcontroller. Various softwares are available for uploading the code into the microcontroller the most commonly used software is PICFLSH. With this software the HEX file is dumped into the PIC microcontroller and the PIC is programmed.

Consider the hardware shown in the following figure:

This hardware is referred to as the PICKIT which is used for programming the PIC while in the circuit.

Applications of the PIC Microcontroller:

As I mentioned in the previous article that the microcontrollers are most commonly used in the embedded applications, same is the true for PIC Microcontrollers. PIC microcontrollers are employed in the diverse applications of embedded system, some of the applications of the PIC microcontroller are listed below:

1)      Home Automation System.

2)      Battery Guaging Circuits.

3)      Vehicle Speed Monitoring System.

4)      Automatic Door Controllers.

5)      Asset tracking systems.

6)      Home appliances such as wireless control of appliances, microwave oven, TC remotes, TV, motion detection systems etc.

7)      Industrial products.

8)      Data logging systems.

9)      IoT enabled surveillance system.

10)  IoT enabled home automation system.

Besides the applications of the PIC microcontrollers in consumer products and industrial products this microcontroller is also popular among the engineering students and electronics hobbyists.

PIC Microcontroller Block Diagram:


This chapter is the most important of all in this article, as I have mentioned earlier that the PIC microcontroller consist of all the popular peripherals of the microcontrollers. PIC microcontrollers have the Serial Peripheral Interface (SPI), Inter Integrated Circuit (I2C), UART (Universal Asynchronous Receiver Transmitter), timers, input / output ports. The PIC microcontrollers also have the Data memory, code memory data memory is used to store the data that is taken into the microcontroller from the I/O ports or the serial communication interfaces. On the other hand the code memory is used to store the program.

All of these peripherals are attached to the CPU inside the microcontrollers with the help of the bus. The following figure shows the architecture / block diagram of the PIC microcontroller.

That is all for now I hope this article would be helpful for you. In the next article I will discuss about another popular family of the microcontroller, till then stay connected, keep reading and enjoy learning.


  1. Wow, marvelous weblog format! How lengthy have you ever been running a blog for?
    you made blogging look easy. The total look of your site is magnificent, as well as the content!
    You can see similar here e-commerce

  2. When some one searches for his necessary thing, therefore he/she needs to be available that in detail,
    so that thing is maintained over here. I saw similar here: Najlepszy sklep

  3. It’s actually a nice and helpful piece of info.

    I am happy that you simply shared this useful info with us.
    Please keep us up to date like this. Thank you for sharing.

    I saw similar here: Dobry sklep

  4. Hi there! Do you know if they make any plugins to
    assist with Search Engine Optimization? I’m trying to get my blog
    to rank for some targeted keywords but I’m not seeing very
    good success. If you know of any please share.
    Thank you! You can read similar art here: Sklep internetowy

  5. It’s very interesting! If you need help, look here: ARA Agency

  6. Very good site you have here but I was wondering if you knew of any discussion boards that cover the same topics discussed in this
    article? I’d really love to be a part of online community where I can get suggestions from other knowledgeable individuals
    that share the same interest. If you have any recommendations, please let me know.

    my website; vpn code 2024

  7. Hello there, You’ve done a fantastic job. I will certainly digg it and personally recommend to my friends.

    I am confident they will be benefited from this website.

    Feel free to visit my webpage vpn special

  8. Thanks for another informative website. Where else could I get that kind of info written in such a perfect way? I’ve a project that I am just now working on, and I’ve been on the look out for such information.

  9. Hello! Do you know if they make any plugins to assist
    with Search Engine Optimization? I’m trying
    to get my website to rank for some targeted keywords but
    I’m not seeing very good gains. If you know
    of any please share. Cheers! You can read similar
    art here: Scrapebox List

  10. You’ve made your position quite effectively.!

  11. Hello, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam comments? If so how do you reduce it, any plugin or anything you can suggest? I get so much lately it’s driving me mad so any assistance is very much appreciated.

  12. Excellent write-up. I certainly appreciate this site.
    Keep writing!

    Here is my site :: vpn special coupon

  13. Very wonderful information can be found on web blog.

  14. Nice post. I was checking constantly this blog and I am impressed! Extremely helpful info particularly the last part 🙂 I care for such information a lot. I was looking for this certain info for a long time. Thank you and best of luck.

  15. Its such as you learn my thoughts! You appear to understand a lot about this, such as you wrote the book in it or something. I think that you simply can do with some p.c. to drive the message home a little bit, however instead of that, that is magnificent blog. A great read. I’ll definitely be back.

  16. Hi, i think that i noticed you visited my web site thus i got here to “go back the favor”.I’m attempting to find issues to enhance my web site!I assume its adequate to make use of some of your ideas!!

Leave a Reply

Your email address will not be published. Required fields are marked *