> At 02:33 PM 8/7/02 -0500, Adam Smith wrote: > >The reason I need this routine to be short is because I have to retfie > >in time for the next interrupt (24 instruction cycles per interrupt, 18 > >after you consider the 4 instructions it takes for the PIC to go to the > >interrupt vector, etc. and the 2 instructions it takes to retfie). > > Sorry. I read it as "instructions before the [single instr]" rather > than "before the retfie". > > I think that if you have that close of a time constraint, that this > may not be the way you want to do it. (I also know you want to see > if you can do it...and I also know that if it works, then, it works :) > > > >(The code that executes in-between interrupts is just an infinite loop. > >This is running on a PIC16F872 @ 3.6864 MHz.) > > Ok, on the chance that the interrupt must be short, but that > the time from "timeout" to actually doing that "one instruction" > is not so critical, use your "infinite loop" time to offload some > of that decrementing or checking. Does the foreground infinite loop call any subroutines? If not, then you could re-enable interrupts in the interrupt routine. That causes the interrupt routine to restart when a new interrupt occurs. In other words, an interrupt condition becomes a GOTO 4. Of course if this happens all the time, then the foreground loop will never get any cycles (so I guess it doesn't matter if it can't use the stack). ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.