I have a strange problem in interrupt, I am incrementing a variable in interrupt and displayng in main program, the code is working fine for some time , latter the system gets hanged , i dont know why??
if there is any solution to this problem plz let me know, I am using Silabs C8051F120
int var=0; void PCA_Timer_Interrupt(void) interrupt 9 using 2 { var++; } void main() { sprintf(buffer,"%d",(int)var); display(buffer,LINE1); }
Now let's say you use the value as an array subscript, or pointer offset.
He isn't using the var as an array subscript or a pointer offset,is he?
"He isn't using the var as an array subscript or a pointer offset,is he?"
Well, he hasn't shown any code that does that - but then the code that he has shown doesn't make sense, does it?
Jonny was just proposing an example of one way that could lead to crashing the program