Bill Couture wrote : > I found that the PID *HAD* to be in the interrupt, *IN IT'S ENTIRETY* > (otherwise, the part of the PID that was not in the interrupt had > to look for it's flag, No, the main-loop should do the flag-checking that and call the PIC code when needed. > and there was no advantage to having ANY of the > PID in the interrupt). Maybe... But... You also said that you missed bytes on the serial link sometimes, didn't you ? That is, as I understand things, becuse you have locked-up the PIC in the PID-ISR for a to long time (with regard to the response time needed to not miss anything on the serial link). > The background loop has a fair amount of processing (none of it time > critical), and the jitter associated with getting around to see if > the PID flag was set could be seen in the mechanical system (and even > heard!). > > Since the PID is in the interrupt, it runs EXACTLY on > schedule. But that wasn't the problem, was it ? Was it not the missed bytes on the serial link that was the problem ? Anyway, that was what I was trying to address... Jan-Erik. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads