At 07:05 PM 7/22/06 -0400, Denny Esterline wrote: >I have a sensor hooked to an input capture, the data I care about is >frequency. (DSPIC 30F4012, freq<3kHz if it matters) The input capture >trigers an interrupt every 16 pulses and I read a timer value. This works, >but it's not actualy measuring frequency, it measures period which is >1/frequency. The result is an exponential function when I wanted a linear >one. How have other people dealt with this? One way to measure frequency is...to measure the frequency. I'm not sure if any of the PIC counters can be gated by a timer, but interrupts and maybe even some cycle counting can get you pretty close. You clock the counter from your input signal and let the counter run for a specified time. You scale the count by changing the sampling time. Measuring period is more attractive at lower frequencies. As the frequency goes up, counting the frequency directly makes more sense. Depends on your application, how good a resolution you need and how often you need the answer. Barry -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist