Strange binary sequence

Thread Starter

Markd77

Joined Sep 7, 2009
2,806
Has anyone seen this sequence before? It seems like a gray code in that only one bit changes at a time. It comes from the IR transmitter for a micro helicopter and I've called the long pulses 1 and the short pulses 0. I've put the first pulse first. Either of these things could be reversed from what the designer intended.
I'm going to use a lookup to convert it to usable numbers so the answer isn't vital, but it would be nice to know what it is and why it would be used.

Rich (BB code):
throttle 0-full
0100
0000
0001
0101
0111
0011
1011
1001
1101
1100
1000
1010
0010
1010
1110

rudder left-right
011
001
101
100
110
010
000
 

DonQ

Joined May 6, 2009
321
I did a few steps and it looks like if you invert the bits, and then rearrange the bit order, it may very well be as Gray code is defined.

Start with the 0000, invert it to 1111 and then work sequentially through the values. I didn't do all the values, but the part I did do seemed right.
 

Thread Starter

Markd77

Joined Sep 7, 2009
2,806
I got curious so I opened up the transmitter - it wasn't pretty. It's got a couple of PCBs for the control sticks with copper tracks and wipers for a rotary encoder. There's a mystery unmarked 18 pin DIP chip in there.
The need for some kind of code that only changes one bit at a time is now obvious. Maybe the order is just to make the PCB simpler.
 

DonQ

Joined May 6, 2009
321
Maybe it's not the 'official' Gray code, but it does have the same effect. So probably the easiest way to decode it is a lookup table as you say.

Often 'inventers' re-invent the wheel, so to speak.

I've seen redefinitions of things as standardized as RS-232 pinouts, usually justified by "Well... It works!" I have even seen rearranging the bit-order in the serial stream so that the bits were no longer even sequential. His receiver worked the same way so it 'worked', on his system, but nowhere else on the planet! I think this version of Gray code may have come from the same guy:D
 
Top