Hm, sorry. I've watched my assembler and get sure, that it doesn't work too.
So, why stack overflow I know now - the interrupt procedure become recursive many times, I think so.
For clearing interrupt flags I guess too. But what I've done with RTI it does not work. As I think I've clear RTIF (1 = Set when the time-out period is met) in RTIFLG.
So at the end of RTI procedure I write:
RTIFLG = 0;
But it also doesn't work and value of RTIFLG register stays 0x80 at memory map in simulation. Is it not writable? I think it is read and write anytime. Other interrupts work correctly as for my eyes.
Can you complement my procedure for full and right?
uchar c;
c_rti ++;
if (c_rti == 8) {
c_rti = 0;
c = PORTB;
c = !(PORTB & 1);
PORTB = c;
printf("LED 1 changed..\n");
}
RTIFLG = 0; //I have no effect
Thank you.