> May need to cast an operation to a larger storage variable If I'm right in assuming that there's some asynchronicity between the wave edges and when the PIC recognises them (ie a small portion of each of the many waves in the sample is lost), then larger "variable" could be an external divider A /512 (or whatever sample size Fred decides on) external counter would be synchronous with the edge events and not accumulate the small errors as the PIC does. The only error, at the PIC, would be the part-cycle one at the time of measurement wbr, Joe -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist