At 12:10 PM 3/7/98 -0800, you wrote: >Christoph Klein wrote: > >> I would like to measure time intervals which are presented to >> a Pic16C84 (possibly) as short TTL-compatible spikes. >> Supposing that measuring the interval would be the pic's only task: >> >> What would be the best time resolution I could expect using a >> 4 MHz pic with a Xtal? >> >> And how about accuracy? >> >> Is there a chance to measure with a resolution in the msec range or >> isn't there? I haven't got a clue ... > >Christoph: > >Millisecond resolution is no problem whatsoever... In fact, you can >measure the intervals to a resolution of better then 5 microseconds >at 4 MHz, with fewer than a dozen lines of code. > >Accuracy will be dependent upon the precision and stability of your >crystal, but even the cheapest crystals will give you better than >0.01% accuracy. Note that the crystal stability and accuracy is the more important issue if you want to measure "real" microseconds. In that case a 0.01% crystal will limit you to +/-1 milisecond accuracy. If on the othwer hand you are doing relative measurements and the temperature of your device dosent fluctuate wildly then you can measure realative times down to an accuracy of a few microseconds. This is another example of where measutring absolute values is a pain but relative values are relatively easy. To get real accuracy down to microseconds requires a bit more then a pic and a XTL. Nicholas Uloth Industrial Software Partners Ltd 6 The Promenade Mt Pleasant, Perth, WA 6153 Australia ph: xxx-618-93647181 fax: xxx-618-9481-7202 email: niculoth@iohk.com niculoth@hotmail.com