This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in Interrupt

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);

}



0