We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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); }
"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