Project Updates for 9/10/2010
Yesterday I got the code for transferring multibyte data via SPI working. I ended up using the first byte from the arduino to choose which channel I wanted to get data on, which stored the data on the PIC in a static variable, so I could get read multiple times without the number changing and then sending 0xff to get remaining bytes. It works quite well and I was considering setting it up so the first byte was a command, with subsequent bytes being data transferring back and forth. This would allow me to set the PIC up in different modes and allow it more capabilities than I had originally intended.
I also have a new algorithm for the timer to read multiple channels successfully. However, in it's current form it has some limits. First, I need to set which channels are active for it to work. Second, if there is no data being received from an active channel, the entire thing stops until it starts getting data from that channel. I'm trying to devise a way for it to automatically detect which channels are active upon initialization, but I haven't come up with anything reliable yet, so it has to be set manually. Additionally, the way the timing is working, it appears the first channel is taking just a little longer for timing, but it may just be in how I have the RC transmitter programmed. So my current task is to try and either detect the active channels automatically, or modify the timing algorithm to not require this. Another option would be to add the option to send commands via SPI, so the active channels could be set that way. At this point, I'm very close in getting a first prototype of the robot running.