|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||||
|
|||||
|
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! |
|
#3
|
||||
|
||||
|
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.
![]() |
|
#4
|
|||||
|
|||||
|
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! ![]() |
|
#5
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
![]() And the macro looks fine. ![]() |
|
#6
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Neither do I. I just read the file. It's aparently easy!
|
|
#7
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
2 updates:
1. Found gray cable setup. Code:
GRAY CABLE Rx Tx Tx Rx DTR DTR Gnd Gnd RTS CTS CTS RTS Code:
From front: 1 2 3 4 X X 5 6 X 1 2 4 3 X X 6 5 X Get the idea? 2. What's the TTL output? I was thinking of the possibility of connecting through that. The prog port is used for so much else! |
|
#8
|
||||
|
||||
|
Re: Using an FRC with the RCX?
Quote:
![]() Quote:
![]() ![]() |
|
#9
|
|||
|
|||
|
Re: Using an FRC with the RCX?
I know that its probably more fun to reverse-engineer it, but have you guys thought about talking to LEGO for the specs? I know that they sponsor team 96 and I think their mindstorms engineers work with them.
|
|
#10
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
Why? all the reverse-engineering and spec-finding has been done for us. The most reverse-engineering I've done yet is putting a continuity tester to the original gray cable! And RS-232 has been standardized to death, so it's the easiest protocal to use (at either end!).
|
|
#11
|
|||||
|
|||||
|
Re: Using an FRC with the RCX?
The TTL port uses the same transmission format as RS-232 (low start bit, 8 data bits, high stop bit). So if you take a 3-pin cable and attach it the Tx, Rx, and Gnd pins on a DB9 female connector, you can use TTL port instead of the prog port. The macro would need to be changed slightly.
Odd, ifi_utilities.c and printf_lib.c both use 'TXREG', but ifi_picdefs.h defines 'TXREG1' and 'TXREG2'. |
|
#12
|
||||
|
||||
|
Re: Using an FRC with the RCX?
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 |