I agree with Walter.
All this "Software Timed" stuff just doesn't work well together.
Everything, should be Interrupt driven.
Capture (CCP) the received pulses.
Use A/D interrupt to OverSample the Altitude. (oversampling does not have to be "Blocking")
Timer interrupt to drive the servo.
No PULSIN's, no PULSOUT's, no SHIFTIN/OUT.
These PIC chips are extremely fast. (As long as the program isn't sitting in a loop somewhere waisting 90% of it's time.)
And with the Hardware doing most of the work, they "Scream".
Even if you don't use Interrupts ... Use the hardware.
<br>
Bookmarks