In order to get in and out quick I will need to use another timer I guess. I need to fire off serries of 8 pulses every 22ms. The high pulses will range from 400us to 1800us with a 400uslow pulse/pause between each one. So I am looking for some advise as to the best approach. Would be the best approach it with a second timer or the same one? I guess if I use the same one I can add up all the small pulses and then wait the difference of 22ms and repeat, but I am not sure if that is as reliable as using two timers, perhaps simpler though. If two timers, should I use timer1 (the 16 bit one for the shorter pulses since their accuracty is more critical than the 22ms) and timer0 or timer2 for the 22ms event. Is there any big deal with changing the preload value for the shorter pulses each time?
In either approach, can I use a case select inside the interupt routine to remember where I am in the interupt pulse train each time I return, or is there something I have to do to pass variables in and out of the interupt routine.
Thanks,
Charlie
Bookmarks