To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 3237
3236  |  3238
Subject: 
Re: Communicating with Cybermaster not easy
Newsgroups: 
lugnet.robotics
Date: 
Tue, 26 Jan 1999 10:43:45 GMT
Original-From: 
Peter Ljungstrand <peter@informatik/Spamcake/.gu.se>
Viewed: 
1451 times
  
Again: The low-level packet headers are _not_ the same for the RCX and the
CyberMaster.
(See http://graphics.stanford.edu/~kekoa/rcx/protocol.html for the RCX
details)

This is the CyberMaster settings:
The serial port should have the same settings as was for the RCX, as
originally described by Dave Baum:
2400 baud, 1 start bit, 8 data bits, odd parity, 1 stop bit.

Each data package (from the PC to the CM) starts with the string (header)
0xfe 0x00 0x00 0xff,
instead of 0x55 0xff 0x00 that is used on the RCX.

At the packet level, all packets look like this:
0xfe 0x00 0x00 0xff 0x00 D1 ~D1 D2 ~D2 ... Dn ~Dn C ~C
where D1...Dn are the message body, and C = D1 + D2 + ... Dn.

For example an "Alive" (ping) message:
fe 00 00 ff 00 10 ef 10 ef
or
fe 00 00 ff 00 18 e7 18 e7

When the RCX/CM has recieved and understood a message from your computer,
it sends a reply.
This reply message has the form of a header, and then follows a short data
package. In most cases,
this data package is just the same opcode that was recieved, but inverted
(logical complement), and it
uses the same checksum conventions as the package from the PC to the RCX/CM.
See Kekoa Prodfoot's excellent desciption for more details on this:

http://graphics.stanford.edu/~kekoa/rcx/opcodes.html

However, the header package (from the CM to the PC) differs from the RCX as
well. On the RCX, the same
header is used in both directions, and it is 0x55 0xFF 0x00 as stated before.
The header for packages sent from the CM to a PC is just a single byte, 0xFF.

An example of what is actually transmitted on the serial line:
[PC sends a Alive message (ping) - Opcode 0x10]
fe, 00, 00, ff, 10, ef, 10, ef
[CM sends a reply to the Alive message - Opcode 0xEF - which is the logical
complement to 0x10]
ff, ef, 10, ef, 10

For a commented data capture session of PC <-> CM communication, see here:

http://www.viktoria.informatik.gu.se/~peter/lego/captured_data.txt

However, the CM and RCX serial communication differs in more ways than just
the header in the
logical packet protocol. The physical layer protocol is also somewhat
different. In order to work
properly, the CM (RF Tower) must have DTR and RTS properly set.
See my web page for more details.

http://www.viktoria.informatik.gu.se/~peter/lego/

Hope ths helps!
//Peter



At -0800 1/25/99 15:56, you wrote:
Sten,

your problem is probably the following:

you need to send the complement of the checksum as well,
so the complete packet would look like this:

0x55 0xFF 0x00 0x10 0xEF 0x10 0xEF

I am sending a byte sequence like the following:
0x55 0xFF 0x00 0x10 0xEF 0x10
where the three first bytes are the header,
0x10 is data and 0xEF is complimentary to 0x10
and the last 0x10 is checksum (sum of all data mod 256)

The light on the rcx radio tower is blinking when I send the data
but the light on the rcx is not blinking as it should when receiving data.

I get nothing back to th PC.

--
Did you check the web site first?: http://www.crynwr.com/lego-robotics

-------------------------------------------------------------------------
Peter Ljungstrand; PLAY Research Group, Viktoria Institute

http://www.viktoria.informatics.gu.se
Email: peter@informatics.gu.se
Phone: +46-(0)31-7735543        Mobile: +46-(0)708-302251
Fax: +46-(0)31-7735530        ICQ: 6820636
Visitors: Viktoriagatan 13, 7th floor
Snail-mail: Box 620, 40530 Göteborg, Sweden

--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message is in Reply To:
  Re: Communicating with Cybermaster not easy
 
Sten, your problem is probably the following: you need to send the complement of the checksum as well, so the complete packet would look like this: 0x55 0xFF 0x00 0x10 0xEF 0x10 0xEF (...) -- Did you check the web site first?: (URL) (26 years ago, 25-Jan-99, to lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
11 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR