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 / 1822
1821  |  1823
Subject: 
RCX Serial
Newsgroups: 
lugnet.robotics
Date: 
Sun, 27 Dec 1998 07:26:55 GMT
Original-From: 
dave madden <dhm@paradigm.webvision./NoSpam/com>
Viewed: 
1204 times
  
I'm embarassed to post with such a trivial discovery, but in the hopes
of saving somebody a little time:

You can get the serial port to transmit under legOS by doing

        *((char *)0xffd0) = 0x09;   // TCR
        *((char *)0xffd1) = 0x13;   // TCSR
        *((char *)0xffd8) = 0x30;   // SMR
        *((char *)0xffda) = 0x09;   // SCR
        *((char *)0xffd9) = 207;    // BRR

and then:

        if (*((char *)0xffdc) & 0x80) {
            asm( "bclr #7, 0xDC:8" );   // SSR
            *((char *)0xffdb) = 'X';    // TDR
        }

Watch for 'X' on a serial port connected to the IR tower.  The tower
shuts off after a second or two with no (transmit) activity, so be
sure to send characters occasionally to keep it turned on (the green
light indicates that the tower is receiving [and echoing] characters
on its serial cable, not that it has detected IR activity.)

The settings above turn off all Tx/Rx interrupts, so they're not
particularly useful except as proof-of-concept.  Also, I'm not sure
whether you have to clear bit 7 of the SSR.  Finally, I must be
missing something, because this doesn't work after a power-cycle with
legOS running -- the RCX ROM must be setting something serial-related
that gets cleared and not set up properly the next time.

BTW, my goal is to be able to speak serial to the RCX:

    linux-box% minicom RCX
    RCX Ready!
    RCX> cat /dev/sensor1
    77
    ^C
    RCX> ls
    prog1
    RCX> ./prog1
    Hello, world!
    Sensor 1 value is 77
    RCX>

So, in addition to serial drivers, I'll need devices, a filesystem, a
simple shell, and probably expansion memory...

regards,
d.



1 Message 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