rafidragon
Newbie level 2
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
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