Ok, here I am again.

Alain, I have a little problem with your measurement method.
For example, if I just verify the presence of high pulses
and measure low pulses, everything works just fine until
the phase shift in the signal occurs. Then my high pulse
becomes low pulse and vice versa. I really need to
measure both high and low pulses. The problem is that if
I use two consecutive PULSIN statements it doesn't work.
For example:

PULSIN Rx_Pin, 1, Pulse_Hi
PULSIN Rx_Pin, 0, Pulse_Lo

First PULSIN waits the rising edge and measures the
period that pin stays in that state, right? The second
PULSIN waits for the falling edge and repeats the process
for low pulse. Well I'm running my pic 16F628 @ 20MHz
and it seems to be missing the falling edge after
measuring Pulse_hi. Any ideas? Maybe if I used a
combination of PULSIN and RCTIME this might not happen?
If I understand the manual correctly RCTIME measures
the state of the pin right after the statement has been
issued in the program. That way the pic doesn't need to
detect the falling edge, right?

PS Is there a way to toggle between rising/falling edge in
a single PULSIN statement? For example:

Edge Var Bit
...
Edge = 0
IF Rx_Pin = 1 Then : Edge = 1
PULSIN Rx_Pin, Edge, Pulse