Here is a place holder picture, until things are back in one piece:
As I mentioned in the thread on my new Brat, I am now in the process of converting my DIY Remote control to be XBee baised instead of Spektrum DM8 radio. You can see some of the different XBee holders that I have in the other thread: lynxmotion.net/viewtopic.php?t=5403
As I now have the hardware talking to each other, I am now working the code conversion of the DIY remote as well as a sample receiver program that I will then merge into one (or more) of my robots. As I start the code conversion some interesting options come up, which so far include:
I need to develope some form of handshake between the two units. I could keep blasting out the current info and have the receiver try to figure out where a new frame of information starts (seems primitive). Could Work closer to PS2 code, where Robot sends a request and waits for Controller to send current data. Next option would be for Controller to know if data has changed and send out a simple pulse saying I have something new. The Robot when it receives this and desires the new data can then query it when it is ready. This should cut down traffic a lot. Could enhance this to by setting thresholds on how much the data needs to change before the change signal is generated…
What form of data should be sent. Lots of possibilities, but the main ideas are: Leave it in RC servo format 1500 center (Does not make a lot of sense here). Convert it to be very similar to PS2 packet. 1 byte for each slider/direction of stick with 128 as zero, and 2 bytes for the state of the buttons. This would work well, but I believe we found that these joysticks maybe had a range of 392-692 (~300 values), so converting to 1 byte would lose some accuracy. Could instead send 2 bytes per slider/joystick (SWORD). More accuracy but longer transmit/receive time. Might be a good tradeoff if you need this. Optionally the code could be setup to send either. Buttons would be encoded as 2 bytes, with 1 bit for each button.
Should we reserve one (or more) of the buttons on the keypad for stuff on the remote. For example you may want to press a button and have it display the different robots, you have configured your remote to control and allow you choose which one… Could add another button for this but currently I have only 1 (2 if I don’t use RTS) or maybe 3 if I use some hardware hack on P9 which I believe Xan has done.
What to display on the LCD. Could keep like now which shows the values, which is great for debugging, but may not be that interesting in other cases. Could hard code several pages that you can cycle through and/or could have pages or fields that the current robot could upload. Things like distance to object, or how many things have I fired, or I just fell down…
I need to work on latency time. The current code is geared around the cycle time of the RC transmitter. May want to reorg such that I am always ready to transmit when the remote robot want’s it…
That is most of the questions I am thinking about right now. Suggestions?
The XBee conversion is going a little slower than it should as I keep running into diversions. (You can easily skip the rest of this paragraph!)The first diversion was that the AppBee Sip board from Selmaware which takes care of the 3.3v to 5.0V signal conditioning for RX and TX also does it for RTS, which their examples in their manual use. This allows the XBEE to hardware buffer up any transmissions and only output them to the serial port when the RTS line is brought low using the SERIN TX\RTS form of serin, which Atom Pros support. So I tried this and received nothing. … AcidTech (Nathan) found the problem and build a new version which now works! The question will be to use or not use this later as the Sparkfun adapter which is cheaper and smaller may not condition this signal. But may be able to reorder pins and use of the two IO lines that normally are 3.3 volts on the BAP… The second diversion is I unfortionatly wired up the cable to the second one wrong and had +5 and Ground swapped, may have hurt the board, luckilly had a third one.