On Mon, 5 Jan 2004, Chris Emerson wrote: > > per second, timed sporaticly), with TX and RX at 115Kbaud > > (so about 1ms per character). > > Isn't 115Kbaud about 0.1ms per character? With 500us of processing on > your timer interrupt, that would explain the overruns. Yup, it does. I found that myself before I left work, though I didn't have a chance to update my question before now. Damn... I drop a value of 10 when dividing in my head. I must be getting old... > > if (TMR1IF) > > { /* fairly long processing, but well under 500us */ } > > Does the code for TMR1IF really need to be in the interrupt handler at > all? Unless it's really that time-critical (which seems unlikely with > that much processing), I'd just set a flag in the isr and let the main > loop handle it. Depends on application needs, of course. It's actually about 300us out of the 500us between TMR1 interrupts. And, yes, it does have to be done in the interrupt. As noted elsewhere, I could use the TMR1IF flag to poll when the PID loop needs to execute, but I found that the resultant jitter could be seen (and heard!) in the mechanical system. Bill {who needs to go review his basic division} -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body