Understanding Xbee's: API or AT, Coding, Baud Rate

So I got my school to buy me 2 series2 Xbees (I think the ZB with pro set), 2 Arduinos with the atmega328 and the shields. I finally got everything soldered together and working.

After a few stumbles I finally flashed one as a coordinator AT and another as the end/router AT both on a baud rate of 19200. I'm getting pretty good results with the 19200 atm.

My first question is what is the highest baud rate the arduino and xbee can operate at without data loss? Any differences in transmit performance with respect to API?

I've been reviewing the docs for the API and I'm not fully up to speed on the advantages of using API. Does encapsulating the serial data into frames provide better error checking? If it does at what cost? I'm more concerned with speed than anything. I'm building a beetle class sumo robot for robot battles and need fast comms for control. I figured decoding frames would be a bit slower in a fetch decode execute cycle.

And lastly the code. I've been reviewing some example code sending data over serial for AT and I think I'm getting the hang of it.

serial.write(value, type);
and, if need be, cast it on the receivers side?
I'm thinking I'm going to be sending fixed width 2 byte unsigned numbers. I can Map them before the transfer and back after being received if need be.

Is there a more efficient method? The numbers will be much smaller than 65535 more likely between 2000 and 3000. (pulse widths for the electronic speed controller) I could get away with a byte and a nibble but I'm not sure how to force the arduino to break the number up into 3 hex digits instead of 4?

Any help is greatly appreciated
:slight_smile: