What I am trying to do is decode a 'Manchester coding' signal. The first 20 bits that are coming across are the header bits and I am going to use these to synchronise the frame size so that I can accurately decode the rest of the message. The sender can then alter the frequency and the decoder will compensate accordingly.
To do this I am timing the low and high pulses from the header and then setting variables indicating time limits...i.e. minimum pulse size = quarter a frame, maximum pulse size = 3/4 frame, maximum frame size = 1 1/4 frames. Based on these calculated variables I can then read the rest of the transmition.
To synchronise the header I am starting the Timer 1 and then when a transition occurs I read what the timer 1 value is and then reset the timer and wait for another transition. I allow 12 pulses to synchronise.
Cheers,
Craig