1
\$\begingroup\$

I'm involved in some reverse engineering of a device I need to interface with. With what little I know, and being able to capture a single data transmission, I think I've narrowed down the encoding method. I suspect it might be a custom or obscure method because I can't find anything that matches what appears to be happening here.

At first I thought it might be a form of Manchester/Bi-Phase encoding, but any examples I've seen show transitions both rising and falling. I have only falling transitions, and transitions between bits can be rising or falling.

Here's how the bit stream begins:

enter image description here

I have to assume that there are either some start or stop bits (maybe both) because the number of data bits I expect doesn't match how many bit frames I see overall. The difference is in the low single digits and number of expected bits is in the high double digits. I don't think the number is relevant to this discussion. I only mention this because it corroborates my framing of the bits.

Somewhere in the middle of the stream I snipped this section to show where I'm marking each bit frame and what's happening along the way (scale is same as above):

enter image description here

I've marked an arrow on each transition I believe to be the start of a bit frame. I suspect that no transition mid-frame is one logic level and a falling transition is the other level. Though I've marked up the image with 1's and 0's, it could just as easily be inverted.

Has anyone seen this type of serial encoding before? Does it have a name? How likely is it I'm making a mistake with my interpretation?

EDIT 1: I can probably figure this part out, but if you've successfully decoded something like this in software (low level firmware) I'm interested in hearing about your solution.

EDIT 2: The repeating bit pattern in the marked-up image is coincidental. Below is another section of the bit stream to illustrate this more clearly. I would post the entire thing, but for technical reasons I can't do that right now.

enter image description here

\$\endgroup\$
14
  • \$\begingroup\$ So.... is there a clock or just this one signal? \$\endgroup\$
    – user57037
    Commented Apr 13, 2020 at 4:13
  • \$\begingroup\$ Looks like there are three cases. 100% high time, about 33% high time and 0% high time. So maybe it is a three-level pulse-width modulation scheme with constant symbol rate of one symbol per period. I don't see how you can reverse engineer it without capturing a stream of known value. At least not easily. \$\endgroup\$
    – user57037
    Commented Apr 13, 2020 at 4:18
  • \$\begingroup\$ @mkeith No additional clock. This is it. \$\endgroup\$
    – Sparky961
    Commented Apr 13, 2020 at 4:23
  • \$\begingroup\$ @Sparky961 You can see the self-clocking in the diagram you show. \$\endgroup\$
    – jonk
    Commented Apr 13, 2020 at 6:05
  • \$\begingroup\$ @jonk That's what I had thought too. I'm not too concerned about the "extra" transition mid-frame in terms of decoding it. I just want some reassurance that I'm looking at this the right way. \$\endgroup\$
    – Sparky961
    Commented Apr 13, 2020 at 6:21

1 Answer 1

1
\$\begingroup\$

I'm seeing what looks like a variable rate code where a 1 is a long pulse and a long rest and a 0 is a short pulse and a short-ish rest.

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ I might be willing to consider this if you explained your reasoning. Otherwise your answer makes me think you didn't read the question. \$\endgroup\$
    – Sparky961
    Commented Apr 13, 2020 at 6:27
  • \$\begingroup\$ Ok, I see where you're going with this now. Let me see if decoding it like this would make any sense. \$\endgroup\$
    – Sparky961
    Commented Apr 13, 2020 at 7:53
  • \$\begingroup\$ The idea is appealing, and there's definitely a logical symmetry to it. But if I decode it using this technique then I only get 70% of the number of bits I expect to be there. I'm not prepared to accept or reject the idea until I can do some more testing with different data. Is there perhaps a name for this encoding technique so that I could look into it further? \$\endgroup\$
    – Sparky961
    Commented Apr 13, 2020 at 10:02
  • \$\begingroup\$ I'm not aware of any name, it like morse and like one-wire but isn't an exact match for either. \$\endgroup\$ Commented Apr 14, 2020 at 5:37
  • \$\begingroup\$ Although this doesn't completely answer my question, it has pointed me in a direction I wouldn't have otherwise gone and thus has helped greatly. I think what I might be looking at, and what I'm going to try decoding more with is something similar to J1850 PWM, or less likely VPWM. Here's a page with lots of pictures but is short on description: cnblogs.com/shangdawei/p/4769620.html \$\endgroup\$
    – Sparky961
    Commented Apr 17, 2020 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.