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); }
"found that this thread is already talking about the interrupt problem in Nordic nrf24e1"
The Nordic chip is never mentioned in this thread. You should really open a new thread to discuss your problem. If not for netiquette, to show others that your problem is not the old problem already discussed in the thread.
One note regarding using 0: when you declare a interrupt function specifying using N, the interrupt entry code assumes that the declared bank is 'set aside' for the interrupt, and does not preserve any used registers. So, if you declare using 0 and your program uses bank 0 for anything else, your interrupt will overwrite main program registers, and if you're lucky your program will crash. If you're out of luck, the program may actually run with some weird side effect.
The using directive should only be used for ISRs that are at the same priority level, and that don't call any functions that are declared with other banked domains.