Electronic – What kind of serial encoding is this

encodingmanchester-codingreverse-engineeringserial

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

Best Answer

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