|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Using an FRC with the RCX?
That'd probably work. It would be interesting, you could say, have the RCX in charge of controlling drive motors, leaving the RC free to determine where you want to go, etc. I have a Mindstorms set (plus all of the expansions (a few of them twice
)), so I might find this and interesting thing to look into.--EDIT-- Oh, yeah. NQC is good, but BrickOS (former LegOS) is better. BrickOS is also C/C++ programming, but everything is precompiled, not interpruted like with NQC and the default LEGo firmware. |
|
#2
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Plus, if you have an RCX v1, there is a 9-volt AC adaptor plug in the back (made for the train adaptors). So, connect the 12v Exide to a 12vdc-9vdc transformer, hook that up to the RCX, and you don't need to use 6 AAs!
Anyway, The connecting cable won't be standard: the tower is a Male with just enough space for the cable that came with the kit (No screws). The FRC prog is female. Both the FRC prog and the LEGO IR Tower (LIRT) are made to connect to a computer, so there are going to be problems if you just connect them directly. (Some good info on RS-232 can be found here.) Using the jargon, we are trying to connect 2 DCE devices. Unfortunately, I only have pins for DTEs which is (DB9): Code:
DTE
Pin Purpose
0 - Gnd (Shell)
1 < DCD (Data Carrier Detect)
2 < Rx
3 > Tx
4 > DTR (Data Terminal Ready)
5 - Gnd (signal Ground)
6 < DSR (Data Send Ready)
7 > RTS (Request To Send)
8 < CTS (Clear To Send)
9 < RI (Ring Indicator)
^Direction (< = DCE to DTE, > = DTE to DCE, - = None)
Code:
FRC LIRT Gnd Gnd Tx Rx Rx Tx DSR DTR DTR DSR (The standard is RS-232.) Last edited by Astronouth7303 : 06-04-2004 at 18:17. |
|
#3
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
![]() I'm going to look up some info on the RC to computer protocol. |
|
#4
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Got it!
Thank you B&B Electronics! Code:
FRC LIRT Gnd - Gnd Tx < Rx Rx > Tx DTR < DSR DSR > DTR RTS < CTS CTS > RTS DCD X DCD RI X RI The pins are as follows (DB9): Code:
Shell Shell (optional)
5 5
3 2
2 3
4 6
6 4
7 8
8 7
So if anyone fries something doing this, please tell us before we fry something! |
|
#5
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
![]() You'll have to wait until tomorrow for the info. Sorry. ![]() |
|
#6
|
|||
|
|||
|
Re: Using an FRC with the RCX?
Two questions:
1) What kind of hardware would I need on the receiving end to make this work? 2) Has anyone tried to accomplish this successfully? Thanks, I would have never thought of trying something like this! |
|
#7
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
Quote:
![]() |
|
#8
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Here are a few links:
Packet description: (includes example of sending IR message) http://graphics.stanford.edu/~kekoa/rcx/protocol.html From this website, I think that sending: 55 ff 00 f7 08 M ~M C ~C Where C is the checksum. Sends the messageM. One thing I'm confused on is the checksum. It doesn't seem to work the way I read it in his description. Even trying to figure the checksum using his example I didn't come up with the same thing he did. It may be I just don't understand it. If you kow, tell me how to compute it. Some more stuff on the packets: (not as good) http://graphics.stanford.edu/~kekoa/rcx/#Protocol Do you need to know how to send that out, or do you already have that figured out? --EDIT-- Here is a site with examples of using it in C++. http://www.generation5.org/content/2001/rob08.asp. Reading that, it's a great site. ![]() Last edited by Ryan M. : 07-04-2004 at 07:13. |
|
#9
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Quote:
A message packet is only one additional info section. Header (3 bytes) OpCode (2) Message (Info, 2) Checksum (2) The OpCode for Message is 0xF7. It has one argument: the message value. Every data byte is followed by it's not. So you get: Header = 55FF00 OpCode = F708 Message = M ~M CheckSum = (F7+M) & FF I think we're finally getting it! The second link is extremely helpful. And I'm glad to know about the Null-modem cable thing: The LIRT is CTE, not a CSE (it is a male, like your computer), so maybe a standard cable works! |
|
#10
|
||||
|
||||
|
Re: Using an FRC with the RCX?
You said the prog port earlier, but how do we access that? Or, rather, can we get enough control to do what we want? You can send text, but I haven't studied the printf() access of the port. Maybe that port will work or maybe something else is necessary. Correct me if you know the way.
![]() |
|
#11
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Quote:
I looked in printf_lib.c I traced the flow of execution from printf(), and ended up at Write_Byte_To_Uart(). Which is: Code:
/*********************************************************
* SUBROUTINE NAME: Write_Byte_To_Uart
* PURPOSE: Writes a byte to the UART.
* Argument Type IO Description
* -------- ----------- -- -----------
* data int I data to transmit to the UART
* RETURNS: void
*********************************************************/
static void Write_Byte_To_Uart(int data)
{
TXREG = data; /* a carriage return */
Wait4TXEmpty();
}
Code:
#define SendByte(Byte) {TXREG = Byte; Wait4TXEmpty();}
You call this repeatedly to write the whole packet. Of course, You can't recieve: the LIRT only remains active for 3 seconds after you transmit something. Also: this whole setup is unusual, so if it doesn't work, don't worry. We just may end up buying a pair of UART DTEs and making a double box! ![]() |
|
#12
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
![]() And the macro looks fine. ![]() |
|
#13
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Quote:
Quote:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FRC Program State Frozen at Power-up | WillyC | Control System | 4 | 14-02-2004 18:05 |
| Request for FLL Volunteers for FLL National Invitational at the FRC Championships | Natchez | General Forum | 3 | 08-04-2003 12:19 |
| Controlling a FIRST robot with a Lego RCX Controller? | archiver | 2001 | 5 | 24-06-2002 04:19 |