Hi,
Also you should NOT be using GOSUB's inside an interrupt.
This is one of my pet peeves.... I see it being mentioned "all the time" but never ever does anyone give an explanation to why.

I mean, I CAN see reasons for it not being a good idea but to just generally advising against it is a bit strong IMO.

One reason for it not being a good idea is, for example, if you're GOSUB'ing a routine (from within the ISR) that you ALSO may be GOSUB'ing from somewhere in your main program loop - if an interrupt occurs while the main program loop is within the subroutine. If that happens the "instance" of the routine that the main program is executing may be "corrupted" by the ISR executing the same piece of code.

I'm not saying I'm correct here, what I'm asking for it to please explain WHY you should NOT do it. Doing so will help us UNDERSTAND and not just painstakingly follow an advice that we do not understand the reasoning behind.

/Henrik.