FredericG Heliman Location: Belgium
| | Quote |
| Angelos, I completely understand your position and I don't mind if you don't tell us anything
|
I feel the same way. You should not feel guilty at all not telling us anything. Everything you say can and will be used to ... crack the protocol.
I scanned the bbs of the SmartPropo project and here the developer discusses some of the code:
| Quote |
|
I have not completed the analysis about the error correction code when I wrote
the program. But now I know almost all about the PCM1024 signal.
Every 24bits data contains 2bits of auxilialy data, 4bits of difference data, 10bits of
position data, and 8 bits of error correcting data. Hence, acutual correction code is
((data[2] << 6) | data[3]) & 0xFF, not data[3].
This code is related to first 16bits, and is generated by this function;
--------
int dat = (data[0] << 10) | (data[1] << 4) | ((data[2] >> 2) & 0x0F);
int ecc = ((data[2] << 6) | data[3]) & 0xFF;
int matrix[16] = {
0x6B, 0xD6, 0xC7, 0xE5,
0xA1, 0x29, 0x52, 0xA4,
0x23, 0x46, 0x8C, 0x73,
0xE6, 0xA7, 0x25, 0x4A
};
for (int k = 0; k < 16; k++) {
if (dat & (1 << k)) ecc ^= matrix[k];
}
--------
If you just want to check the error, you can simply check "ecc". When it is zero, "dat"
may be true. If "ecc" is not zero, for example, if it is 0xA1, please compare the "ecc"
with every elements of "matrix". In this case, 5th bit may be wrong. For the further
error correcting, please refer the technical book about the coding theory.
> Another question is , base on your code , your can get 8 channel value. But my
> tansmitter is T9Z a 9 channel R/C system. How the chnnel 9 work???
The 9th channel is not proportional channel, it is switch channel (it consists of only
"on" and "off"). This data is transmitted on the 18th bit of every frame.
|
I am a bit surprised about this. If I am not mistaken, I have read several times that PCM1024 just uses a CRC at the end of the frame for error checking and does not contain any redundant information for error correction.
Frederic |