How to use a PIC microcontroller for LED blinking?

How to use a PIC microcontroller for LED blinking?

LED Blinking using PIC Microcontroller with examples: In this tutorial, we will see examples to interface an LED with PIC Microcontroller. LED blinking is the simplest and most commonly used example for the beginners. It acts as a stepping stone for microcontroller development.

How many GPIO pins are there in pic16f877a?

PIC16F877A has 33-gpio’s grouped into five ports namely PORTA-PORTE as shown in the below table. As shown in the above table many I/O pins have 2-3 functions. If a pin is used for other function then it may not be used as a gpio. Though the gpio pins are grouped into 8-bit ports they can still be configured and accessed individually.

How to make LED blinking in MPLAB xc8?

Now let’s see an LED blinking code in MPLAB XC8 compiler. Like every PORT of PIC18F4550, PORTC is also a 7-bit bidirectional port. Each pin can be used both as a digital input or a digital output. These three registers are associated with PORTC: As its name suggests, this 7-bit register is used to set the direction of data.

How can I increase the blinking speed of a led?

Pin1 of PORTC is set to 1 (HIGH) in instruction 4 and after a delay of 1000ms, it is set to 0 (LOW) in instruction 6. This process is repeated until the program is aborted. This causes the blinking of the LED. The speed of the Blinking LED can be increased or decreased by varying the delay value.

How to turn on led on pic18f4550 microcontroller?

-From the left pane go to PIC18F4xxx Configuration Settings and then select PIC18F4550 . It would list you all the configuration settings for pic18f4550. IF you want to use any pin in the microcontroller for any operation then you have to first set the pin to either for an input or out put.

Where can I find the source code for pic18f4550?

Download the code main.c or Download the entire Source code as Mplab Project. Next step is to compile the code. After the project is built the output files will be dumped into the same project folder, if a separate output folder is not defined for saving all the compiled files.