Serial Cable Details

Lego's serial IR Tower uses a DB-9 male connector (identical to those used in the PC world). The IR tower does not use all 9 pins - it only requires GND, TXD, and RXD. In addition, it internally shorts RTS and CTS together. The handshake lines are used by Mindstorms RIS to determine if the IR tower is connected, but they are ignored by Robolab and NQC.

In order to use the cable supplied by LEGO with a Macintosh, you need an adapter to convert the Mac's Mini-8 DIN into a DB-9. Another option is to use a Mac to RS-232 cable (sometimes called a modem cable) along with a DB-25 to DB-9 adapter. (One of these adapters came in my Mindstorms set even though the box indicated otherwise.)

Mac Mini-8 DIN pin numbering

  8 7 6          6 7 8
 5   4 3        3 4   5
   2 1            1 2
      
  Jack           Plug
  (Mac)          (cable)

These are the views looking at the outside of a Mini-8 jack and plug, respectively. Note the extra space between pins 4 and 5 (this is how you can make sure you haven't flipped right/left).

Pin functions:
1  Hsk0   Handshake output, normally connected to RTS
2  HskI   Handshake input, typically CTS
3  TxD-   part of the Tx data pair
4  Ground
5  RxD-   part of the Rx data pair
6  TxD+   part of the Tx data pair
7  no connect
8  RxD+   part of the Rx data pair

The mac uses RS-422, which relies on a differential voltage for data transmission, unlike RS-232 which uses a line level. Its not too difficult to make RS-422 look like RS-232. You can do this by Grounding RxD+ and leaving TxD+ unconnected. Then RxD- and TxD- work very similar to RS-232 RX and TX. The handshake lines (HskO, HskI) aren't required for using Robolab or NQC with the IR tower, but are required when running original Mindstorms software under VPC 3.0 without one of the special patches.

A DB-9 (RS-232) connector has the following numbering

1 2 3 4 5    5 4 3 2 1
 6 7 8 9      9 8 7 6
  (male)     (female)

1 DCD
2 RX
3 TX
4 DTR
5 GND
6 DSR
7 RTS
8 CTS
9 RI

Only RX, TX, and GND are required for data communication. RTS and CTS are used for handshake with the IR tower.

Here's how you'd wire a mac to DB-9 converter:

Mini-8 plug   DB-9 Male    DB-9 Female
3  TxD-       3 TX         2 RX
4  Ground     5 GND        5 GND
5  RxD-       2 RX         3 TX
8  RxD+       5 GND        5 GND

1  Hsk0       7 RTS        8 CTS  (optional)
2  HskI       8 CTS        7 RTS  (optional)

Pins 6, and 7 on the Mini-8 plug are left unconnected. Pins 1 and 2 may also be left unconnected when using Robolab or NQC.

The cable supplied by LEGO is actually a null-modem cable (which swaps TX/RX and also RTS/CTS). As a result, you need to wire the mac cable differently depending on if you plan on connecting the mac cable directly to the IR tower, or connecting the mac cable to the LEGO cable to the IR tower. The column titled "DB-9 Male" is appropriate for a cable that attaches to the LEGO cable. The column titled "DB-9 Female" is appropriate for a cable that connected directly to the IR tower.


 [Dave's Lego Site]