PIC16F877A LED blink example with CCS C compiler

PIC16F877A is a 40-pin (PDIP type) microcontroller which has 5 ports: A, B, C, D and E. From the 40 pins we can use 33 pins as an I/O pins. This microcontroller has 3 timers which are:
Timer0: 8-bit timer,
Timer1: 16-bit timer,
Timer2: 8-bit timer.
This microcontroller has also 10-bit, up to 8-channel Analog-to-Digital Converter (ADC) and many other peripheral features.
This topic shows PIC16F877A LED blink example and also shows how to make all the available outputs of the PIC16F877A microcontroller blink.

PIC16F877A LED blink example circuit:
This is a small example shows how to make an LED blinking. Circuit schematic is shown below:
PIC16F877A LED blink example circuit
In this example the PIC16F877A microcontroller runs with 8MHz crystal oscillator and the LED is connected to pin RB0 through 330 ohm resistor.

Blink an LED using PIC16F877A C code:
Example C code is the one below, it was tested with CCS C compiler version 5.051.

PIC16F877A make all outputs blink:
This is a second example which makes all the 33 output pins on PIC16F877A blink. Circuit schematic is below:
PIC16F877A LED blink make all outputs blink circuit
PIC16F877A make all outputs blink CCS PIC C code:
The C code below was also tested with CCS C compiler version 5.051.

3 thoughts on “PIC16F877A LED blink example with CCS C compiler”

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top