Hi bigmac,
The NEC protocol is easy to decode, there are long pulses and short pulses. Measuring the width of the pulses, you can differ a 0 from a 1, even with a low precision in the measurement. I use TPMCNT for that and it is a good decoder, it never fails.
For ppm, the value of the bit comes from the position of the pulse. The protocol encodes every two bits in 4 bits, in the next way:
00 -> 1000
01 -> 0100
10 -> 0010
11 -> 0001
So, I could measure the distance between pulses, but it can vary a lot (between 0 and 7 positions) so I need a very high precision to detect the distance between pulses propertly. For example, next two sequences: 1000 0001 and 1000 0010, it's very easy to have a mistake, this is not a strong algorithm.
You can find attached a sample of the bitstream I am trying to decode.
Do you have any suggestion about how to face the problem?
Thanks and best regards.