Decode Manchester on Arduino

Hello!

I have a remote control for a toy assembled on the PT8A995 microcircuit, according to the datasheet, at the output 8 of this microcircuit, namely from it, the data comes to the 27 MHz transmitter, the signal is encoded using Manchester.

Quote from the Datasheet
PT8A995 severs as an encoder. To obtain accurate timing easily, Manchester encoding is employed. Some digital modulation scheme can be used, e.g., general ASK,
OOK, FSK and QPSK. OOK is easy to implement and
low cost.

The signal should contain 4 channels: 2 proportional for gas and steering wheel control and 2 discrete for light control.

I tried to get data using a logic analyzer, but it didn't work very well, I have 3 repeating values ​​that change only after the gas or steering wheel have deviated by more than 50%. I admit that this is how the microcircuit itself works. In the logic analyzer I used BAUD 1500.

I also tried to use the arduino-libs-manchester library
I get some values ​​that are also repeated and change only when the steering wheel or gas is deflected by more than 50%. I admit that this is how the chip itself works. Also, after a while, the Arduino freezes and reboots, apparently due to a buffer overflow. In the library, I get data only if I use BAUD 2400.

This is the first time I encounter such a protocol, before I only used PPM and everything is simple and clear there.

I am trying to get data like
1 channel - from 0 to 255 or from 0 to 1024
2 channel - from 0 to 255 or from 0 to 1024
3 channel - 0 or 1
4 channel - 0 or 1

I would like to do the full decoding myself, but I have reached a dead end, since the Manchester protocol can be different, can have a different BAUD or start bit, etc. I also do not know if the signal contains something like payload or CRC. First, I would like to correctly configure the logic analyzer to get such data as the start bit and BAUD, and then transfer it all to the Arduino sketch.

Please tell me what further steps I can take? How can I correctly understand whether I set the start bit and BAUD correctly. Can I somehow determine all this in the logic analyzer? And how can I decrypt all this?

Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in https://forum.arduino.cc/c/using-arduino/uncategorized/184.

From Wikipedia..

Manchester code (also known as phase encoding , or PE ) is a line code in which the encoding of each data bit is either low then high, or high then low, for equal time. It is a self-clocking signal

As such,,it doesn’t have a ‘baud rate’, but rather, the timing of adjacent bits is used to determine the data bit timing for decoding.

there are examples out there, here is one

Use the analyzer at higher speed ( 1M sample/sec for example ), to acquire the waveform.
You should see two different bit length a half and a full, use the full to determine bit rate



I sampled 1MS/S and this is what I got

If you look, the data is shifted and repeated.
0x035C5103
0xF1035C5F
0xBF5F025D
0x03BF5103
0x5103BF5F
0xBF5F03BF
0x03BF5103
0x5103BF5F

According to my understanding, the full bit length is 766 uS, and half is 383 uS

What do I need to do next?

I should see the start of the Manchester code, since I turn on the remote and it starts transmitting.

The bit rate should be 1300 ( 1000000/766 )
If you have a saleae try adding an analyzer 'manchester' at 1300 baud ( to see if it works ) You already added, what bit rate did you use?
The arduino library I found does not support 1300bit/sec ( maybe it can be added, or use another library ), or you may try with 1200, not sure it will work

It seems to me that my settings are not quite correct.

It seems that there is another information block, like 1010 or 1111, could it be here?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.