(Findings by Anders Isaksson)
I recently (May 2002) bought the Lego DACTA sets 9701 and 9702, with accompanying computer interface. Those sets are the precursor to the modern CyberMaster and Mindstorms sets, but still quite capable.
The software with the package, TechnoLogica, is nice, but of course very limited, so I just had to roll my own (I'm using Borland Delphi 5.0).
This is a work in progress, still in it's very infancy, but I'll publish it anyway.
There's nothing new on the outside, but the inside is completely reworked! The interface is now encapsulated in an object, with methods for most output commands, and properties for the inputs.
I've also added a zipped .exe, as not everybody have the Delphi compiler.
v03.zip | Delphi source files - 15kB |
BrickLab.zip | Windows executable - 196kB |
I gave the project a name, BrickLab, and have managed to make the communication much more stable. Now I can pull out the serial cable, and put it back, and everything just continues to work.
Of course, a sent command which gets broken may get you into trouble, but you don't have any problems reading in data.
The checksum is also used, and a input block with the wrong checksum is ignored.
V01 - zipped archive with Delphi source. Have fun!I have spied on the serial port (with PortMon from www.sysinternals.com) while running the TechnoLogica software, and here are my findings (combined with Andrew Carol's findings from 1994):
Updated 2002-05-23 o = outputs, one bit for each p = output, number P = output, 8+number s = power, 0..7 meaning 1..8 t = time value, 01..FF (1/10 seconds) x = don't care 0x 0000xxxx NOP? (02 used as 'Keep alive', but anything goes) 1p 00010ppp Turn on, direction left 1P 00011ppp Turn on, direction right 2p 00100ppp Reverse direction of output port. 2P 00101ppp Turn output port on, don't change direction. 3p 00110ppp Turn output port off. 3P 00111ppp Turn output port off. 4p 01000ppp Set direction of output port left. 4P 01001ppp Set direction of output port right. 5x NOP? 6x NOP? 7x 0111xxxx Turn off the interface (need new connect) 80 oo 1000xxx0 oooooooo Turn off, set steady mode 81 oo 1000xxx1 oooooooo Set flashing mode (See E8, E0) 90 oo 1001x000 oooooooo Turn off 91 oo 1001x001 oooooooo Turn on 92 oo 1001x010 oooooooo Power level 0 93 oo 1001x011 oooooooo Left 94 oo 1001x100 oooooooo Right 95 oo 1001x101 oooooooo Reverse 96 oo NOP? 97 oo NOP? A0..AF NOP? Bs oo 10110sss oooooooo Power setting Cp tt 1100xppp tttttttt Turn on for time D0..DF NOP? EP tt 11101ppp tttttttt On cycle Ep tt 11100ppp tttttttt Off cycle F0 tt 11110000 tttttttt Seems to flash Out2 once after a delay?? Examples from TechnoLogica: 80 01 91 01 On 90 01 Off 91 01 E8 01 E0 01 81 01 Blink fastest 91 01 E8 05 E0 05 81 01 Blink slowest (for that software) |
I did a Google search for 'dacta interface' and found some information out there, but not very much. The two most interesting were:
These were my main sources of information both for the communication, and the command codes, the sensor values etc:
From:Andy Carol (carol@edfua0.ctis.af.mil) Subject:New LEGO Robotic notes Newsgroups:rec.toys.lego View this article only Date:1994-02-01 05:45:08 PST Notes for the LEGO Computer Lab interface box. I made a post some weeks ago with information on the protocol used by the LEGO Computer Lab interface box as sold by LEGO Dacta. Here are newer versions of my notes and some corrected information. If anybody has any questions, please feel free to contact me. My software has gone into Beta and I will upload it to the FTP site as soon as I can. Requirements to use my software: Macintosh computer. LEGO Computer Control Lab box (with serial interface) My software Symatantic C 6.01. (Think C 5.0 should also work) I would like to see my stuff run on a PC. It would be very benificial if the API (Interface) stayed the same. If you want to port it, please keep in touch with me and keep the programmer interface the same. This will allow improvements to benifit everybody. --------------------------------------------------------------------- Set up computer with: 9600bps, no parity, 1 stop bit --------------------------------------------------------------------- How to start the interface box: Send: p\0 <- This is the letter 'p' and a null character. Box will send back various copyright things. Then send: ###Do you byte, when I knock?$$$ Box will send back: ###Just a bit off the block!$$$ --------------------------------------------------------------------- Software should send alives (0x02) every two seconds. They need not be sent as long as commands are being issued at least every two seconds. However it may be easier to just send alives regardless of commands being sent. --------------------------------------------------------------------- Ouptut ports on the box are labled as A - H. They will be refered to as output ports 0 - 7 here. Input ports on the box are labled as 1 - 8. They will be refered to as input ports 0 - 7 here. --------------------------------------------------------------------- Most commands are one or two bytes in length. They will be given below in binary. Some commands are many bytes in length. The commands listed below are the LOGO commands as described in the Control Lab book. All ports have three independant states: 1) Enable on/off 2) Power level 0 - 8 3) Direction left/right Power level of 0 stops the output. You can change the direction of the motor while it is running or stopped. You could set the power level (speed) of a motor, then the direction, then turn it on. Etc, etc... Commands to be sent to box: mmmmmmmm = Mask of upto eight output ports. Least significant bit is port zero. Most significant bit is port seven. ppp = Selection of single input or output port. nnn = Power level (offset by 1). This will be one less than the actual power level. 0 = power level 1. 1 = power level 2. ... 7 = power level 8. <--on--> = duration of ON in 1/10th seconds. <--off-> = duration of OFF in 1/10th seconds. < break > = break signal Single Port Commands -------------------- rd (reverse) 00100ppp Reverse direction of output port. on 00101ppp Turn ouput port on. off 00111ppp Turn output port off. setleft 01000ppp Set direction of output port left. setright 01001ppp Set direction of output port right. MultiPort Commands ------------------ off 10010000 mmmmmmmm Turn output ports off. on 10010001 mmmmmmmm Turn output ports on. setpower 0 10010010 mmmmmmmm Set output ports to power level 0. setright 10010011 mmmmmmmm Set direction of output ports right. setleft 10010100 mmmmmmmm Set direction of output ports left. rd (reverse) 10010101 mmmmmmmm Reverse direction of output ports. setpower n+1 10110nnn mmmmmmmm Set powerlevel of output ports. flash 11101ppp <--on--> 11100ppp <--off-> <- repeat for each port. 10110001 mmmmmmmm Set power level? NEEDS MORE STUDY. 10010001 mmmmmmmm Turn them on alloff 10010000 < break > Turn all ports off. ----------------------------------------------------------------------------- Frames sent by interface box. About 50 a second. 19 bytes 00 00 |