PPA (a.k.a. Phillipe) wrote: > > Hi Olin, > > Of course there will be a significant jitter. > A bit of math: > I expect an int routine global treatment time (worst case) of 100 =C2=B5S= @ > 8MHz, > so we can expect a mean jitter of half of that, say 50 =C2=B5S. 100uS is a relatively slow rate. Here is a suggestion on how to approach the problem. You may wish to read the thread on RTOS's too... I would suggest setting up a timer interrupt to poll the I/O pins. This interrupt routine can read the state of the pins and store the result into a circular buffer. In addition, the circular buffer's pointer also serves as the time stamp. Meanwhile, code not running in the routine will process the data captured in the circular buffer and look for I/O pin changes. Changes are easy to detect by exclusive-or'ing the current sample with the previous. If you need to debounce spurious glitches, then check out http://www.dattalo.com/technical/software/pic/debounce.html Scott > This is 5% for a 1 ms full scale; in the same time the resolution of TMR1 > that > I use is 1 =C2=B5S (1/1000th of full scale) and I use some filtering - say > with 8 > samples to simplify computing - so I may expect an "acceptable" result > (1.5% > or less with simple averaging down to 0.5% with a better method). Also > with > the cost of some smooth delay due to averaging... > All of this without taking into account all other jitter sources... > If I decide to finally use an external osc @ 20MHz, it should be better. > > > Olin Lathrop wrote: >> >> PPA wrote: >>> Nevertheless, do you have any advice on IOC >> >> Do you mean "interrupt on change". If so, then it doesn't seem >> appropriate >> in this case. How do you expect to handle separate asynchronous >> interrupts >> from so many input pins without significant jitter, and therefore loss >> of >> resolution? >> > > > ----- > Best regards, > > Philippe. > > http://www.pmpcomp.fr Pic Micro Pascal for all! > -- > View this message in context: > http://www.nabble.com/Reliable-IOC--tp23611087p23702815.html > Sent from the PIC - [PIC] mailing list archive at Nabble.com. > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist