Execute this project and learn how to blink led connected to the GPIO pins of PIC16F877A microcontroller using MPLAB IDE and PICKIT programmer.
The required hardware and software for this project is as below:
The hardware components required for the project, their concepts and theory of operation are explained below:
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode that emits light when activated. When a suitable current is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. Light-emitting diodes are used in applications as diverse as aviation lighting, automotive headlamps, advertising, general lighting, traffic signals, camera flashes, lighted wallpaper and medical devices.
The hardware components for the project are shown in the following picture. I am using ETK01001 embedded trainer kit board for this project where I am connecting a hookup cable from microcontroller GPIO pin to a led on the board.
The schematic diagram for this project is as shown below:
PIC16F877A is a 8-bit microcontroller. Download the datasheet of the microcontroller here.
Once you have everything set up it should look something like this:
Before starting on software development, let me introduce you some basic stuff on programming. To solve a problem you are creating a project/product. You need to develop source code for the project. To edit source code you need an editor or IDE. You need a compiler to compile your source code. We will use MPLAB X IDE for this project which is an IDE meaning XC8 compiler is integrated into it.Follow the below steps to edit source code, compile source code, create binary for your project: