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

interrupt

Why the program don't enter in this intrrerupt??

this is my code

void timer0_isr (void) interrupt 1 using 1
{
 int a=0,c;
 a++;
    // ram[a] = din(7);
c=9;
 if (a > 10) a=0;
}

Parents
  • Quite interesting initialization.

    Don't you think that TH0 should be loaded with the high part of PERIOD and TL0 with the low part? You initialize the two registers with the same value...

    By the way - if you have code that doesn't work too well (which is the reason that you ask for help), it may be a good idea to document your code lines. Or are you saying that it is 100% obvious what TR0 = 1 means? And 6 months from now you will still instantly recall why you assign the value 1? Or what the flag 0x02 menas that you assign to TMOD?

Reply
  • Quite interesting initialization.

    Don't you think that TH0 should be loaded with the high part of PERIOD and TL0 with the low part? You initialize the two registers with the same value...

    By the way - if you have code that doesn't work too well (which is the reason that you ask for help), it may be a good idea to document your code lines. Or are you saying that it is 100% obvious what TR0 = 1 means? And 6 months from now you will still instantly recall why you assign the value 1? Or what the flag 0x02 menas that you assign to TMOD?

Children