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 / 15185
15184  |  15186
Subject: 
Serial Port Protocol
Newsgroups: 
lugnet.robotics
Date: 
Tue, 17 Apr 2001 00:22:50 GMT
Viewed: 
765 times
  
Hi all. I'm new to the list.

I'm using Robolab and NQC on a Mac, interfacing with Macromedia Director 8
through the serialXtra. So far so good, thanks in no small part to the info
posted by Dave Baum and Kekoa Proudfoot. I can make the Lego "beep" and send it
messages which control the RCX. All from Director. When I get it working
perfectly I can put it open-source somewhere, as I saw on the list that
periodically people ask about interfacing Director with Mindstorms. I've done a
lot of robotics interfacing with Director, and I've always found it a perfect
match.

But it's not perfect yet. I've run into the odd repeat-serial communications
protocol issues. When I clear out the message buffer in my Robolab program,
message sending works fine, i.e. I can send over and over the same message.

But when I do a "beep", as Dave Baum explained how to do, I run into the
messaging problems Kekoa outlined at:

http://graphics.stanford.edu/~kekoa/rcx/#Protocol

Notably: "Messages sent by PC seem to alternate between having 0x08 set and not
set. This 0x08 bit is a sequence bit only in one special case. RCX never
executes same exact opcode twice in a row. Second and beyond are dropped. But
the same reply that was sent the first time is sent again. Toggle 0x08 bit to
make sure same opcode twice in a row is accepted."

I'm not totally sure I understand this. I don't know what Opcodes are. I
undstood the following comment, "Sometimes packets start with aa ff 00 instead
of 55 ff 00", so I made a flip-flop header routine that switches between "55"
and "AA" (I guess this is 0x55 and 0x100-0x55 ?)  in Lingo and I stop getting
parity errors from the Serial Xtra. But I still haven't  understood exactly what
the 0x08 bit is. Where is this 0x08 bit? For me, the 0x08 bit is 2^7. So do I
add 128? Or is this some sort of signed/unsigned issue? (I'm not an expert at
all this, I get by as well as I can).

When Dave wrote:

"At the packet level, all packets look like this: '0x55 0xff 0x00 D1 ~D1 D2 ~D2
... Dn ~Dn C ~C' where D1...Dn are the message body, and C = D1 + D2 + ... Dn.
The data for sending an IR message is F7 followed by the 8 bit "message". For
example: '55 ff 00 f7 08 12 ed 09 f6' "

I got it, and it got messaging working, but this was incomplete. When you try
this with sending a beep (D1 = 0x51, D2 = 0x03) you can only send it once. You
have to send another message before sending a second beep.

So I'm kind of trapped between Dave's explanation which is, for me, half
complete (because he doesn't explain how to deal with toggling issues at the
packet level); and Kekoa's response which was just slightly over my head. I've
done bitmasking and all that fun stuff, but again I'm not a pro. I only get by
with tinkering...

Douglas Edric Stanley
destanley@mac.com

http://www.abstractmachine.net

Professor of Digital Arts, School of Fine Arts, Aix-en-provence
Artist-in-residence, Laboratoire SCAN, Villa Arson, Nice
Artist/Researcher, Interactive Aesthetics Lab (LEI), University of Paris 8



Message has 2 Replies:
  Re: Serial Port Protocol
 
(...) Here is an example that I hope clears things up: You said you know how to make the RCX beep. You didn't go into details, but to summarize, it is something to the effect of sending it 51 00 encoded in 55 ff 00 with complements and checksums. (...) (24 years ago, 17-Apr-01, to lugnet.robotics)
  RE: Serial Port Protocol
 
Hi there, I've just gone through this myself, only a few days ago. Check (URL) it should answer your question. But to cut-and-paste what I wrote: ===...=== Sending the Same Message You cannot send the same message to the RCX, since the RCX never (...) (24 years ago, 17-Apr-01, to lugnet.robotics)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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