From: David E. <d.a...@du...> - 2002-09-15 01:02:16
|
The serial comms aspect is complicated, but not too complicated. I am thankful for that! It seems most of the work has to be done by software so I don't have to worry about it. As far as I can tell, it works like this: The download program sends a character to the tower. The tower sends it to the RCX's IR port. The IR port decodes this, and frames the data in such a way that the SCI (serial comms interface) can understand it. The SCI (the thing I have to implement) monitors the receive data line (Rx), and when it detects a start bit, it fills up an 8-bit register. It then checks this for parity, etc. and if it all checks out, it puts it into the received data register, and calls an interrupt. The problems I can see: 1. Getting the download program to send to my fake IR tower. I've had a look at the code that lejos uses for download, and it seems that if I can do some fakery and get RCXTTY=fakeir to output to somewhere I can also read from, I can use unaltered download code. I don't know enough about this area to do anything yet; I'm going to ask around at work to see if anyone knows how to do it. 2. Working out how to frame the data, and in what format it is transmitted by the tower. Hopefully it's a straight translation. It looks like after every character is sent by the download code, it waits for a reply. This is a good thing because I don't have timing to worry about. I'll have a go this week, and post here with an update. Dave. |