void temperature(void)
{
ADCON0=0X81;
ADCON1=0XC5;
[B][I][U]while(1);[/U][/I][/B]
{
delay();
ADCON0bits.GO=1;
while(ADCON0bits.DONE==1);
l_byte=ADRESL;
h_byte=ADRESH;
l_byte>>=2;
l_byte &=0X3F;
h_byte<<=6;
h_byte=0XC0;
bin_temp=l_byte|h_byte;
}
}
void temperature(void)
{
ADCON0=0X81;
ADCON1=0XC5;
while(1)
{
delay();
ADCON0bits.GO=1;
while(ADCON0bits.DONE==1);
l_byte=ADRESL;
h_byte=ADRESH;
l_byte>>=2;
l_byte &=0X3F;
h_byte<<=6;
h_byte=0XC0;
bin_temp=l_byte|h_byte;
}
}
#pragma config WDT=OFF //Turn watchdog timer off
#pragma config OSC=XT //For 4MHz oscillator
Hey i removed the semi colon from the function but still i have the same error of processor getting reset by WDT... and i also want to ask you that in all the while loops of my code..i have a semicolon at every end...just have a look is it right?
Oh My ***....
I think you don't know how to write a C Program...
You have done so many mistakes in that...
After every while() loop you have put a semicolon which means infinite loop
while (a == b);
{
//...........
//...........
}
while(a==b)
{
//.......
//.......
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?