Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

IR Codes: can you decipher this?

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
3 postsPage 1 of 1
3 postsPage 1 of 1

IR Codes: can you decipher this?

Post by inaki » Fri Aug 11, 2006 4:45 pm

Post by inaki
Fri Aug 11, 2006 4:45 pm

Here there are some codes sent by AXS1 sensor through IR leds.

There are 3 parts, each about 8 bits long. The first and second parts are bytes 0 and 1 in reverse order, sepparated by a 1 bit.

The picture shows the pattern for some data in the following order: 0,1,2,4,8,0x88,0x80,0x100,0x200.
As you see there are 16 bits of data, the low byte is in first place with bits in reverse order (LSB). Then a ONE bit, then the high byte.

After the two data bytes there are one additional byte that contains some sort of checksum or control byte. Are you able to decipher this byte ?

Deciphering the third byte it would be easy to send an IR code with any device to our Bioloid AXS1 sensor.

Note that although the first bytes seem straightformward to decipher the byte 0x88 is identical to the byte 8 except for the control byte.

Looking only at the first bytes (0 to 8, ) the encoding would be:

First bits always to zero
Bits 1 to 8 correspond to bits 0 to 7 of low byte (in revers order).
Then comes a bit that is always to 1.
Then comes the high byte, bits 0 to 7 (in reverse order).
Then a pattern of two bits that is always the binary value: 10
Then a pattern of 8 bits that is some sort of encoding or checksum and that might be (L XOR H)XOR 0xF8, except that it does not match the 0x88 code for example.

So the first two questions to solve are:

- Why 0x88 is equal to 8, except in the third byte ?
- What is the format of the third byte ?

Please note that high pulses are zero while blank or low pulses are 1.
Each data stream sent has a prefix code that is not shown in the picture because it is always the same.

Image
Here there are some codes sent by AXS1 sensor through IR leds.

There are 3 parts, each about 8 bits long. The first and second parts are bytes 0 and 1 in reverse order, sepparated by a 1 bit.

The picture shows the pattern for some data in the following order: 0,1,2,4,8,0x88,0x80,0x100,0x200.
As you see there are 16 bits of data, the low byte is in first place with bits in reverse order (LSB). Then a ONE bit, then the high byte.

After the two data bytes there are one additional byte that contains some sort of checksum or control byte. Are you able to decipher this byte ?

Deciphering the third byte it would be easy to send an IR code with any device to our Bioloid AXS1 sensor.

Note that although the first bytes seem straightformward to decipher the byte 0x88 is identical to the byte 8 except for the control byte.

Looking only at the first bytes (0 to 8, ) the encoding would be:

First bits always to zero
Bits 1 to 8 correspond to bits 0 to 7 of low byte (in revers order).
Then comes a bit that is always to 1.
Then comes the high byte, bits 0 to 7 (in reverse order).
Then a pattern of two bits that is always the binary value: 10
Then a pattern of 8 bits that is some sort of encoding or checksum and that might be (L XOR H)XOR 0xF8, except that it does not match the 0x88 code for example.

So the first two questions to solve are:

- Why 0x88 is equal to 8, except in the third byte ?
- What is the format of the third byte ?

Please note that high pulses are zero while blank or low pulses are 1.
Each data stream sent has a prefix code that is not shown in the picture because it is always the same.

Image
inaki
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 233
Joined: Sun Mar 06, 2005 1:00 am
Location: EH

Post by pakkua80 » Sat Aug 12, 2006 6:44 pm

Post by pakkua80
Sat Aug 12, 2006 6:44 pm

I can't make sense of it...
I can't make sense of it...
pakkua80
Robot Builder
Robot Builder
User avatar
Posts: 11
Joined: Fri Jun 23, 2006 1:00 am

Post by inaki » Sat Aug 19, 2006 4:34 pm

Post by inaki
Sat Aug 19, 2006 4:34 pm

Here there is the encoding I have found:

The signal is compossed of pulses of 800us each.
Base frequency or carrier is between 38-40Khz.

Ones are indicated by lack of carrier while zeroes are indicated by present carrier. That means that a zero is a sequence of a sinus wave of 40Khz that is ON for about 800us. A one is a lack of signal for about 800us.

Each data has 2 bytes (16 bits) of meaningful data, while actually there are 49 bits of data being sent. The structure is the following:

A header of 20 bits:

00101010110111111111

Followed immediately by the following data:

A starting bit, that is always zero
The low byte of data. BYTE 0. In LSB format. The highest bit is always zero (and is replicated in BYTE 2)
Follows a sequence of two bits: 10
The high byte of data. BYTE 1. In LSB format. The highest bit is always zero (and is replicated in BYTE 2)
Follows a sequence of two bits: 10
The third byte. BYTE 2. Or control byte. With the following fomat:

