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; }
If your program never enters the interrupt service routine, how are we supposed to tell that from the code of the routine ?
i write that value for c and i see the program canot execute this
If the processor never enters the interrupt routine, then the error IS NOT inte the interrupt service routine, hence not in the code you have posted.
Yes, your ISR can be buggy, but the reason why it isn't run is somewhere else!
rotar, You probably misconfigured your timer. Who don't you show us the code that does that?
the code is this
// Set Timer0 for the fix rate 1464.8 Hz = 12MHz / 2^13 // TL0 = 0x27; // TH0 = 0xF1; TMOD = 1; ET0 = ON; // Timer 0 Interrupt on TR0 = ON; // Timer 0 start
.
is corect? or i must write more???
it is probably incorrect, which is why I asked you to show the initialization code - not the ISR itself.
WHAT is ISR?
this is an isr (=interrupt service routine):
now post the code that initializes the timer, please.
. TH0 = (unsigned char) PERIOD; TL0 = (unsigned char) PERIOD; TMOD = TMOD | 0x02; TR0 = 1; ET0 = 1; EAL = 1;
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?
HOW CAN I LINK THE SOFTWARE WITH THE COMPILER?OR IS IT A BETTER ONE?
that you SHOUT does not make it better to state your question in an unrelated thread.
Erik
PS your question does not make sense repost in a new thread not using CAPITALS and do remember "more words do not make you appear stupid, they make you appear precise"