shreyas_patel21
Full Member level 3

I am using pic18f66k90 with MPLAB IDE and C18 compiler.
My program stuck at some point and controller does not give any response.
All the thing in my code works fine up to some point but when I add some more code, the problem occurs.
some time I solved the problem by enabling all optimization from options.
and some time my problem was solved by using following code:
instead of following code:
Can it be a stack overflow issue?
How can I identify stack overflow? is there any option in MPLAB?
My program stuck at some point and controller does not give any response.
All the thing in my code works fine up to some point but when I add some more code, the problem occurs.
some time I solved the problem by enabling all optimization from options.
and some time my problem was solved by using following code:
Code:
if((state==STATE_VOLTAGE&&VtgIndex==SelectedVtg)||(OverloadFlag==1))
{
}
else if(state==STATE_UNKNOWN)
{
}
Code:
if((state==STATE_VOLTAGE&&VtgIndex==SelectedVtg)||(OverloadFlag==1)||(state==STATE_UNKNOWN))
{
}
Can it be a stack overflow issue?
How can I identify stack overflow? is there any option in MPLAB?