Hartung, Greg wrote: > > My ISR routine takes a very long time to service. About 70ms, longer > than the lowest frequency I can engineer with the dividers on a 20Mhz > crystal (20m/4/65536=. I would like to call the ISR on a nice even > frequency of 10hz so the sampling is easy and intuitive to graph later. The > dividers will reduce by up to 65,536, so... a crystal of 10x? or a 555 of > 10x? or is there an easier way? I don't think I can do it the traditional > way of just interrupting more often and keeping a counter because my ISR > will skip interrupts on certain iterations. Olin suggested trimming my ISR > code, but everything there needs to get done before the next iteration, so > that doesn't seem like the solution. Hi Greg, a good way to handle this is to use a fast timer interrupt routine, which checks the timer and makes an "event" every 100mS. This one-sec timer routine at: http://www.ezy.net.au/~fastvid/one_sec.htm can be easily adapted to do that. Then with such a long (70mS) task I suggest doing it OUTSIDE the int routine, so the int routine just sets a bit, then in your main non-int code you detect that bit and start the 70mS task. That way the timer int keeps perfect time while the task is being performed. :o) -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.