deadly123
New Member
Hi all,
I am new to PIC programming and just started PIC programming the other day.. I wrote this simple code and burn it in PIC but the PIC seems dead and doesn't work at all..
#include<htc.h>
#include "delay.h"
#define _XTAL_FREQ 20000000
__CONFIG (UNPROTECT &BORDIS &WDTDIS &PWRTEN );
void main()
{
TRISC6=0b0;
while(1)
{
RC6=0;
DelayMs(500);
RC6=1;
DelayMs(500);
}
}
I have MCLR pulled up with 4k7 resistor and 20MHz crystal in pin OSC1 and OSC2 with 22pF capacitor grounding them. I just can't figure out the problem.. HELP??
I am new to PIC programming and just started PIC programming the other day.. I wrote this simple code and burn it in PIC but the PIC seems dead and doesn't work at all..
#include<htc.h>
#include "delay.h"
#define _XTAL_FREQ 20000000
__CONFIG (UNPROTECT &BORDIS &WDTDIS &PWRTEN );
void main()
{
TRISC6=0b0;
while(1)
{
RC6=0;
DelayMs(500);
RC6=1;
DelayMs(500);
}
}
I have MCLR pulled up with 4k7 resistor and 20MHz crystal in pin OSC1 and OSC2 with 22pF capacitor grounding them. I just can't figure out the problem.. HELP??