Low 4 bits are the inverted sum of low nibbles from BYTE 0 and BYTE 1.
For example if the sum is 1001 the result in this nibble is 0110.
High 4 bits of check byte, BYTE 2, are encoded as follows:
Bit 0 is the inverted 3th bit of the sum of (High Nibble of BYTE 0 + High Nibble of BYTE 1)
Bit 1 is the actual bit 7 of BYTE 1
Bit 2 is the actual bit 7 of BYTE 0
Bit 3 is always zero

Examples (20 bits header not shown):

Value BYTE 0 BYTE 1 BYTE 2
0000: 0 00000000 10 00000000 10 1111 1000
0001: 0 10000000 10 00000000 10 0111 1000
0002: 0 01000000 10 00000000 10 1011 1000
0003: 0 11000000 10 00000000 10 0011 1000
0004: 0 00100000 10 00000000 10 1101 1000
0008: 0 00010000 10 00000000 10 1110 1000
000F: 0 11110000 10 00000000 10 0000 1000
0010: 0 00001000 10 00000000 10 1111 0000
0020: 0 00000100 10 00000000 10 1111 1000
0040: 0 00000010 10 00000000 10 1111 1000
0055: 0 10101010 10 00000000 10 0101 0000
0080: 0 00000000 10 00000000 10 1111 1010
00AA: 0 01010100 10 00000000 10 1010 1010
00FF: 0 11111110 10 00000000 10 0000 0010
1000: 0 00000000 10 00001000 10 1111 0000
1010: 0 00001000 10 00001000 10 1111 1000
0100: 0 00000000 10 10000000 10 0111 1000
0101: 0 10000000 10 10000000 10 1011 1000
0200: 0 00000000 10 01000000 10 1011 1000
8000: 0 00000000 10 00000000 10 1111 1100
8080: 0 00000000 10 00000000 10 1111 1110
5555: 0 10101010 10 10101010 10 1010 1000
FFFF: 0 11111110 10 11111110 10 1000 0110
Here there is the encoding I have found:

The signal is compossed of pulses of 800us each.
Base frequency or carrier is between 38-40Khz.

Ones are indicated by lack of carrier while zeroes are indicated by present carrier. That means that a zero is a sequence of a sinus wave of 40Khz that is ON for about 800us. A one is a lack of signal for about 800us.

Each data has 2 bytes (16 bits) of meaningful data, while actually there are 49 bits of data being sent. The structure is the following:

A header of 20 bits:

00101010110111111111

Followed immediately by the following data:

A starting bit, that is always zero
The low byte of data. BYTE 0. In LSB format. The highest bit is always zero (and is replicated in BYTE 2)
Follows a sequence of two bits: 10
The high byte of data. BYTE 1. In LSB format. The highest bit is always zero (and is replicated in BYTE 2)
Follows a sequence of two bits: 10
The third byte. BYTE 2. Or control byte. With the following fomat:

Low 4 bits are the inverted sum of low nibbles from BYTE 0 and BYTE 1.
For example if the sum is 1001 the result in this nibble is 0110.
High 4 bits of check byte, BYTE 2, are encoded as follows:
Bit 0 is the inverted 3th bit of the sum of (High Nibble of BYTE 0 + High Nibble of BYTE 1)
Bit 1 is the actual bit 7 of BYTE 1
Bit 2 is the actual bit 7 of BYTE 0
Bit 3 is always zero

Examples (20 bits header not shown):

Value BYTE 0 BYTE 1 BYTE 2
0000: 0 00000000 10 00000000 10 1111 1000
0001: 0 10000000 10 00000000 10 0111 1000
0002: 0 01000000 10 00000000 10 1011 1000
0003: 0 11000000 10 00000000 10 0011 1000
0004: 0 00100000 10 00000000 10 1101 1000
0008: 0 00010000 10 00000000 10 1110 1000
000F: 0 11110000 10 00000000 10 0000 1000
0010: 0 00001000 10 00000000 10 1111 0000
0020: 0 00000100 10 00000000 10 1111 1000
0040: 0 00000010 10 00000000 10 1111 1000
0055: 0 10101010 10 00000000 10 0101 0000
0080: 0 00000000 10 00000000 10 1111 1010
00AA: 0 01010100 10 00000000 10 1010 1010
00FF: 0 11111110 10 00000000 10 0000 0010
1000: 0 00000000 10 00001000 10 1111 0000
1010: 0 00001000 10 00001000 10 1111 1000
0100: 0 00000000 10 10000000 10 0111 1000
0101: 0 10000000 10 10000000 10 1011 1000
0200: 0 00000000 10 01000000 10 1011 1000
8000: 0 00000000 10 00000000 10 1111 1100
8080: 0 00000000 10 00000000 10 1111 1110
5555: 0 10101010 10 10101010 10 1010 1000
FFFF: 0 11111110 10 11111110 10 1000 0110
inaki
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 233
Joined: Sun Mar 06, 2005 1:00 am
Location: EH


3 postsPage 1 of 1
3 postsPage 1 of 1