Old RCX Tools



Old RCX Tools [top]

This section of RCX Internals contains old versions of tools I used to make available at RCX Tools.

Copyright © 1998 Kekoa Proudfoot. All rights reserved.

Send.0 [top]

A program to send a message to the RCX and dump the response as hex. Requires unencoded message bytes on the command line, i.e. no packet header, checksum, or complements. The response contains all the bytes received by the IR tower, including echoed bytes, packet headers, checksums, and complement bytes.

Below is an example, where an alive is sent and its response received. Two packets are received from the IR tower. The first, which contains 0x10, is the one I sent; the second, which contains 0xef, is the reply from the RCX.

1% send 10
0000: 55 ff 00 10  ef 10 ef 55  ff 00 ef 10  ef 10         U......U......

Here, I download a program to the RCX in three steps. The first step uses set program number to set the current program to 4, which appears as 5 on the display. Next, start task download is used to initiate a transfer of task number 0. Finally, transfer data is used to send a short program that plays two beeps then waits forever. This program makes use of two opcodes, play sound and branch always near. The latter loops back onto itself. To start the program, hit the run key on the RCX. To stop the program, press the run key again.

2% send 91 04
0000: 55 ff 00 91  6e 04 fb 95  6a 55 ff 00  6e 91 6e 91   U...n...jU..n.n.
3% send 25 00 00 00 04 00
0000: 55 ff 00 25  da 00 ff 00  ff 00 ff 04  fb 00 ff 29   U..%...........)
0010: d6 55 ff 00  da 25 00 ff  da 25                      .U...%...%
4% send 45 00 00 04 00 51 01 27 81 00
0000: 55 ff 00 45  ba 00 ff 00  ff 04 fb 00  ff 51 ae 01   U..E.........Q..
0010: fe 27 d8 81  7e 00 ff 43  bc 55 ff 00  ba 45 00 ff   .'..~..C.U...E..
0020: ba 45                                                .E

The trick to using this tool is to make sure you see a pair of 0x55 0xff 0x00 packet headers in the response following each message you send. If you don't see two packet headers, chances are either your message was formatted incorrectly or the communications link was flaky. In the latter case, retrying the send several times in quick succession usually warms up the link enough to get a proper response.

Be wary of sequence bit problems. If the opcode you want to send now is the same as the last opcode acknowledged by the RCX, you have to toggle the 0x08 bit for the opcode to be accepted again.

send.0.c


Copyright © 1998 Kekoa Proudfoot. All rights reserved. kekoa@graphics.stanford.edu