Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to write a program in PIC16f876 to blink LED

Status
Not open for further replies.

rafidragon

Newbie level 2
Joined
Jan 12, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Hi

Could anyone guide me to write a program to blink LED using PIC16f876 with the schematic connection.

Added after 1 minutes:

#include<htc.h>
#include<pic.h>
#define _XTAL_FREQ 20000000
void main()
{
ADCON1 = 0x06;
PORTA = 0x00; //set RA0-RA5 low
TRISA = 0x00; //set PORTA to output
//superloop
while(1)
{
PORTA = !PORTA;
__delay_ms(25);
}
}

is this program is correct . But when i connected the pic , LED Is not blinking
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top