EmbeddedRelated.com
Forums

Re: PIC Input Capture

Started by Gary Kato January 27, 2004
Forgot. You should also disable interrupts while calculating your pulse with
and pulse interval since the values you are using can change at any time if you
don't. If you don't, you'd still get weird values. Say  this happens:

MOVF    low(fall),w
<CCP2 int happens here>
SUBWF  low(last_fall),w

You'd get an interval of 0 once more.

Thanks for your help, I'm getting better results by dis/ena interupts, but
how do I reset the Timer1 value, so that I can get more consistent
(synchronous) results?
TIA


"Gary Kato" <garykato@aol.com> wrote in message
news:20040127135636.20507.00000486@mb-m21.aol.com...
> Forgot. You should also disable interrupts while calculating your pulse
with
> and pulse interval since the values you are using can change at any time
if you
> don't. If you don't, you'd still get weird values. Say this happens: > > MOVF low(fall),w > <CCP2 int happens here> > SUBWF low(last_fall),w > > You'd get an interval of 0 once more. >