Usually when one wants to generate an accurate clock, one uses the correct crystal for the job. Why are people so stuck on frequency multiples of 1MHz? Why not use a 3.6864MHz, or 7.3728, or 11.0592MHz crystal or resonator? They aren't any more expensive. The only reason I can see is to make it easier to count cycles. It's nice to say, 10 instruction = 10uS. If you are doing rs-232, these crystals will give you 0% error. In fact, there are very few situations where 10MHz or 20MHz timing is better than a timing based on seconds being divided into a base 2 number. Let's say you use a 18.432MHz crystal. This frequency factors into 2^14 * 3^2 * 5^3. You can get practically any usefull timing you want from those factors! You want a one mS timer? Set the prescaler to 8, and let the timer run free, generating an interrupt 9000 times per second. It is then a simple matter to set up a jitter free fast counter which gives you your 1mS interrupt. -Adam Bob Ammerman wrote: > What we really need is a way to ensure that Timer 1 interrupts every 5000 > instructions or 1 millisecond. > > The problem is that there can be jitter on reaching the interrupt handler > for the timer. This jitter is caused by 2-cycle instructions, other > interrupt handlers, and interrupts being disabled at 'task' level. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu