Created
July 13, 2017 06:19
-
-
Save bha159/78cdc56dab6807ce00c2c36f110457a8 to your computer and use it in GitHub Desktop.
This code is for blinking a LED connected to D2 pin of PIC16F877A,MPLAB X is used as IDE and CCS compiler is used. A 20MHz external oscillator is used in circuit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "16F877A.h" | |
#FUSES HS | |
#use delay (clock=20MHZ) | |
void main() | |
{ | |
set_tris_a(0x00); | |
set_tris_b(0x00); | |
set_tris_c(0x00); | |
set_tris_d(0x00); | |
output_a(0x00); | |
output_b(0x00); | |
output_c(0x00); | |
while (1) | |
{ | |
output_d(0xFF); | |
delay_ms(1000); //1 Second Delay | |
output_d(0x00); | |
delay_ms(1000); //1 Second Delay | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment