Re: Software question: Capturing a servo PPM using a PIC24FJ64GA002...

On Mar 18, 8:47 am, Andrew Smallshaw <andr...@xxxxxxxxxxxxxxxx> wrote:
On 2008-03-18, Andrew Smallshaw <andr...@xxxxxxxxxxxxxxxx> wrote:

If it is low then you have the falling edge. Copy the timer into
another variable fallTime. Subtract fallTime from riseTime to give
the pulse duration.

Subtract riseTime from fallTime...

Andrew Smallshaw

Thank you very much. Like you said in your response, I was caught up
in the whole concept of using the "input capture" peripheral and I was
blinded to the much simpler solution of using a free-running timer and
just looking at the timer values every-time the internal comparator
switched state. I already had 2 comparators sitting there and didnt
even realize it!! This solved my software problem (timing and
interrupts) and also my hardware problem (undetermined voltage levels
due to battery sag). It worked great. Thank you.