To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.trainsOpen lugnet.trains in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Trains / 21060
21059  |  21061
Subject: 
Re: leJOS & LDCC IRP
Newsgroups: 
lugnet.robotics.rcx.java, lugnet.trains
Date: 
Fri, 12 Sep 2003 12:58:36 GMT
Viewed: 
365 times
  
In lugnet.robotics.rcx.java, Brian B. Alano wrote:
Brian B. Alano wrote:
I'm writing a leJOS package to support the LDCC IR Protocol. I've been testing it
against Full Throttle. It works fine with the speed controls, but doesn't even
seem to see packets for the function commands, stop, or power commands. At first
I was just checking for the 0xF5 opcode byte, but even when I just look for any
and all packets, I don't see these other commands. I tried using another
computer, in case there was something funny with my configuration. No luck. I
traced the serial output from Full Throttle. This leads to questions 1 and 2
regarding LDCC IRP:

1. Why do some packets use fd instead of f5 for the opcode?

I re-used a function to send command packets to the RCX that was designed for
use with the original firmware, so it toggles the 0x08 bit of any repeated
opcode bytes.  Mark pointed this out to me when I was developing Full Throttle,
but then he "fixed" it in LDCC, so I never actually fixed my code.  (I really
should do that...)  To be fully compatible with the current implementation, you
should mask off the 0x08 bit from the packet opcodes, although this isn't
specified (AFAIK) in the LDCC IRP documentation.

2. What's the purpose of the 01 in the second byte? Future use as an LDCC
controller address?

That is correct.  Mark designed the LDCC IRP with the ability to address up to
15 RCXes running LDCC, although at last report this was not yet implemented in
the LDCC firmware.  (All current LDCC RCXes are hard-coded at address 01.)  This
is one of the enhancements that I alluded to in an earlier post that will make
it possible to control more than 9 locomotives on one layout.

Oh, here's another LDCC IRP question:
3. in ldcc105.zip, the example file ldcc_lnp.c uses lnp_addressing_write() to
send IRP commands. Does this mean that LDCC is listening for both IRP commands
using opcode 0xf5 AND for IPR commands embedded in LNP packets?

Mark could say for sure, but I believe that this is the case.  LDCC is intended
to recognize both simple F5 opcodes and LNP packets.

Then a leJOS question (I think) and my real problem:
4. As far as I can tell, the only significant difference between the speed
commands and the other commands at the packet level is that the speed commands
are 6 bytes long (e.g. f5 01 01 01 80),and the others are 3 to 5 bytes long (e.g.
f5 01 04). I'm  using the Serial class to read the packets. As far as I can tell,
Serial isn't doing any validity checking on the packets, just taking whatever the
ROM gives it. I assume the ROM can read this packets or LDCC wouldn't recognize
them either. Why would the Serial class ignore the shorter packets?

Discouraged, disheartened, and fearful. Maybe I should go FORTH to brickOZ.
;)
-Brian

I don't know what is going on here, not having played with LeJOS as much as I
would like to.  Don't be discouraged, though.  It sounds like you're making a
lot of progress.

- Chris.



Message has 2 Replies:
  Re: leJOS & LDCC IRP
 
(...) I'm not really there yet, just couldn't resist the Lion, Tin Man and Scarecrow metaphor. -Brian (21 years ago, 12-Sep-03, to lugnet.robotics.rcx.java, lugnet.trains)
  Re: leJOS & LDCC IRP
 
(...) Yes, this is right, to be friendly to as many implementations of the Lego IR protocol as possible, receiving programs should just mask off bit 3. (...) While the code is there to discern packets with different addresses, I haven't yet added (...) (21 years ago, 12-Sep-03, to lugnet.robotics.rcx.java, lugnet.trains)

Message is in Reply To:
  leJOS & LDCC IRP
 
Brian B. Alano wrote: I'm writing a leJOS package to support the LDCC IR Protocol. I've been testing it against Full Throttle. It works fine with the speed controls, but doesn't even seem to see packets for the function commands, stop, or power (...) (21 years ago, 12-Sep-03, to lugnet.robotics.rcx.java, lugnet.trains)

14 Messages in This Thread:





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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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