Pages

Wednesday, February 24, 2016

PIC16F84A LED blink

PIC16F84A LED flasher
Blink an LED using PIC16F84A and CCS PIC C compiler
This topic shows how to make an LED blinking using PIC16F84A and PIC C compiler.
It is easy to make an LED blinking, a few program lines is required and the microcontroller PIC16F84A is a simple chip also.
PIC16F84A LED blink circuit:
Circuit schematic for the LED flasher is shown below.
pic16f84a led blink ccs pic c
PIC16F84A LED blink C code:
Code is written with CCS compiler.
// PIC16F84A LED blink example
// http://ccspicc.blogspot.com/

#include <16F84A.h>
#use delay(crystal=8000000)

void main()
{
   while(TRUE)    // Endless loop
   {
      output_low(PIN_A0);    // LED OFF
      delay_ms(500);         // Delay 500 ms
      output_high(PIN_A0);   // LED ON
      delay_ms(500);         // Delay 500 ms
   }
}

PIC16F84A LED blink simulation video:
The following video shows the simulation using Proteus.