> >Stack? Is there a stack in a 16F877A? > > Err, yes, all 8 words of one. Where do you think the machine > stores the return address on interrupt or subroutine call? Sorry, I was not aware of this stack. I learned on a x86 architecture, so I did not cared about the call&return stack, which is only 8 byte in PIC ;-) > >Anyway, the code for the ISR is big, > > That is always a bad sign ... No, it is not sooo big ... > >and it is not the ISR, which is hanging. > > Sure about that? (see (1) below) Yes. The LED which is switched on and off in the IRS, is still blinking, even if main loop is hanging. So, the ISR must return correctly, otherwise a new INT could not be worked out ... > >There is a small routine to have a LED blinking with the > ISR, and this > >LED is always blinking. > > > >Another LED was put inside the main, and that one is > stopping blinking. > > It sounds to me that one (or both) of two things is happening. > > 1. The ISR takes so long to execute that there is never > enough time for the main to do an instruction before the next > interrupt arrives. The timer is set to 25 ms. The code is about 100 lines of code at a 10 MHz prozessor. So it could not be to big. And the ISR code worked in another project before. What I changed is the main loop. > 2. The ISR has subroutine calls that have overflowed the > stack and wiped out the return to main program address. That is, very I have to look. I am working a lot with call's to keep code small, but thsi seems to be turning out the problem. I tried to disable the INT before making calls in the main loop amd enable after return from call, and it improved the situation dramaticly. Best Jens -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist