hi,
I have spent quite some time deciphering Tutorial 12.3_R of Nigel's Tutorials on RF Manchester Encoding.
I drew up a flowchart 5 pages long for the code to get a clearer idea of how the reception of the byte packet is done and I would like to verify whether the conclusions that I have come up with are correct.
1)At label pointer s16, Bits 1 and 0 of the variable register 'flag' denote the Manchester encoded bit. e.g. [flag]=b'xxxxxx01' represents a bit 1 while [flag]b'xxxxxx10' represents bit 0.
2) The very first pulse detection in the received packet stream is the first bit'1' of the header. This is followed by an anticipation of another 16 bit '1's totalling 17 bit 1's and a final bit '0' at the end of the header section.
3)(Assuming the receiver is still receiving the header section) At each cycle from s7 to a loop back again to s7, flags 1 and 0 each are inverted once. As they have been initiated complementing each other. There will never be a time where the logic of flags,1 will be equal to the logic of flags,2 .. Correct?
4) when btcnt is initialized to receive 3 packets. The 3 packets are for the address, data byte and checksum?
I roughly get how the decoding process works but I'm still not very sure. Code deciphering gets pretty complicated when it's well...complicated (for my level
) I hope that someone could post a few general key points on how the decoding is done so that I can decipher the code with the correct direction in mind..based on a general guiding pointers.
Thanks!=)