Difference between revisions of "Interprocessor (51-51d) protocol FAQ"
Jump to navigation
Jump to search
(Work in progress, adding more info on protocol) |
|||
Line 4: | Line 4: | ||
Here is what we know so far about the communications protocol: |
Here is what we know so far about the communications protocol: |
||
+ | |||
+ | Last byte of multi-byte strings is a checksum that appears to be calculated by (0xff - Byte1 - Bytes[1+] + 0x01) |
||
+ | |||
+ | Obtained from strace at http://downloads.phathack.com/sbingner/strace-51d.log |
||
+ | |||
+ | == Suspected Definitions == |
||
+ | |||
+ | #define ACK 0xce |
||
+ | #define ASCII_FOLLOWS 0x50 |
||
+ | #define CONTINUE 0xbd |
||
+ | #define ACK_CONTINUE 0xac |
||
+ | #define QUERY_NUM_DISKS 0x21 |
||
+ | #define QUERY_NUM_TRACKS 0x20 |
||
+ | #define QUERY_DISK_NAME 0x57 |
||
+ | #define QUERY_TRACK_NAME 0x56 |
||
+ | #define PLAY_TRACK 0x30 |
||
+ | #define PING 0x66 |
||
+ | #define PONG 0x70 |
||
+ | |||
+ | == Protocol Examples == |
||
+ | |||
+ | ASCII Text is sent 12 Bytes at a time, in multiple 'packets' |
||
<table width="100%" border=1> |
<table width="100%" border=1> |
||
Line 11: | Line 33: | ||
<th width="80%">Possible Meaning</th> |
<th width="80%">Possible Meaning</th> |
||
</tr> |
</tr> |
||
− | <tr>< |
+ | <tr><th colspan=3><center>Initialization</center></td></tr> |
<tr><td>0xf9</td><td> </td><td>??</td></tr> |
<tr><td>0xf9</td><td> </td><td>??</td></tr> |
||
<tr><td> </td><td>0x53</td><td>??</td></tr> |
<tr><td> </td><td>0x53</td><td>??</td></tr> |
||
<tr><td>0x10</td><td> </td><td>??</td></tr> |
<tr><td>0x10</td><td> </td><td>??</td></tr> |
||
<tr><td> </td><td>0x21</td><td>??</td></tr> |
<tr><td> </td><td>0x21</td><td>??</td></tr> |
||
− | <tr>< |
+ | <tr><th colspan=3><center>HU Query total disc</center></td></tr> |
<tr><td> </td><td>0x21,0xdf</td><td>Query total disc</td></tr> |
<tr><td> </td><td>0x21,0xdf</td><td>Query total disc</td></tr> |
||
<tr><td>0xce</td><td> </td><td>ACK</td></tr> |
<tr><td>0xce</td><td> </td><td>ACK</td></tr> |
||
− | <tr><td> |
+ | <tr><td>0x7d</td><td> </td><td>Total Disks follows</td></tr> |
− | <tr><td> </td><td>0xac</td><td> |
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
<tr><td>0x00</td><td> </td><td>First byte</td></tr> |
<tr><td>0x00</td><td> </td><td>First byte</td></tr> |
||
<tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
<tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
Line 27: | Line 49: | ||
<tr><td>0x74</td><td> </td><td>End of Stream</td></tr> |
<tr><td>0x74</td><td> </td><td>End of Stream</td></tr> |
||
<tr><td> </td><td>0xce</td><td>ACK</td></tr> |
<tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
− | <tr>< |
+ | <tr><th colspan=3><center>HU Query total tracks</center></td></tr> |
<tr><td> </td><td>0x20,0x00,0x01,0xdf</td><td>Query total tracks in disc 1 (0x00, 0x01)</td></tr> |
<tr><td> </td><td>0x20,0x00,0x01,0xdf</td><td>Query total tracks in disc 1 (0x00, 0x01)</td></tr> |
||
− | <tr><td |
+ | <tr><td>0xce</td><td> </td><td>ACK</td></tr> |
+ | <tr><td>0x7c</td><td> </td><td>Total tracks follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>First byte of total tracks</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Second Byte of total tracks (1 track in disk 1)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>First byte of disknum</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Second Byte of disknum</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x82</td><td> </td><td>End of Stream</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><th colspan=3><center>Direct play track</center></td></tr> |
||
+ | <tr><td> </td><td>0x30 0x00 0x01 0x00 0x02 0x00 0x00 0xcd</td><td>Play Disk 2 Track 1 Offset 0</td></tr> |
||
+ | <tr><td>0xce</td><td> </td><td>ACK</td></tr> |
||
+ | <tr><th colspan=3><center>HU ? Name of Disk</center></td></tr> |
||
+ | <tr><td> </td><td>0x57,0x00,0x02,0xa7</td><td>Name of disk 2? (Answering "PLY2: Alternative")</td></tr> |
||
+ | <tr><td>0xce</td><td> </td><td>ACK</td></tr> |
||
+ | <tr><td>0x50</td><td> </td><td>ACSII Follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>Type of Text (0x00 = Disk Name)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>Packet Number</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>P</td><td> </td><td>ASCII Text</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeats for each of the letters 'LY2: Altern'</td></tr> |
||
+ | <tr><td>0xc9</td><td> </td><td>Checksum?</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><td>0x50</td><td> </td><td>ACSII Follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>Type of Text (0x00 = Disk Name)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Packet Number</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>a</td><td> </td><td>ASCII Text</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeats for each of the letters 'tive'</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>NULL</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeat 6 more times</td></tr> |
||
+ | <tr><td>0x96</td><td> </td><td>Checksum?</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><th colspan=3><center>HU ? Name of Track</center></td></tr> |
||
+ | <tr><td> </td><td>0x56,0x00,0x01,0x00,0x02,0xa7</td><td>Name of disk 2, track 1? (returning "3 Doors Down - ")</td></tr> |
||
+ | <tr><td>0xce</td><td> </td><td>ACK</td></tr> |
||
+ | <tr><td>0x50</td><td> </td><td>ACSII Follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Type of Text (0x01 = Track Name)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>Packet Number</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>3</td><td> </td><td>ASCII Text</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeats for each of the letters ' Doors Down'</td></tr> |
||
+ | <tr><td>0x9d</td><td> </td><td>Checksum?</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><td>0x50</td><td> </td><td>ACSII Follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Type of Text (0x01 = Track Name)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Packet Number</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x20</td><td> </td><td>ASCII Text (space)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeats for each of the letters ' - Duck And '</td></tr> |
||
+ | <tr><td>0x67</td><td> </td><td>Checksum?</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><td>0x50</td><td> </td><td>ACSII Follows</td></tr> |
||
+ | <tr><td> </td><td>0xac</td><td>OK, Continue</td></tr> |
||
+ | <tr><td>0x01</td><td> </td><td>Type of Text (0x01 = Track Name)</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x02</td><td> </td><td>Packet Number</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>R</td><td> </td><td>ASCII Text</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td colspan=3>Above 2 lines repeats for each of the letters 'Run (Live)'</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>NULL</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x00</td><td> </td><td>NULL</td></tr> |
||
+ | <tr><td> </td><td>0xbd</td><td>Continue</td></tr> |
||
+ | <tr><td>0x77</td><td> </td><td>Checksum?</td></tr> |
||
+ | <tr><td> </td><td>0xce</td><td>ACK</td></tr> |
||
+ | <tr><th colspan=3><center>8052 Ping Request</center></td></tr> |
||
<tr><td> </td><td>0x66, 0x9a</td><td>8052 PING</td></tr> |
<tr><td> </td><td>0x66, 0x9a</td><td>8052 PING</td></tr> |
||
<tr><td>0xce</td><td> </td><td>ACK</td></tr> |
<tr><td>0xce</td><td> </td><td>ACK</td></tr> |
Revision as of 18:18, 1 July 2005
The 51d program running on the 7312 and the Winbond '51 chip communicate over /dev/ttyS1 at 115200 bps.
Here is what we know so far about the communications protocol:
Last byte of multi-byte strings is a checksum that appears to be calculated by (0xff - Byte1 - Bytes[1+] + 0x01)
Obtained from strace at http://downloads.phathack.com/sbingner/strace-51d.log
Suspected Definitions
#define ACK 0xce #define ASCII_FOLLOWS 0x50 #define CONTINUE 0xbd #define ACK_CONTINUE 0xac #define QUERY_NUM_DISKS 0x21 #define QUERY_NUM_TRACKS 0x20 #define QUERY_DISK_NAME 0x57 #define QUERY_TRACK_NAME 0x56 #define PLAY_TRACK 0x30 #define PING 0x66 #define PONG 0x70
Protocol Examples
ASCII Text is sent 12 Bytes at a time, in multiple 'packets'
7312 | 8052 | Possible Meaning |
---|---|---|
0xf9 | ?? | |
0x53 | ?? | |
0x10 | ?? | |
0x21 | ?? | |
0x21,0xdf | Query total disc | |
0xce | ACK | |
0x7d | Total Disks follows | |
0xac | OK, Continue | |
0x00 | First byte | |
0xbd | Continue | |
0x0f | Second Byte (total 15 disks) | |
0xbd | Continue | |
0x74 | End of Stream | |
0xce | ACK | |
0x20,0x00,0x01,0xdf | Query total tracks in disc 1 (0x00, 0x01) | |
0xce | ACK | |
0x7c | Total tracks follows | |
0xac | OK, Continue | |
0x00 | First byte of total tracks | |
0xbd | Continue | |
0x01 | Second Byte of total tracks (1 track in disk 1) | |
0xbd | Continue | |
0x00 | First byte of disknum | |
0xbd | Continue | |
0x01 | Second Byte of disknum | |
0xbd | Continue | |
0x82 | End of Stream | |
0xce | ACK | |
0x30 0x00 0x01 0x00 0x02 0x00 0x00 0xcd | Play Disk 2 Track 1 Offset 0 | |
0xce | ACK | |
0x57,0x00,0x02,0xa7 | Name of disk 2? (Answering "PLY2: Alternative") | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x00 | Type of Text (0x00 = Disk Name) | |
0xbd | Continue | |
0x00 | Packet Number | |
0xbd | Continue | |
P | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'LY2: Altern' | ||
0xc9 | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x00 | Type of Text (0x00 = Disk Name) | |
0xbd | Continue | |
0x01 | Packet Number | |
0xbd | Continue | |
a | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'tive' | ||
0x00 | NULL | |
0xbd | Continue | |
Above 2 lines repeat 6 more times | ||
0x96 | Checksum? | |
0xce | ACK | |
0x56,0x00,0x01,0x00,0x02,0xa7 | Name of disk 2, track 1? (returning "3 Doors Down - ") | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x00 | Packet Number | |
0xbd | Continue | |
3 | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters ' Doors Down' | ||
0x9d | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x01 | Packet Number | |
0xbd | Continue | |
0x20 | ASCII Text (space) | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters ' - Duck And ' | ||
0x67 | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x02 | Packet Number | |
0xbd | Continue | |
R | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'Run (Live)' | ||
0x00 | NULL | |
0xbd | Continue | |
0x00 | NULL | |
0xbd | Continue | |
0x77 | Checksum? | |
0xce | ACK | |
0x66, 0x9a | 8052 PING | |
0xce | ACK | |
0x70 | 51d PONG | |
0xce | ACK | |
- Heartbeat:
If the Winbond chip does not see a "heartbeat" signal every 10 seconds, it will kill power to the 7312 and reboot it. It's a two-part sequence:
7312 > 0x70 0xAC < 51 > 0x90 0xCE < 51
Must repeat within 10 seconds, or the Winbond chip will output 0x66,0x9A 3 times and reboot.